Introduction¶
Welcome to PyWIB (Python Web Interaction Behaviour) the python library designed to help ease the analysis of user interaction data in the field of HCI (Human-Computer Interaction).
This project aims to analyze user interaction with web applications by processing interaction event data (such as clicks, mouse movements, scrolls, etc.) recorded by researchers to aid their studies.
It provides tools to compute various interaction related metrics (like velocity, acceleration, auc, etc.) and other useful functionalities to facilitate the analysis of user behavior, such as stroke visualization or video generation of user sessions.
Rationale¶
The analyisis of mouse interaction has been widely used in HCI to infer in several aspects of the users interaction with the system. This mouse dynamics have been proven useful for analysing behavioral patterns [Katerina and Nicolaos, 2018, Cepeda et al., 2018], cognitive and physicial conditions affecting the user [Seelye et al., 2015, Khan et al., 2008, Rhim et al., 2023] or even for user identification [Karim and Hasanuzzaman, 2020] and authentication [Monrose and Rubin, 2000].
One could enumerate hundreds of research works in this field that have analyzed mouse interaction data to extract meaningful insights about user behavior. However, there is a lack of dedicated tools and libraries to facilitate this analysis, which is a gap that PyWIB aims to address.
As of 2026, there are no other Python libraries specifically designed for analyzing web interaction behavior in HCI research. While there are libraries for this same purpose in other programming languages, such as R’s mousemove [Wulff et al., 2025], they may not be as accessible to researchers who primarily use Python for data analysis and machine learning tasks, limiting as well the integration with other Python-based tools and libraries commonly used in HCI research or the automation of analysis pipelines using Python based APIs.
Cite us!¶
PyWIB was presented on the IARIA Congress 2026 and published in the proceedings of the conference, obtaining a Best Paper Award. If you use PyWIB in your research, we kindly ask you to cite us: [Carvajal-Aza et al., 2026]
Validity of Metrics¶
One of the main problems when dealing with a library that aims to cover computation of, at most, the most common metrics in HCI research is the validity of such ones. For this reason, PyWIB has been developed taking into account the most relevant metrics used in research works, that have been proven to be representative of user behavior in different contexts. This does not mean that the developer team will not expand the library with new metrics in the future, if there is a given need for them, but rather that the initial set of metrics that have been included are those that could be initialy proven to be mathematically and experimentally valid.
Context Specific Metrics¶
It is important to note that not all metrics are equally valid in all contexts.
For this reason, PyWIB provides documentation on the validity and consideration of metrics affected by experimental contexts under the Context Specific Metrics section.
Installation and Getting Started¶
You can install PyWIB using pip:
pip install pywib
Understanding PyWIB¶
We suggest you take a deep look at rest of the documentation, such as the Keyboard Interaction Metrics or Movement Interaction Metrics sections in order to understand the different metrics that can be computed with PyWIB and find those that suit your research.
In order to be consistent with PyWIB’s data structure, we recommend checking out the Data Structure and the Constants _sections to understand how to properly format your data and use the provided constants for column names.
Another key element of PyWIB is the Segmentation _section, which explains how to segment your data into traces for more accurate metric computation. Most metrics are designed to operate on traces, so understanding how to segment your data is crucial for obtaining valid results.
After that, you can check other metrics specifications or the API Reference _for more detailed information about the available functions and classes.
Getting to the code¶
After you have familiarized yourself with the library and found the metrics that best suit your experiment, you can start using it in your own projects.
Below is a simple example of how to use PyWIB to compute velocity metrics and visualize a trace.
from pywib import to_pywib_df, velocity, velocity_metrics, visualize_trace, ColumnNames
# Considering an already loaded CSV into a pandas DataFrame
df = to_pywib_df(df, "sessionIdCol", "xCoordinateCol", "yCoordinateCol", "timeStampCol", "eventTypeCol", "keyValueCol", "keyCodeCol").copy()
v = velocity(df, per_traces=True)
v_metrics = velocity_metrics(df=None, traces=v)
userSession = df[df[ColumnNames.SESSION_ID] == "USER_A"].copy()
visualize_trace(userSession, userSession.index, "USER_A", type="info", save_path="user_a_trace.png")
References¶
Tzafilkou Katerina and Protogeros Nicolaos. Mouse behavioral patterns and keystroke dynamics in End-User development: what can they tell us about users' behavioral attributes? Comput. Human Behav., 83:288–305, June 2018. URL: https://doi.org/10.1016/j.chb.2018.02.012.
Catia Cepeda, Joao Rodrigues, Maria Camila Dias, Diogo Oliveira, Dina Rindlisbacher, Marcus Cheetham, and Hugo Gamboa. Mouse tracking measures and movement patterns with application for online surveys. In Lecture Notes in Computer Science, Lecture notes in computer science, pages 28–42. Springer International Publishing, Cham, 2018. URL: https://dl.acm.org/doi/10.1007/978-3-319-99740-7_3.
Adriana Seelye, Stuart Hagler, Nora Mattek, Diane B Howieson, Katherine Wild, Hiroko H Dodge, and Jeffrey A Kaye. Computer mouse movement patterns: a potential marker of mild cognitive impairment. Alzheimers Dement. (Amst.), 1(4):472–480, December 2015. URL: https://alz-journals.onlinelibrary.wiley.com/doi/10.1016/j.dadm.2015.09.006.
Iftikhar Ahmed Khan, Willem-Paul Brinkman, Nick Fine, and Robert M Hierons. Measuring personality from keyboard and mouse use. In Proceedings of the 15th European conference on Cognitive ergonomics: the ergonomics of cool interaction. New York, NY, USA, January 2008. ACM.
Jungwook Rhim, Jiwon Kim, and Gahgene Gweon. Using geometric features of drag-and-drop trajectories to understand students' learning. In Proceedings of the 2023 CHI Conference on Human Factors in Computing Systems, volume 19, 1–14. New York, NY, USA, April 2023. ACM. URL: https://dl.acm.org/doi/10.1145/3544548.3581143.
Masud Karim and Md Hasanuzzaman. A study on mouse movement features to identify user. Sci. Res. J., 08(04):77–82, April 2020.
Fabian Monrose and Aviel D Rubin. Keystroke dynamics as a biometric for authentication. Future Gener. Comput. Syst., 16(4):351–359, February 2000.
Dirk U Wulff, Pascal J Kieslich, Felix Henninger, Jonas M B Haslbeck, and Michael Schulte-Mecklenbeck. Movement tracking of psychological processes: a tutorial using mousetrap. Behav. Res. Methods, 57(11):307, October 2025.
Guillermo Dylan Carvajal-Aza, Alejandro Alvarez-Varela, Javier De Andres, Martin Gonzalez-Rodriguez, Daniel Fernandez-Lanvin, and Mercedes Paino. Pywib: a python library for a multi-modal approach to web interaction behavior analysis. In Proceedings of the 2026 IARIA Annual Congress on Frontiers in Science, Technology, Services, and Applications (IARIA Congress 2026), 103–108. Nice, France, 2026. IARIA Press. URL: https://www.thinkmind.org/library/IARIA_CONGRESS/IARIA_Congress_2026/iaria_congress_2026_1_170_50103.html.
Martin Schoemann, Malte Lüken, Tobias Grage, Pascal J Kieslich, and Stefan Scherbaum. Validating mouse-tracking: how design factors influence action dynamics in intertemporal decision making. Behav. Res. Methods, 51(5):2356–2377, October 2019.
Eduard Kuric, Peter Demcak, Matus Krajcovic, and Peter Nemcek. Is mouse dynamics information credible for user behavior research? an empirical investigation. Comput. Stand. Interfaces, 90(103849):103849, August 2024.
Pascal J. Kieslich, Felix Henninger, Dirk U. Wulff, Jonas M. B. Haslbeck, and Michael Schulte-Mecklenbeck. Mouse-tracking: a practical guide to implementation and analysis. In A Handbook of Process Tracing Methods, pages 20. Routledge, 2nd edition edition, 2019. URL: https://www.taylorfrancis.com/chapters/edit/10.4324/9781315160559-9/mouse-tracking-pascal-kieslich-felix-henninger-dirk-wulff-jonas-haslbeck-michael-schulte-mecklenbeck.
Christian O'Reilly and Réjean Plamondon. Can computer mice be used as low-cost devices for the acquisition of planar human movement velocity signals? Behav. Res. Methods, 43(1):229–238, March 2011. URL: https://link.springer.com/article/10.3758/s13428-010-0030-3#notes.
Beatriz Pariente-Martinez, Martin Gonzalez-Rodriguez, Daniel Fernandez-Lanvin, and Javier De Andres-Suarez. Measuring the role of age in user performance during interaction with computers. Univers. Access Inf. Soc., 15(2):237–247, June 2016. URL: https://link.springer.com/article/10.1007/s10209-014-0388-6.
Clayton Epp, Michael Lippold, and Regan L Mandryk. Identifying emotional states using keystroke dynamics. In Proceedings of the SIGCHI Conference on Human Factors in Computing Systems. New York, NY, USA, May 2011. ACM.
Preeti Khanna and M Sasikumar. Recognising emotions from keyboard stroke pattern. Int. J. Comput. Appl., 11(9):1–5, December 2010.
Lisa M Vizer, Lina Zhou, and Andrew Sears. Automated stress detection using keystroke and linguistic features: an exploratory study. Int. J. Hum. Comput. Stud., 67(10):870–886, October 2009.
A F M Nazmul Haque Nahin, Jawad Mohammad Alam, Hasan Mahmud, and Kamrul Hasan. Identifying emotion by keystroke dynamics and text pattern analysis. Behav. Inf. Technol., 33(9):987–996, September 2014.
Maarten Dijkstra. The diagnosis of self-efficacy using mouse and keyboard input. PhD thesis, Utrecht University, 2013.