Skip to main content

Pymordial 🦕

Extensible Automation Framework for Python

License: MIT Python 3.13+ PyPI

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 robust StateMachine (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. Define an App

PymordialApp is a pure data model. It holds app metadata and screens:

from pymordial.core.app import PymordialApp
from pymordial.core.screen import PymordialScreen
from pymordial.ui.image import PymordialImage

# Create an app with screens and elements
main_menu = PymordialScreen(name="main_menu")
main_menu.add_element(PymordialImage(label="play_button", source_path="assets/play.png"))

game = PymordialApp(app_name="SuperGame")
game.add_screen(main_menu)

3. Automate!

Once implemented, you get the full power of Pymordial's state machine and element system.

# 1. Setup
controller = MyPlatformController()
controller.add_app(game)  # Register the app

# 2. Operate via Controller (which delegates to BridgeDevice)
controller.open_app("SuperGame", "com.game", timeout=60, wait_time=10)

# 3. Find and Click Elements
play_button = game.get_screen("main_menu").get_element("play_button")
if controller.is_element_visible(play_button):
    controller.click_element(play_button)

⚙️ 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

  1. Fork the repository.
  2. Create a feature branch.
  3. Commit your changes (please follow PEP 8).
  4. Submit a Pull Request.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for pymordial 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pymordial 0.4.1
File Size Uploaded Provenance Actions
pymordial-0.4.1.tar.gz 16.0 kB With provenance Details for pymordial-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pymordial 0.4.1
File Interpreter ABI Platform Actions
pymordial-0.4.1-py3-none-any.whl Python 3 none any Details for pymordial-0.4.1-py3-none-any.whl

Total release size: 41.3 kB

Release files / pymordial-0.4.1.tar.gz

Download URL pymordial-0.4.1.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
11a43c250972b3af12fd6de20be66c3d921fd09e2ce63af9c212071729baa4bc
BLAKE2b-256 checksum
How to use checksums
8c504104716361ffae4ab70e04657705be5138cde2f874af0771f48370c8c186
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 25, 2026.

Transparency log

Release files / pymordial-0.4.1-py3-none-any.whl

Download URL pymordial-0.4.1-py3-none-any.whl
Size 25.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
20139409c1dc13fb3024b9801081a89dd25471ad754d25e032e567682c0cbe20
BLAKE2b-256 checksum
How to use checksums
80ec8928763ad90dd8f07c4dd215373f05166570bd6de7295e49b83f3e85a3ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 25, 2026.

Transparency log

Security for pymordial 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pymordial-0.4.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page