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 bheavioral patterns [Katerina and Nicolaos, 2018], cognitive and physicial conditions affecting the user [Khan et al., 2008, Rhim et al., 2023] or even for user identification [Karim and Hasanuzzaman, 2020] and authentication [].

One could enumerate hundreads 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.

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 example, metrics that are valid for analyzing mouse movements in a desktop web application may not be valid for analyzing touch interactions on mobile devices. Therefore, it is crucial to consider the context in which the metrics will be applied and to validate them accordingly.

Moreover, the setup of an experiment itself can influence the validity of certain metrics [Schoemann et al., 2019, Kuric et al., 2024], which is why pywib encourages users to validate the metrics they compute in their specific context and experiment setup.

Installation

You can install pywib using pip:

pip install pywib

Getting Started

I 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.

After that, you can check the API Reference for more detailed information about the available functions and classes.

Small Example

from pywib import velocity, velocity_metrics

# From an already read DataFrame from a csv
df_all_sessions = process_csv(input_file)
df_all_sessions.rename(columns={'moveX': 'x', 'moveY': 'y', 'id_usuario': 'sessionId'}, inplace=True)

vel = velocity(df_all_sessions)
vel_metrics = velocity_metrics(vel)

acc = acceleration(vel, None, True)

References

[1]

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.

[2]

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.

[3]

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.

[4]

Masud Karim and Md Hasanuzzaman. A study on mouse movement features to identify user. Sci. Res. J., 08(04):77–82, April 2020.

[5]

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.

[6]

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.

[7]

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.

[8]

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.

[9]

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.

[10]

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.

[11]

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.

[12]

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.

[13]

Preeti Khanna and M Sasikumar. Recognising emotions from keyboard stroke pattern. Int. J. Comput. Appl., 11(9):1–5, December 2010.

[14]

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.

[15]

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.

[16]

Maarten Dijkstra. The diagnosis of self-efficacy using mouse and keyboard input. PhD thesis, Utrecht University, 2013.