Skip to main content

PyWinGUI GUI Automation Library for Windows Forms (Binary Distribution)

Project description

pywinGUI – Intelligent Windows GUI Automation Framework

pywinGUI is an enterprise-grade Windows GUI automation framework designed to automate complex desktop applications without relying on automation IDs.
It interacts with UI elements using label recognition, visual ordering, proximity matching, and intelligent fallbacks.

This framework powers automated form filling, radio/checkbox selection, dropdown interactions, button clicks, and active window keystrokes — using a simple dictionary payload.


🚀 Features

✅ Label-Based Text Input

  • Fill fields using visible labels ("Surname:" : "Niranjan")
  • Supports repeated labels (Label:01, Label:02)
  • Matches nearest control by visual proximity

✅ Radio Button Automation

Supports:

  • radioBtn:toggle:<name> – attribute-based match
  • radioBtn:<name> – direct name match
  • radioBtn:All_01 – global index based on visual order
  • Group selection via "Label": "Option"

✅ Checkbox Handling

Three enterprise-level patterns:

  • checkboxBtn:toggle:<name>
  • checkboxBtn:left:<Label> – checkbox on the left
  • checkboxBtn:right:<Label> – checkbox on the right

✅ Dropdown Selections

  • dropdown:<Label> → selects matching option text

✅ Button Actions

  • btn:OK
  • btn:Save_01
  • Any button name with optional suffixes

✅ Active Window Keystrokes

Send keystrokes directly to focused window:

"activeWindow:SendKeys_01": "{ENTER}"
"activeWindow:SendKeys_02": "niranjan4@outlook.in"

Executed in numeric order.

✅ No Automation ID Required

Intelligent strategies:

  • Label text matching
  • Visual position sorting
  • Nearest control search
  • Repeated label disambiguation

📦 Installation

Requirements

  • Python 3.9+
  • Windows OS

📁 Project Structure

pywinGUI/
│
├── controller.py        # Main orchestrator for automation
├── actions.py           # Typing, clicking, selecting
├── selectors.py         # Label parsing and detection logic
├── readers.py           # (Optional) read/extract mode
├── utils.py             # Helpers, logging, fallback logic
├── README.md

🔧 Usage Example

1. Import the controller

from pywinGUI import controller

2. Prepare your payload

payload = {

    # ---------------- TEXT FIELDS ----------------
    "Street:": "ValueStreet",
    "Date Of Birth:": "11/11/2025",
    "Title:": "Mr",
    "Forenames:": "ValueStreet",
    "Initials:": "GS",
    "Surname:": "ValueBuilding",

    # ---------------- RADIO BUTTONS ----------------
    "radioBtn:toggle:Female": True,
    "radioBtn:toggle:Male": True,
    "radioBtn:All_01": True,
    "radioBtn:All_02": True,
    "radioBtn:Report": True,
    "radioBtn:Admin Area": True,

    # ---------------- CHECKBOXES ----------------
    "checkboxBtn:toggle:Format": True,
    "checkboxBtn:toggle:Use Today's Date": True,
    "checkboxBtn:right:Inactive": True,
    "checkboxBtn:left:Services": True,
    "checkboxBtn:left:Work Type": True,

    # ---------------- DROPDOWNS ----------------
    "dropdown:Nationality": "India (IN)",
    "dropdown:Work Type": "ZNDRST2C",

    # ---------------- BUTTONS ----------------
    "btn:OK": True,
    "btn:OK_01": True,
    "btn:OK_02": True,

    # ---------------- ACTIVE WINDOW SEND KEYS ----------------
    "activeWindow:SendKeys_01": "{ENTER}",
    "activeWindow:SendKeys_02": "niranjan@gmail.com",

    # ---------------- REPEATED LABELS ----------------
    "Start:01": "5",
    "End:01": "5",
    "Start:02": "1",
    "End:02": "1",
}

3. Execute

controller.fill_form_with_agent("Master Form [Org 01]", payload)

📘 Payload Reference Guide

📝 Text Fields

"Label:": "TextValue"

🔘 Radio Buttons

  1. Toggle match
    "radioBtn:toggle:Male": True
    
  2. Direct name
    "radioBtn:Council": True
    
  3. Index-based
    "radioBtn:All_01": True
    

☑️ Checkboxes

Left of label:

"checkboxBtn:left:Services": True

Right of label:

"checkboxBtn:right:Inactive": True

Toggle attribute:

"checkboxBtn:toggle:Format": True

🔽 Dropdowns

"dropdown:Nationality": "India (IN)"

🟦 Buttons

"btn:OK": True
"btn:Save_01": True

⌨️ Active Window Keys

"activeWindow:SendKeys_01": "{TAB}"
"activeWindow:SendKeys_02": "test@example.com"

🔄 Execution Flow

  1. Connect to target window
  2. Bring to focus
  3. Parse payload
  4. Fill text inputs
  5. Process radio buttons
  6. Process checkboxes
  7. Select dropdowns
  8. Click buttons
  9. Send active window keys
  10. Return completion status

🧠 Intelligence Behind the Framework

  • Top-left ordering for repeated controls
  • Visual proximity for matching labels to inputs
  • Automatic retry mechanisms
  • Graceful fallback if element not found
  • Unified naming grammar for all UI control types

📈 Roadmap

  • OCR-based label detection
  • Read/extract mode
  • Payload auto-generator
  • Screenshot capturing on failure
  • Plugin system for custom strategies

🐛 Support

For issues, feature requests, or enhancements, contact the maintainer or open a support ticket.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

pywingui-1.1.2-py3-none-any.whl (250.3 kB view details)

Uploaded Python 3

File details

Details for the file pywingui-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: pywingui-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 250.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for pywingui-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5e5ccd533de39f027589303486ef344f11aba246e23adb4cfe9f9e2d2164d0c9
MD5 058dc5167f875dfdd3d4cfd745515238
BLAKE2b-256 69e718f6ad9c04c331b9275f0076d93f51f7e4f48f55dca6cc73f35770073fd6

See more details on using hashes here.

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