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

Uploaded Python 3

File details

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

File metadata

  • Download URL: easy_uiauto-0.1.6.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.6.tar.gz
Algorithm Hash digest
SHA256 9901ff57ca627ed3cb8e9ff7c87ecbd9b95925287e5cf0b12ed5076ef11b2cc1
MD5 98db7f628763c1d65d71a32131ace3ed
BLAKE2b-256 20891c54867eda74ccbd8e88cfe5821ef1a8d12cda9e138db268fecca75a7d22

See more details on using hashes here.

Provenance

The following attestation bundles were made for easy_uiauto-0.1.6.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.6-py3-none-any.whl.

File metadata

  • Download URL: easy_uiauto-0.1.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a50269b4669363c594523e22670b87190afc311d19fe45c06c9748cc56021af0
MD5 fd4fcdbda46d9509b1ddaf9cbcb4eea2
BLAKE2b-256 4fd85926bbef615f6dfa0715ae3051ec2b2d4be8817954c36aad7e21a2cf07eb

See more details on using hashes here.

Provenance

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