bluepyll


Namebluepyll JSON
Version 0.0.5 PyPI version JSON
download
home_pageNone
SummaryA Python library designed to control BlueStacks through ADB commands, enabling seamless automation and management of Android applications on a PC.
upload_time2025-07-17 19:37:24
maintainerNone
docs_urlNone
authorNone
requires_python>=3.13
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # BluePyll: Automating BlueStacks

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![Python Version](https://img.shields.io/badge/python-3.13+-blue)
![Platform](https://img.shields.io/badge/platform-Windows-lightgrey)

BluePyll is a Python library designed to control BlueStacks through ADB commands, enabling seamless automation and management of Android applications on a PC.

**Warning:** This project involves automating UI interactions and interacting with external software. Use it responsibly and ensure it complies with the terms of service of any applications you interact with.

## Features

* **Emulator Control:**
  * Launch and close BlueStacks
  * Check BlueStacks running and loading status
* **App Management:**
  * Launch and close Android applications
  * Check application running status
* **UI Interaction:**
  * Coordinate-based & image-based clicking
  * Image recognition interactions
  * Text input and key presses
* **ADB Integration:**
  * Execute shell commands
  * Device connection management
* **Image and Text Recognition:**
  * Screen text location
  * Region-based text verification
* **Utility Functions:**
  * Execution delays
  * Image scaling
  * Logging support

## Prerequisites

* **Python 3.13+**
* **BlueStacks**
* **uv** (Package Manager)

## Why uv?

* 🚀 **All-in-One Tool:** Replaces pip, pip-tools, pipx, poetry, pyenv, twine, and virtualenv
* ⚡️ **Blazing Fast:** 10-100x faster than pip
* 🗂️ **Comprehensive Project Management:** Universal lockfile and workspace support
* 💾 **Efficient Storage:** Global cache for dependency deduplication
* 🐍 **Python Version Management:** Easily install and manage Python versions
* 🛠️ **Flexible Tooling:** Runs and installs tools published as Python packages
* 🖥️ **Cross-Platform:** Supports macOS, Linux, and Windows

[Learn more about uv](https://docs.astral.sh/uv/)

## Installation

1. **Install uv:**(If not already installed)

    ```bash
    pip install uv
    ```

2. **Create Project and Install BluePyll:**

    ```bash
    # Initialize a new project
    uv init bluepyll-project
    cd bluepyll-project

    # Add BluePyll
    uv add bluepyll
    ```

**Note:** We recommend using uv for the most efficient and reliable package management.

## Usage

### Quick Start

```python
from bluepyll.controller import BluepyllController
from bluepyll.app import BluePyllApp
from bluepyll.state_machine import BluestacksState


def main():
  """
  Main test function that demonstrates opening Bluestacks and launching an app.
  """
    
  try:
    # Initialize the controller and wait for Bluestacks to auto-open
    print("Initializing & opening BluepyllController...")
    controller = BluepyllController()
    print("Bluestacks opened successfully")

    # Create the app instance
    print("Creating app instance...")
    app = BluePyllApp(
        app_name="Example App",
        package_name="com.example.app"
    )

    print("Starting test sequence...")

    # Verify Bluestacks is open
    if not controller.bluestacks_state.current_state == BluestacksState.READY:
        raise RuntimeError("Bluestacks failed to be ready!")

    # Open app
    print("Opening app...")
    controller.open_app(app)
        
    # Wait for user to verify
    input("\nPress Enter to close Bluestacks...")

    # Clean up
    print("Closing Bluestacks...")
    controller.kill_bluestacks()
    print("Test completed successfully!")
  except Exception as e:
    print(f"Test failed: {e}")
    raise


if __name__ == "__main__":
  try:
    main()
  except Exception as e:
    print(f"\nTest failed with error: {e}")
    sys.exit(1)


```

For more detailed usage and examples, please refer to the individual module documentation and the example scripts (if any).

### Project Structure

The project is organized as follows:

* bluepyll/` - Contains the source code for BluePyll.
  * `__init__.py` - Initializes the BluePyll package.
  * `app.py` - Module for managing Android apps within BlueStacks.
  * `constants.py` - Module containing constants for BluePyll.
  * `controller.py` - Module for controlling the BlueStacks emulator.
  * `exceptions.py` - Module containing BluePyll-specific exceptions.
  * `ui.py` - Module for interacting with the BlueStacks user interface.
  * `utils.py` - Module containing utility functions for BluePyll.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "bluepyll",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.13",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "IAmNo1Special <ivmno1special@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/28/53/7361fc780b530808732c3562c6003e9048e34f91d279e89d7f1901887e3d/bluepyll-0.0.5.tar.gz",
    "platform": null,
    "description": "# BluePyll: Automating BlueStacks\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n![Python Version](https://img.shields.io/badge/python-3.13+-blue)\n![Platform](https://img.shields.io/badge/platform-Windows-lightgrey)\n\nBluePyll is a Python library designed to control BlueStacks through ADB commands, enabling seamless automation and management of Android applications on a PC.\n\n**Warning:** This project involves automating UI interactions and interacting with external software. Use it responsibly and ensure it complies with the terms of service of any applications you interact with.\n\n## Features\n\n* **Emulator Control:**\n  * Launch and close BlueStacks\n  * Check BlueStacks running and loading status\n* **App Management:**\n  * Launch and close Android applications\n  * Check application running status\n* **UI Interaction:**\n  * Coordinate-based & image-based clicking\n  * Image recognition interactions\n  * Text input and key presses\n* **ADB Integration:**\n  * Execute shell commands\n  * Device connection management\n* **Image and Text Recognition:**\n  * Screen text location\n  * Region-based text verification\n* **Utility Functions:**\n  * Execution delays\n  * Image scaling\n  * Logging support\n\n## Prerequisites\n\n* **Python 3.13+**\n* **BlueStacks**\n* **uv** (Package Manager)\n\n## Why uv?\n\n* \ud83d\ude80 **All-in-One Tool:** Replaces pip, pip-tools, pipx, poetry, pyenv, twine, and virtualenv\n* \u26a1\ufe0f **Blazing Fast:** 10-100x faster than pip\n* \ud83d\uddc2\ufe0f **Comprehensive Project Management:** Universal lockfile and workspace support\n* \ud83d\udcbe **Efficient Storage:** Global cache for dependency deduplication\n* \ud83d\udc0d **Python Version Management:** Easily install and manage Python versions\n* \ud83d\udee0\ufe0f **Flexible Tooling:** Runs and installs tools published as Python packages\n* \ud83d\udda5\ufe0f **Cross-Platform:** Supports macOS, Linux, and Windows\n\n[Learn more about uv](https://docs.astral.sh/uv/)\n\n## Installation\n\n1. **Install uv:**(If not already installed)\n\n    ```bash\n    pip install uv\n    ```\n\n2. **Create Project and Install BluePyll:**\n\n    ```bash\n    # Initialize a new project\n    uv init bluepyll-project\n    cd bluepyll-project\n\n    # Add BluePyll\n    uv add bluepyll\n    ```\n\n**Note:** We recommend using uv for the most efficient and reliable package management.\n\n## Usage\n\n### Quick Start\n\n```python\nfrom bluepyll.controller import BluepyllController\nfrom bluepyll.app import BluePyllApp\nfrom bluepyll.state_machine import BluestacksState\n\n\ndef main():\n  \"\"\"\n  Main test function that demonstrates opening Bluestacks and launching an app.\n  \"\"\"\n    \n  try:\n    # Initialize the controller and wait for Bluestacks to auto-open\n    print(\"Initializing & opening BluepyllController...\")\n    controller = BluepyllController()\n    print(\"Bluestacks opened successfully\")\n\n    # Create the app instance\n    print(\"Creating app instance...\")\n    app = BluePyllApp(\n        app_name=\"Example App\",\n        package_name=\"com.example.app\"\n    )\n\n    print(\"Starting test sequence...\")\n\n    # Verify Bluestacks is open\n    if not controller.bluestacks_state.current_state == BluestacksState.READY:\n        raise RuntimeError(\"Bluestacks failed to be ready!\")\n\n    # Open app\n    print(\"Opening app...\")\n    controller.open_app(app)\n        \n    # Wait for user to verify\n    input(\"\\nPress Enter to close Bluestacks...\")\n\n    # Clean up\n    print(\"Closing Bluestacks...\")\n    controller.kill_bluestacks()\n    print(\"Test completed successfully!\")\n  except Exception as e:\n    print(f\"Test failed: {e}\")\n    raise\n\n\nif __name__ == \"__main__\":\n  try:\n    main()\n  except Exception as e:\n    print(f\"\\nTest failed with error: {e}\")\n    sys.exit(1)\n\n\n```\n\nFor more detailed usage and examples, please refer to the individual module documentation and the example scripts (if any).\n\n### Project Structure\n\nThe project is organized as follows:\n\n* bluepyll/` - Contains the source code for BluePyll.\n  * `__init__.py` - Initializes the BluePyll package.\n  * `app.py` - Module for managing Android apps within BlueStacks.\n  * `constants.py` - Module containing constants for BluePyll.\n  * `controller.py` - Module for controlling the BlueStacks emulator.\n  * `exceptions.py` - Module containing BluePyll-specific exceptions.\n  * `ui.py` - Module for interacting with the BlueStacks user interface.\n  * `utils.py` - Module containing utility functions for BluePyll.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Python library designed to control BlueStacks through ADB commands, enabling seamless automation and management of Android applications on a PC.",
    "version": "0.0.5",
    "project_urls": {
        "documentation": "https://bluepyll.readthedocs.io",
        "homepage": "https://github.com/IAmNo1Special/BluePyll",
        "issues": "https://github.com/IAmNo1Special/BluePyll/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ea5743585435f30a341e3b47070a7ec425329e1bb1d54f6c8778e38a164c5bff",
                "md5": "0afd67a9c07bfe2702e1eaff2c6f2ca0",
                "sha256": "ad1a1cb97be45f6ea979785b2bd53ae116ddade8e3b315f3ad5747a4e298c7e2"
            },
            "downloads": -1,
            "filename": "bluepyll-0.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0afd67a9c07bfe2702e1eaff2c6f2ca0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.13",
            "size": 139312,
            "upload_time": "2025-07-17T19:37:23",
            "upload_time_iso_8601": "2025-07-17T19:37:23.419972Z",
            "url": "https://files.pythonhosted.org/packages/ea/57/43585435f30a341e3b47070a7ec425329e1bb1d54f6c8778e38a164c5bff/bluepyll-0.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "28537361fc780b530808732c3562c6003e9048e34f91d279e89d7f1901887e3d",
                "md5": "9f4cd2a015a25ae79dbe5b9ed361c145",
                "sha256": "7d66626717da71c053a8407548e3988c76ec06c7cb2bdd5635d99e8347700a0d"
            },
            "downloads": -1,
            "filename": "bluepyll-0.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "9f4cd2a015a25ae79dbe5b9ed361c145",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.13",
            "size": 172721,
            "upload_time": "2025-07-17T19:37:24",
            "upload_time_iso_8601": "2025-07-17T19:37:24.590391Z",
            "url": "https://files.pythonhosted.org/packages/28/53/7361fc780b530808732c3562c6003e9048e34f91d279e89d7f1901887e3d/bluepyll-0.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-17 19:37:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "IAmNo1Special",
    "github_project": "BluePyll",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "bluepyll"
}
        
Elapsed time: 0.66846s