Cursor is a Python project for recording, analyzing, and experimenting with cursor/mouse movement data. It provides tools for capturing mouse interactions, processing recordings, and running experiments on cursor behavior patterns.
- Python 3.14
- pip and virtualenv (or pyenv)
- System dependencies:
- PyQt5
- libcairo2-dev
- pkg-config
- python3-dev
- python3-tk
Using uv for setup
curl -LsSf https://astral.sh/uv/install.sh | sh
uv self update
uv python install 3.14
uv venv --python 3.14
source .venv/bin/activate
uv pip install -r requirements.txt
uv pip install -e .
git submodule update --initCopy and customize the configuration file for your environment:
cp config.ini config_local.ini
# Adjust paths to data folder. Within data folder, we expect "recordings" and "experiments" foldersRun tests with code coverage and linting:
# Linux/macOS
py.test --cov cursor -v
ruff format --check .
# Run a single test
pytest tests/test_renderer.py::test_ascii_renderer
# Windows
python -m pytest --cov=cursor . -vRecord cursor movements:
pip install -e .
cursor_recorderRun experiments on cursor data:
pip install -e .
cd experiments
python file.pySee tools for more information on available tools.
Remove recording files smaller than 3KB:
cd data/recordings
find . -name "*.json" -type 'f' -size -3k -deleteShare a directory via SSHFS:
sshfs [email protected]:/home/marcel/share/ ./shareIf you encounter PyQt5 import errors, ensure system dependencies are installed:
# macOS
brew install pyqt5
# Ubuntu/Debian
sudo apt install python3-pyqt5 libcairo2-dev pkg-config python3-dev python3-tkIf you encounter permission or environment conflicts, ensure you're using the correct virtual environment:
pyenv activate cursor
which python # Should point to your virtualenvMake sure to use python -m pytest on Windows instead of py.test directly.