Automated mouse clicking script
Project description
clickpy
Automated mouse clicker script.
Installation
I've only tested this packag with Python 3.9. You'll need to download and install it, or use pyenv and set your local version with this command:
pyenv local 3.9
I also recommend using pipx for installing standalone packages, as it will add a layer of isolation to your installation. But pip will work too:
pipx install clickpy
# -- or --
pip install clickpy
Development
Using Poetry to manage the virtual environment and packages. I also highly recommend using Pyenv to install and manage your python interpreters.
This script uses pyautogui for clicking and Typer for CLI parsing.
Testing
This project utilizes pytest and pytest-mock. Both should be included in pyproject.toml dev dependencies, and .vscode/settings.json
should already be setup to use these libraries.
Please type annotate any mocks used, which should be MockerFixture
if you use pytest-mock.
Scripts
The following is for developers. You don't need to run these scripts to install and run from pip.
# define your local python version
pyenv local 3.9.6
# install all deps from pyproject.toml
poetry install
To run clickpy with poetry. This will activate the virtualenv, and then run the script defined in [tool.poetry.scripts]
in pyproject.toml.
poetry run clickpy
TODO: might look into tox later, also pre-commit looks interesting.
# activate virtual environment first
poetry shell
# run tests, also outputs code coverage
pytest -v --cov=clickpy tests/
# -- or --
# run this outside virtualenv
poetry run pytest -v --cov=clickpy tests/
# run tox tests
poetry env tox
# -- or --
poetry shel
tox
# you may need to run this command, if pyautogui throws errors
touch ~/.Xauthority
# run this to generate report
coverage html
# open html coverage
open htmlcov/index.html
# -- or --
# for windows, opening html coverage
start htmlcov/index.html
Open coverage report in bash. This should also work with Windows Git Bash
# open html coverage doc, windows doesn't have open.
[ -x "$(command -v open)" ] && open htmlcov/index.html || start htmlcov/index.html
# same command for fish shell
[ -x (command -v open) ] && open htmlcov/index.html || start htmlcov/index.html
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for clickpy-0.5.1a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 156f085dad80b3c6f217ad0678fff7f6a9423b24a57b445f3884171b249cc67d |
|
MD5 | b248c33c7274b8efdd76cc9fd42e06df |
|
BLAKE2b-256 | 54f42107edd62ec1d58e440cc751a601f32e695cc25747056314dd3de2899d8a |