Skip to main content

🐭 Oxy® Mouse

Generate mouse movements with Python & different algorithms

Discord

OxyMouse is a Python library for generating mouse movements.

It is designed to work with any browser control library that supports 2D moving of the mouse cursor.

Installation

pip install oxymouse

Usage

Specify algorithm an algorithm.

Supported algorithms:

bezier, gaussian, perlin

from oxymouse import OxyMouse

mouse = OxyMouse(algorithm="bezier")
movements = mouse.generate_random_coordinates(viewport_width=1920, viewport_height=1080)

generate_random_coordinates

This method will generate random coordinates based on your viewport width and viewport height.

generate_coordinates

This method will generate random coordinates from a given 2D point to another 2D point.

You can use this to generate movements to a button.

For example:

  • get button coordinates
  • get current mouse coordinates
  • generate movements from current mouse coordinates to button coordinates
from oxymouse import OxyMouse

mouse = OxyMouse(algorithm="bezier")
movements = mouse.generate_coordinates(from_x=400, from_y=500, to_x=1000, to_y=1200)

generate_scroll_coordinates

This method will generate random coordinates for scrolling.

from oxymouse import OxyMouse

mouse = OxyMouse(algorithm="bezier")
movements = mouse.generate_scroll_coordinates()

Supported Algorithms

Bezier

The Bezier algorithm generates mouse movements using the Bezier curve. Perfect for moving to click a button

bezier.png

Gaussian

The Gaussian algorithm generates mouse movements using the Gaussian distribution. Perfect for simulating human-like mouse movements

gaussian.png

Perlin

The Perlin algorithm generates mouse movements using the Perlin noise. Perfect for simulating human-like mouse movements

perlin.png

Testing

You can easily test generated mouse movements visually with specific algorithm.

Use the CLI to test the generated mouse movements.

For example, to test the generated mouse movements with the Bezier algorithm and generate_coordinates function.

python3 visualize.py bezier gc

You will see the generated mouse movements in a window. Similar in the examples above.

Other function names:

function_names_to_function_map = {
    "gc": "generate_coordinates",
    "grc": "generate_random_coordinates",
    "gsc": "generate_scroll_coordinates",
}

Contributing

Contributions are welcome! For feature requests and bug reports please submit an issue!

Metadata

Release files for oxymouse 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for oxymouse 1.1.0
File Size Uploaded
oxymouse-1.1.0.tar.gz 7.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for oxymouse 1.1.0
File Interpreter ABI Platform
oxymouse-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.3 kB

Release files / oxymouse-1.1.0.tar.gz

Download URL oxymouse-1.1.0.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
33be267706c2b1174059d082797d11cbe66da276ffb070e189f136997e7bca7c
BLAKE2b-256 checksum
How to use checksums
e531c4f1f9996ac9374cf00a397f919cd91a7ad76d7a61d2bebf75826057a388
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.10.12 Linux/6.8.0-40-generic

Release files / oxymouse-1.1.0-py3-none-any.whl

Download URL oxymouse-1.1.0-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ddf5afe4ea28498701206d025e66d5e4474947afa9d5b8c50619a361036341a
BLAKE2b-256 checksum
How to use checksums
d5e7e33ff3319f5c57b50cb5b7f4d060b2f7e2431a81ce59b0c6c02cf7e15f01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.10.12 Linux/6.8.0-40-generic

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page