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 matchradioBtn:<name>– direct name matchradioBtn: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 leftcheckboxBtn:right:<Label>– checkbox on the right
✅ Dropdown Selections
dropdown:<Label>→ selects matching option text
✅ Button Actions
btn:OKbtn: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
- Toggle match
"radioBtn:toggle:Male": True - Direct name
"radioBtn:Council": True - 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
- Connect to target window
- Bring to focus
- Parse payload
- Fill text inputs
- Process radio buttons
- Process checkboxes
- Select dropdowns
- Click buttons
- Send active window keys
- 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
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 Distributions
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 pywingui-1.2.6-py3-none-any.whl.
File metadata
- Download URL: pywingui-1.2.6-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ae8b54bd08a1699f6baab380e3ccef71ca29070e06ad3a4472e21905721b5af
|
|
| MD5 |
02c7d8434f488bf158ec6d95b916b518
|
|
| BLAKE2b-256 |
6ae194feb936d789190da3518c746d13a31ff1bc3a3ac335bf7bb86b676f30a5
|