Skip to main content

PymordialBlue

Advanced Android Automation for BlueStacks

PymordialBlue is a powerful extension of the Pymordial framework, specialized for automating Android applications on the BlueStacks emulator. It provides a robust, high-performance interface for controlling apps, interacting with UI elements, and performing OCR-based text extraction.


🚀 Features

  • BlueStacks Integration: Native control of the BlueStacks player process (start, stop, load detection).
  • High-Performance Streaming: Uses screenrecord and PyAV for low-latency (<100ms) screen capture, far faster than traditional ADB screencap.
  • Smart UI Detection: Find elements by:
    • Image: Template matching with scale and confidence awareness.
    • Pixel: Fast color checks at specific coordinates.
    • Text: Tesseract OCR integration for reading dynamic text.
  • Robust Lifecycle Management: State machines for Apps (CLOSED -> LOADING -> READY) and Emulator (CLOSED -> LOADING -> READY).
  • Resilient ADB: Auto-reconnection, key event injection, and shell command execution.
  • Typed Configuration: Full type hinting and validation for all config options.

🛠️ Installation

PymordialBlue is managed with uv.

# Clone the repository
git clone https://github.com/IAmNo1Special/PymordialBlue.git
cd PymordialBlue

# Sync dependencies (including local Pymordial)
uv sync

⚡ Quick Start

Here is a minimal example to connect to BlueStacks and capture the screen:

from pymordialblue import PymordialBluestacksController

# Initialize controller (auto-detects BlueStacks and ADB)
controller = PymordialBluestacksController()

# Connect and verify state
if controller.is_bluestacks_ready():
    print("BlueStacks is ready!")
    
    # Capture a frame
    frame = controller.capture_screen()
    print(f"Captured frame shape: {frame.shape}")
    
    # Go home
    controller.go_home()

📚 Documentation

Full documentation is available in the docs/ directory or via the MkDocs site.


📂 Project Structure

  • src/pymordialblue: Core package source.
    • devices/: Device implementations (ADB, UI, BlueStacks).
    • utils/: Configuration and helper strategies.
  • examples/: Runnable scripts demonstrating key features.
  • docs/: Markdown documentation.

🤝 Contributing

Contributions are welcome! Please read CONTRIBUTING.md before submitting a pull request.

Metadata

Release files for pymordialblue 0.1.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 pymordialblue 0.1.1
File Size Uploaded Provenance Actions
pymordialblue-0.1.1.tar.gz 39.4 MB With provenance Details for pymordialblue-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 78.8 MB

Release files / pymordialblue-0.1.1.tar.gz

Download URL pymordialblue-0.1.1.tar.gz
Size 39.4 MB
Tags Source
SHA-256 checksum
How to use checksums
745584424182f2398ed9ce525bf25eaad75ae775eeec228046029fc41349ba79
BLAKE2b-256 checksum
How to use checksums
d3d8e53c406047a5480114d2a8c97072d80cdc66c1551cce89da55ac2022512b
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 / pymordialblue-0.1.1-py3-none-any.whl

Download URL pymordialblue-0.1.1-py3-none-any.whl
Size 39.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
60261493074481c0903705dddf816b01ca2a53c5231858a766759317a4329df6
BLAKE2b-256 checksum
How to use checksums
8e470e65618fc4b75c99bc79692688c9017c41298774776ec07ec1f3b6f928dd
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 pymordialblue 0.1.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 pymordialblue-0.1.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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

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