Skip to main content

Core browser UI automation framework

Project description

BRUI Core (Browser UI Automation Core)

A flexible and robust browser UI automation framework that provides essential functionality for browser-based UI automation projects.

Features

  • Browser Management: Automated browser launching and control across different operating systems
  • Configuration Handling: Flexible configuration management with TOML and environment variable support
  • Clipboard Integration: Easy clipboard monitoring and manipulation
  • UI Integration Base: Extensible base classes for UI automation
  • Cross-Platform Support: Works on Linux and macOS

Installation

From PyPI (recommended)

pip install brui_core

From source (editable)

Using uv (recommended)

git clone https://github.com/AutoByteus/brui_core.git
cd brui_core
uv sync

Development / testing extras

With uv, dev dependencies are synced by default. To sync all extras:

uv sync --all-extras

Build the distribution

This project utilizes uv for modern, isolated builds:

# Build with specific Python version
uv build --python 3.11

This will produce the source distribution and wheel in the dist/ directory.

Quick Start

from brui_core.ui_integrator import UIIntegrator

async def main():
    # Initialize the UI integrator
    ui = UIIntegrator()
    await ui.initialize()

    try:
        # Your automation code here
        pass
    finally:
        # Clean up
        await ui.close()

# Run with asyncio
import asyncio
asyncio.run(main())

Requirements

  • Python 3.8+
  • Playwright (pinned in pyproject.toml and installed automatically)
  • Chrome/Chromium browser installed
  • Pillow, pyperclip, and other transitive dependencies installed with the package

Configuration

The framework is configured using environment variables:

Environment Variable Description Default
CHROME_PROFILE_DIRECTORY Chrome profile to use Profile 1
CHROME_REMOTE_DEBUGGING_PORT Remote debugging port 9222
CHROME_DOWNLOAD_DIRECTORY Directory for downloads (System Default)
CHROME_USER_DATA_DIR User data directory for session persistence (System Default)

Session Persistence (Logins & Cookies)

To maintain login states (cookies, local storage, cache) across different automation runs, you can configure the user_data_dir.

  • Default Behavior: If user_data_dir is not set, Chrome uses your system's default user profile (e.g., ~/.config/google-chrome on Linux). This means your automation shares the same session as your personal browsing.
  • Custom / Isolated Session: To keep your automation isolated (or to maintain multiple distinct signed-in states), set user_data_dir to a specific path. As long as you point to the same directory, Chrome will restore your previous session, keeping you logged in.
  • Chrome/Chromium 136+ Requirement: Recent Chrome and Chromium versions (136+) refuse to enable remote debugging on the default profile directory. You must set user_data_dir to a non-default path for CDP to work.

Example (Environment Variable):

export CHROME_USER_DATA_DIR="./my-bot-profile"

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

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

Support

For support, please open an issue in the GitHub repository.

Acknowledgments

  • Built with Playwright
  • Developed by AutoByteus

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

brui_core-1.2.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

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

brui_core-1.2.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file brui_core-1.2.0.tar.gz.

File metadata

  • Download URL: brui_core-1.2.0.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for brui_core-1.2.0.tar.gz
Algorithm Hash digest
SHA256 10147adfd1e9d3bac5ac6406065d7aa3df4f7951c19f6d243f2f16d45f14cb34
MD5 1d2b4dd57d295e3047e5b0889b36677a
BLAKE2b-256 b192906efcd78d389e7b2561bfbd5e0facc5c792f97abe73c9cfd96e93d6d92e

See more details on using hashes here.

File details

Details for the file brui_core-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: brui_core-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for brui_core-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 96e790fc341894929e073003235814f15fd02a0cba129da454bf0d6f76d5e17a
MD5 73308e09722b1a327115814c6943c9cd
BLAKE2b-256 f629e24398d4d4b939bfe16bcfd48dd6e665a4b20a7b9f827bdd5dbfe5de826d

See more details on using hashes here.

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