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.1.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.1-py3-none-any.whl (39.4 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pymordialblue-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 745584424182f2398ed9ce525bf25eaad75ae775eeec228046029fc41349ba79
MD5 db8f715f50ec4e3b8fe8873cba8416ee
BLAKE2b-256 d3d8e53c406047a5480114d2a8c97072d80cdc66c1551cce89da55ac2022512b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymordialblue-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: pymordialblue-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 60261493074481c0903705dddf816b01ca2a53c5231858a766759317a4329df6
MD5 4b5f2a1581b4748b7695a21f5423089c
BLAKE2b-256 8e470e65618fc4b75c99bc79692688c9017c41298774776ec07ec1f3b6f928dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymordialblue-0.1.1-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