Skip to main content

AI-powered web browser automation using Playwright

Project description

Allyson

AI-powered web browser automation using Playwright.

Changelog

  • 0.1.1 - Test release for GitHub Actions automated publishing
  • 0.1.0 - Initial release

Installation

pip install allyson

After installation, you'll need to install the Playwright browsers:

python -m playwright install

Features

  • Simple, intuitive API for browser automation
  • AI-powered element selection and interaction
  • Support for multiple browsers (Chromium, Firefox, WebKit)
  • Asynchronous and synchronous interfaces
  • Robust error handling and recovery

Quick Start

from allyson import Browser

# Create a browser instance
browser = Browser()

# Navigate to a website
browser.goto("https://example.com")

# Interact with the page
browser.click("Sign in")
browser.fill("Email", "user@example.com")
browser.fill("Password", "password")
browser.click("Submit")

# Take a screenshot
browser.screenshot("login.png")

# Close the browser
browser.close()

Advanced Usage

from allyson import Browser

async def run_automation():
    # Use async API with context manager
    async with Browser(headless=False) as browser:
        await browser.goto("https://example.com")
        
        # Wait for specific element
        await browser.wait_for_selector(".content")
        
        # Execute JavaScript
        result = await browser.evaluate("document.title")
        print(f"Page title: {result}")
        
        # Multiple tabs/pages
        new_page = await browser.new_page()
        await new_page.goto("https://another-example.com")

# Run the async function
import asyncio
asyncio.run(run_automation())

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Automated Publishing

This package uses GitHub Actions for automated testing and publishing to PyPI. The workflow is configured to:

  1. Run tests on every push to the main branch and on pull requests
  2. Build the package on every push to the main branch
  3. Publish to PyPI automatically when:
    • A new tag is pushed with the format v* (e.g., v0.1.0, v1.0.0)
    • A new GitHub Release is created

To publish a new version:

  1. Update the version number in setup.py
  2. Commit and push your changes to the main branch
  3. Create and push a new tag:
    git tag v0.1.1
    git push origin v0.1.1
    
  4. The GitHub Action will automatically build and publish the package to PyPI

Note: You need to set up a PyPI API token as a GitHub secret named PYPI_API_TOKEN for the automated publishing to work.

License

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

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

allyson-0.1.1.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

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

allyson-0.1.1-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: allyson-0.1.1.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for allyson-0.1.1.tar.gz
Algorithm Hash digest
SHA256 19c449b8c86665f4b7675c49ce04f7d180aaf774d992f7b130d569f61ffda7c4
MD5 21aca6f71643c821703d619bd37995cf
BLAKE2b-256 7b8451f0c7caaf989a9d6ceeb93e8a063ecb116e5bc5b79f6be6f4127c9fd82a

See more details on using hashes here.

File details

Details for the file allyson-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: allyson-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for allyson-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a29657c605b9a076e427183ce9be7f3a8fc253acb74804094e2b3237f2eebe3a
MD5 cf95947c55b05ea2a6b11e942acd4bc3
BLAKE2b-256 0e16ad3197f2b120f52ff970f1ef821eea3685a2098519e547db10b9b45f87a5

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