UI automation toolkit based on pyautogui and uiautomation
Project description
easy-uiauto
English | 简体中文
easy-uiauto is a UI automation toolkit based on pyautogui and uiautomation.
It provides a comprehensive set of APIs for GUI automation, including mouse control, keyboard input, window management, and control location. It is suitable for automated testing, RPA (Robotic Process Automation), and other desktop automation scenarios.
Features
- Mouse control: click, double-click, right-click, drag and drop
- Keyboard input: text input, key press/release, combination keys
- Window management: activate, maximize, switch windows
- Control location: XPath-based positioning, image recognition
- Visual feedback: real-time control highlighting during recording
- Action recording: record user interactions and generate scripts
- Rich text field support: clipboard-based text input
- Cross-framework support: Win32, Qt, and other UI frameworks
Installation
Install from PyPI:
pip install easy-uiauto
Or install from source:
git clone https://github.com/Poggi-Tang/easyautomation.git
cd easyautomation
pip install -e .
Quick Start
Basic Control Operations
from easy_uiauto.ctrl import Controller
# Left click on a control
Controller.left_click(
ActionTitle="Click OK Button",
WindowName="My Application",
Name="OK",
ClassName=None,
ControlType="ButtonControl",
foundIndex=0,
AutomationId="",
Xpath=[],
Img="",
PARAMETERS={}
)
# Input text into a field
Controller.input_text(
ActionTitle="Enter Username",
WindowName="Login Dialog",
Name="Username",
ClassName=None,
ControlType="EditControl",
foundIndex=0,
AutomationId="",
Xpath=[],
Img="",
PARAMETERS={"输入文本": "test_user"}
)
# Keyboard shortcut
Controller.key_group(
ActionTitle="Save File",
WindowName="Notepad",
Name="",
ClassName=None,
ControlType="",
foundIndex=0,
AutomationId="",
Xpath=[],
Img="",
PARAMETERS={"组合键": "ctrl+s"}
)
Recording User Actions
from easy_uiauto.record import run_record
# Start recording user actions
run_record(write_file=True)
# Press ESC to stop recording
# Generated script will be saved to Record{timestamp}.py
Project Structure
easyautomation
├── .github/
│ └── workflows/
│ ├── ci.yml
│ ├── publish.yml
│ └── release.yml
├── src/
│ └── easy-uiauto/
│ ├── __init__.py
│ ├── ctrl.py # Core controller (mouse/keyboard actions)
│ ├── draw.py # Visual feedback (control highlighting)
│ ├── record.py # Action recording
│ └── utils.py # Utility functions (control location, caching)
├── tests/
├── CHANGELOG.md
├── LICENSE
├── README.md
├── README.zh-CN.md
└── pyproject.toml
Release Automation
This repository is prepared for a professional Python package workflow:
- CI runs lint and tests on push and pull request.
- Semantic Release updates the version, changelog, tag, and GitHub Release.
- Trusted Publishing publishes to PyPI from GitHub Actions without a PyPI API token.
- Build artifacts include both source distribution and wheel.
Development
pip install -e .[dev]
pytest
ruff check .
Usage Examples
For more examples, please refer to the test files in the demo/ directory or check the docstrings in the source code.
License
MIT License. See LICENSE.
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
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 easy_uiauto-0.1.7.tar.gz.
File metadata
- Download URL: easy_uiauto-0.1.7.tar.gz
- Upload date:
- Size: 31.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ed2c09b5234c5687ab2f08514b0d757a4e31af5f00b90d4fee478904958b246
|
|
| MD5 |
2c549a43912c6a6b0f7ba5e8c046e0e7
|
|
| BLAKE2b-256 |
be2c30a45fe4e89bf792e2c453f617e1a0a8b6fd5c0c043f0ca80bad7f945d38
|
Provenance
The following attestation bundles were made for easy_uiauto-0.1.7.tar.gz:
Publisher:
publish.yml on Poggi-Tang/easyautomation
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
easy_uiauto-0.1.7.tar.gz -
Subject digest:
5ed2c09b5234c5687ab2f08514b0d757a4e31af5f00b90d4fee478904958b246 - Sigstore transparency entry: 1259591137
- Sigstore integration time:
-
Permalink:
Poggi-Tang/easyautomation@4ff2dd2cb829203245d4bef081c278125b783fd2 -
Branch / Tag:
refs/tags/v0.1.7 - Owner: https://github.com/Poggi-Tang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4ff2dd2cb829203245d4bef081c278125b783fd2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file easy_uiauto-0.1.7-py3-none-any.whl.
File metadata
- Download URL: easy_uiauto-0.1.7-py3-none-any.whl
- Upload date:
- Size: 30.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a09ece02be27af427b41e1f8039d0901da2e929332c162973df8da34d7659c5d
|
|
| MD5 |
6f798d8aff9fe45b2c5f21ec205361b5
|
|
| BLAKE2b-256 |
6a8d8186c5ba8490030fdcf780debbf4f6bad9e430b59e38a5e889895cc207ec
|
Provenance
The following attestation bundles were made for easy_uiauto-0.1.7-py3-none-any.whl:
Publisher:
publish.yml on Poggi-Tang/easyautomation
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
easy_uiauto-0.1.7-py3-none-any.whl -
Subject digest:
a09ece02be27af427b41e1f8039d0901da2e929332c162973df8da34d7659c5d - Sigstore transparency entry: 1259591241
- Sigstore integration time:
-
Permalink:
Poggi-Tang/easyautomation@4ff2dd2cb829203245d4bef081c278125b783fd2 -
Branch / Tag:
refs/tags/v0.1.7 - Owner: https://github.com/Poggi-Tang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4ff2dd2cb829203245d4bef081c278125b783fd2 -
Trigger Event:
push
-
Statement type: