Skip to main content

UI automation toolkit based on pyautogui and uiautomation

Project description

easy-uiauto

English | 简体中文

PyPI Python License CI Publish

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easy_uiauto-0.1.8.tar.gz (31.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easy_uiauto-0.1.8-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

Details for the file easy_uiauto-0.1.8.tar.gz.

File metadata

  • Download URL: easy_uiauto-0.1.8.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

Hashes for easy_uiauto-0.1.8.tar.gz
Algorithm Hash digest
SHA256 d6a3f2fdd9875283a5cd3e9c9a34274799adfdff660cd9a1e59971bb6ab90a0d
MD5 db5a5418c86c7b3617f206aabe10f284
BLAKE2b-256 ab588ed4014c81c92a9fa26329d4f11f86a23f858a9835748d961acb94804370

See more details on using hashes here.

Provenance

The following attestation bundles were made for easy_uiauto-0.1.8.tar.gz:

Publisher: publish.yml on Poggi-Tang/easyautomation

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file easy_uiauto-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: easy_uiauto-0.1.8-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

Hashes for easy_uiauto-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 bbb6f4e5446df22d7055f53ada8fc9b2416ca7b84b020c45599a54ffd5a15856
MD5 9cc64e7ac22d94a034e8b17fb12d2a5a
BLAKE2b-256 113427d21860403b99b7a00ad1e70a75be39c322156117e345aedb6ab38ec078

See more details on using hashes here.

Provenance

The following attestation bundles were made for easy_uiauto-0.1.8-py3-none-any.whl:

Publisher: publish.yml on Poggi-Tang/easyautomation

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page