Rust-accelerated PyAutoGUI 0.9.54
This fork preserves the established PyAutoGUI 0.9.54 API while adding an optional user-mode Rust fast path on Windows.
import pyautogui
pyautogui.moveTo(500, 300, duration=0.2)
pyautogui.click()
pyautogui.write("hello", interval=0.03)
image = pyautogui.screenshot(region=(0, 0, 800, 600))
box = pyautogui.locateOnScreen("button.png", confidence=0.9)
No Rust-specific import or new calling convention is required. If the extension is absent or one native operation fails, that operation silently returns to the original Win32 ctypes or PyScreeze implementation.
Windows fast paths
- Batched
SendInputkeyboard and mouse events - Virtual-desktop coordinates and negative monitor origins
- Per-monitor V2 DPI awareness
- Reusable
CreateDIBSectionGDI capture contexts - Parallel hierarchical grayscale SAD template matching
- Deadline-based smooth movement with scoped 1 ms timer resolution
- Low-level failsafe monitoring
- GIL release around native capture, matching, input, and movement
The project contains no kernel driver, service, test-signing workflow, or special boot requirement.
Universal visual location
Still images, GIF representative frames, DPI/zoom variants, and moving targets share an adaptive locate pipeline. Large or highly changed references can use the external 359k-parameter TinyLocate network. Its framework-free CUDA runtime is compiled into the Rust extension; the 721 KiB model remains a separate file. High-confidence neural hits contribute a small, bounded in-memory appearance bank, so a moving or animated target can adapt without writing captures to disk.
python tools/install_tinylocate_model.py path\to\tinylocate-v1.tln
python tools/smoke_tinylocate_runtime.py path\to\tinylocate-v1.tln
Existing calls stay unchanged:
box = pyautogui.locateOnScreen("target.png", confidence=0.8)
boxes = list(pyautogui.locateAllOnScreen("target.gif", confidence=0.8))
Model training uses PyTorch only in the development environment and exports the custom TLN1 FP16 container. Runtime loads neither PyTorch nor an ONNX engine. See PRODUCT_VISION.md for routing, accuracy, and latency gates.
Requirements
- Python 3.9+
- Windows wheels use CPython ABI3
- Building from source on Windows requires stable Rust, MSVC Build Tools, and a Windows SDK
Optional vision dependencies are available with:
python -m pip install -e ".[vision]"
Build and test
python -m pip install -e ".[dev,benchmark]"
python tools/check.py --build
The default test suite is hermetic and does not emit operating-system input. See DEVELOPING.md for architecture, benchmarks, CI, and release checks.
Upstream PyAutoGUI documentation remains applicable to the public API: https://pyautogui.readthedocs.io/
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyautogui_rust-0.9.54.1.tar.gz.
File metadata
- Download URL: pyautogui_rust-0.9.54.1.tar.gz
- Upload date:
- Size: 252.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
694336c675f324230d6b77c2948f14a8cb3bc75d35669f4a89ac3f2829db9294
|
|
| MD5 |
934d69a4c7e646715d49f5c1126e1f28
|
|
| BLAKE2b-256 |
24ca3f45208373b18e6fc6815add7d0460cbfad65c5d89f2217de9ddc9276dca
|
File details
Details for the file pyautogui_rust-0.9.54.1-cp37-abi3-win_amd64.whl.
File metadata
- Download URL: pyautogui_rust-0.9.54.1-cp37-abi3-win_amd64.whl
- Upload date:
- Size: 308.8 kB
- Tags: CPython 3.7+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55c1d74d7e86bb178b4a85b14a6f253ae85ca930d676ffdc40cd377deaa77005
|
|
| MD5 |
9b591786c54b36d196836f153a1b54d4
|
|
| BLAKE2b-256 |
31acea9753e36acfbcf447784122615bb03a743ead55896d42fdc471b38d10e8
|