$ show autopilot-rs/autopy
AutoPy is a cross-platform GUI automation library implemented in Rust and exposed to Python through PyO3. It provides programmatic control of the mouse and keyboard, screen capture, bitmap pixel inspection, and color detection. The library abstracts over Windows, macOS, and X11 backends, so the same Python API works across desktop platforms. It is distributed as a Python extension module built with maturin/setuptools-rust and is also usable as a Rust crate.
The LLM identified 5 files worth highlighting for reuse:
Implements keyboard automation by translating logical key names into platform-specific keycodes and synthesizing key down/up events on Windows, macOS, and X11. The keycode translation tables and event-synthesis wrapper are isolated enough to be reused in other Rust input automation tools.
Provides mouse movement, button clicks, and scrolling across OSes, including handling of multi-monitor coordinate systems and DPI scaling. Demonstrates a clean platform-abstracted API over Win32, CGEvent, and XTest backends.
Captures screen regions into a Bitmap type and exposes pixel access, saving, and image finding. The bitmap buffer handling is a reusable pattern for screen capture and computer-vision input.
Queries screen size and pixel colors, forming the foundation for automation decisions. The API is small and self-contained, useful for any project needing fast color sampling.
Registers the Rust automation core as a Python extension module via PyO3, exposing mouse, keyboard, bitmap, and screen submodules. Demonstrates a clean Rust-Python binding layer with error conversion and module initialization.