PyWIB
PyWIB (Python Web Interaction Behaviour) is a Python library for analysing user interaction data recorded from web pages (mouse movement, clicks, keystrokes, scrolls) and computing HCI research metrics from it: velocity, acceleration, jerkiness, angle, trajectory deviations, AUC, click slip, typing speed, pauses, and more. It also provides trace visualisation and video generation of sessions.
How to
To install PyWIB, please use:
pip install pywib
Understand PyWIB
To first understand how to use PyWIB, we suggest taking a look at the Introduction section of our documentation, which explains it's main features, limitations and provides a small tutorial on how to start working.
Prepare your data
PyWIB expects a strucuted input that complies with the following format:
| Column | ColumnNames |
Meaning |
|---|---|---|
sessionId |
SESSION_ID |
Identifies one user session |
eventType |
EVENT_TYPE |
Integer code, see EventTypes |
timeStamp |
TIME_STAMP |
Event time |
x, y |
X, Y |
Pointer coordinates |
elementId |
ELEMENT_ID |
Target element |
sceneId |
SCENE_ID |
Page or scene identifier |
keyValue, keyCode |
KEY_VALUE, KEY_CODE |
Keyboard events |
This data structure is further explained in the documentation.
Process user data
A minimal example of how to use PyWIB is presented here. If you require deeper information about the librarys API please consult the documentation.
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")
Running the tests
First, navigate to the PyWIB folder
cd pywib
Then install the required dependencies using python, use a virtual environment if you wish to.
pip install pytest
pip install -r requirements.txt
Then, run the tests using:
pytest test
Citation
If you use our tool in your research, we kindly ask you to cite us.
G. D. Carvajal-Aza, A. Alvarez-Varela, J. De Andres, M. Gonzalez-Rodriguez, D. Fernandez-Lanvin, and M. 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), Nice, France, Jul. 2026, pp. 103–108. Available: https://www.thinkmind.org/library/IARIA_CONGRESS/IARIA_Congress_2026/iaria_congress_2026_1_170_50103.html
Generating Documentation
For bulding the PyWIB documentation in your local device, use:
cd pywib/docs
make html
And then access docs/build/html/index.html to navigate.
PyWIB in other media
Metadata
Release files for pywib 3.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pywib-3.0.1.tar.gz | 1.2 MB | Without provenance | Details for pywib-3.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pywib-3.0.1-py3-none-any.whl | Python 3 | none | any | Details for pywib-3.0.1-py3-none-any.whl |
Total release size: 1.2 MB
Release files / pywib-3.0.1.tar.gz
| Download URL | pywib-3.0.1.tar.gz |
|---|---|
| Size | 1.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d857dc3c656df1305506bcc0c61c6808012c014bc1dcd22b42752aebd8f11b85
|
|
BLAKE2b-256 checksum How to use checksums |
2be3a77ab0b238e29cce2eec99945a2a0aad9bb9ee9e69b0d12b84b6e9569f83
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.22
|
Release files / pywib-3.0.1-py3-none-any.whl
| Download URL | pywib-3.0.1-py3-none-any.whl |
|---|---|
| Size | 54.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ad7a8cd37d0d4594e888e043b0c22cc06fcddcce5022b00b7c182f2db85ddfc6
|
|
BLAKE2b-256 checksum How to use checksums |
2919ba65abf94186c9d2c4f5c9ff423cb94eda688337711bb56ed71854e28336
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.22
|
Security for pywib 3.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.