An extensible automation framework for Python, designed to support any platform via abstract controllers.
Project description
Pymordial 🦕
Extensible Automation Framework for Python
Pymordial is a platform-agnostic automation framework that provides a standardized interface for controlling applications on any device. It defines the core contracts (Controller, App, Device) that allow you to build robust, state-aware automation tools for Android, iOS, Windows, or Web.
Note: This is the core framework. For Android/BlueStacks implementation, see pymordialblue (Coming Soon).
🏗️ Architecture
Pymordial provides the Blueprints for automation:
PymordialController: The brain. Manages devices, apps, and user inputs (clicks, swipes, text).PymordialApp: The soul. A robustStateMachine(CLOSED → LOADING → READY) that tracks app lifecycle.PymordialElement: The eyes. Unified interface for finding UI components via:- Images (Template Matching)
- Text (OCR)
- Pixels (Color Arrays)
PymordialDevice: The body. Abstract interfaces for emulators, bridges (ADB/Win32), and screen processing.
📦 Installation
uv add pymordial
Or using pip:
pip install pymordial
🚀 Quick Start: Building a Controller
Pymordial is designed to be extended. Here is how you implement a simple controller for a hypothetical platform.
1. Implement the Controller
from pymordial.core.controller import PymordialController
class MyPlatformController(PymordialController):
"""A concrete implementation for MyPlatform."""
def click_coord(self, coords, times=1):
print(f"Clicking {coords} {times} times on target device...")
# device_bridge.send_click(coords)
return True
def capture_screen(self):
# return device_bridge.get_screenshot()
pass
# ... implement other abstract methods ...
2. Implement an App
from pymordial.core.app import PymordialApp
class MyApp(PymordialApp):
"""A concrete app implementation."""
def open(self) -> bool:
print(f"Launching {self.app_name}...")
# device_bridge.launch(self.package_id)
return True
def close(self) -> bool:
print(f"Closing {self.app_name}...")
return True
3. Automate!
Once implemented, you get the full power of Pymordial's state machine and element system.
# 1. Setup
controller = MyPlatformController()
game = MyApp("SuperGame", package_id="com.game")
controller.add_app(game)
# 2. Define Elements
from pymordial.ui.image import PymordialImage
start_btn = PymordialImage("start", "assets/start.png")
# 3. Operations
game.open()
if controller.is_element_visible(start_btn):
controller.click_element(start_btn)
⚙️ Configuration
The core library uses a strictly typed, minimal configuration:
# pymordial_config.yaml
app:
action_timeout: 60
action_wait_time: 10
element:
default_confidence: 0.7
controller:
default_click_times: 1
🤝 Contributing
- Fork the repository.
- Create a feature branch.
- Commit your changes (please follow PEP 8).
- Submit a Pull Request.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
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 Distribution
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 pymordial-0.4.0.tar.gz.
File metadata
- Download URL: pymordial-0.4.0.tar.gz
- Upload date:
- Size: 16.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75c2d25554a1c8e6bcfab03dd35515e001fe593b5a8d3aa3d6120ed94a166307
|
|
| MD5 |
b0d5bc68aecab5a32a4e75f80aae3329
|
|
| BLAKE2b-256 |
60ea0eebacec58f68317e0b2065b0209b36d7de413cea6f00b9af429658e193c
|
Provenance
The following attestation bundles were made for pymordial-0.4.0.tar.gz:
Publisher:
release.yml on IAmNo1Special/Pymordial
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pymordial-0.4.0.tar.gz -
Subject digest:
75c2d25554a1c8e6bcfab03dd35515e001fe593b5a8d3aa3d6120ed94a166307 - Sigstore transparency entry: 845882410
- Sigstore integration time:
-
Permalink:
IAmNo1Special/Pymordial@347a7b559f63474c920380d3cc996ecdab1224de -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/IAmNo1Special
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@347a7b559f63474c920380d3cc996ecdab1224de -
Trigger Event:
push
-
Statement type:
File details
Details for the file pymordial-0.4.0-py3-none-any.whl.
File metadata
- Download URL: pymordial-0.4.0-py3-none-any.whl
- Upload date:
- Size: 26.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c74565f84f38581113f53173061f39dd68d627c05de6384531e822eb96d982b
|
|
| MD5 |
4f340bf8c5e28753d5f187627944443a
|
|
| BLAKE2b-256 |
f8754a6b5cd98f6f523591784c9d166509fb2ce7d66a163f5a7cd90d4ab9d15f
|
Provenance
The following attestation bundles were made for pymordial-0.4.0-py3-none-any.whl:
Publisher:
release.yml on IAmNo1Special/Pymordial
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pymordial-0.4.0-py3-none-any.whl -
Subject digest:
3c74565f84f38581113f53173061f39dd68d627c05de6384531e822eb96d982b - Sigstore transparency entry: 845882412
- Sigstore integration time:
-
Permalink:
IAmNo1Special/Pymordial@347a7b559f63474c920380d3cc996ecdab1224de -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/IAmNo1Special
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@347a7b559f63474c920380d3cc996ecdab1224de -
Trigger Event:
push
-
Statement type: