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.7.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.7-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

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

Hashes for easy_uiauto-0.1.7.tar.gz
Algorithm Hash digest
SHA256 5ed2c09b5234c5687ab2f08514b0d757a4e31af5f00b90d4fee478904958b246
MD5 2c549a43912c6a6b0f7ba5e8c046e0e7
BLAKE2b-256 be2c30a45fe4e89bf792e2c453f617e1a0a8b6fd5c0c043f0ca80bad7f945d38

See more details on using hashes here.

Provenance

The following attestation bundles were made for easy_uiauto-0.1.7.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.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

Hashes for easy_uiauto-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 a09ece02be27af427b41e1f8039d0901da2e929332c162973df8da34d7659c5d
MD5 6f798d8aff9fe45b2c5f21ec205361b5
BLAKE2b-256 6a8d8186c5ba8490030fdcf780debbf4f6bad9e430b59e38a5e889895cc207ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for easy_uiauto-0.1.7-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