Skip to main content

PymordialBlue: Advanced Android Automation for BlueStacks using Pymordial

Project description

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.

Project details


Download files

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

Source Distribution

pymordialblue-0.1.0.tar.gz (39.4 MB view details)

Uploaded Source

Built Distribution

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

pymordialblue-0.1.0-py3-none-any.whl (39.4 MB view details)

Uploaded Python 3

File details

Details for the file pymordialblue-0.1.0.tar.gz.

File metadata

  • Download URL: pymordialblue-0.1.0.tar.gz
  • Upload date:
  • Size: 39.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pymordialblue-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7c67646d8c9799ac76bec4b2a5e1ed7eeae09ec31588f980324d1dfd11fa850d
MD5 6156e934fec10c7f68a427f059f850df
BLAKE2b-256 e86ca250cdf552d82a25c35ecda04b75c915b1e422764089c655032199dd16dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymordialblue-0.1.0.tar.gz:

Publisher: release.yml on IAmNo1Special/PymordialBlue

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymordialblue-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pymordialblue-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 39.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pymordialblue-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b1eda93787a191c745cd6d0afed1ee63094d9aa9da26a72da9ef135b2b64ad03
MD5 812e028d8d031cd5cfc95112135aadda
BLAKE2b-256 731800a7c4bf500762492c1f1d458a80148f46f82134dd874452629dc0cc2133

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymordialblue-0.1.0-py3-none-any.whl:

Publisher: release.yml on IAmNo1Special/PymordialBlue

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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