Skip to main content

ACI for websites

Project description

SWEer

Dev setup

pip install -e '.[dev]'
pre-commit install
pytest

Usage

First, start the backend

sweer-backend

Next, start running commands

# If argument is an existing local path, will try to open local file instead
sweer open theguardian.com
sweer screenshot
sweer click 0

Configuration

SWEer can be configured using environment variables:

Browser Configuration

You can configure which browser backend to use:

# Use Firefox instead of the default Chromium
export SWEER_BROWSER_TYPE="firefox"
sweer-backend

# Use Chromium (default)
export SWEER_BROWSER_TYPE="chromium"
sweer-backend

Supported browser types:

  • chromium (default) - Uses Chromium browser
  • firefox - Uses Firefox browser

Custom Browser Executable Paths

You can specify custom installations of browsers instead of using Playwright's default bundled browsers:

# Use a custom Chromium installation
export SWEER_CHROMIUM_EXECUTABLE_PATH="/usr/bin/chromium-browser"
export SWEER_BROWSER_TYPE="chromium"
sweer-backend

# Use a custom Firefox installation
export SWEER_FIREFOX_EXECUTABLE_PATH="/usr/bin/firefox"
export SWEER_BROWSER_TYPE="firefox"
sweer-backend

This is useful when:

  • You want to use a system-installed browser instead of Playwright's bundled version
  • You need to use a specific browser version
  • You want to use a browser with custom configurations or extensions pre-installed
  • You're working in an environment where Playwright's bundled browsers aren't available

Other Configuration Options

# Enable automatic screenshotting after each action
export SWEER_AUTOSCREENSHOT="1"

# Configure window size
export SWEER_WINDOW_WIDTH="1280"
export SWEER_WINDOW_HEIGHT="720"

# Run browser in headed mode (visible window)
export SWEER_HEADLESS="0"

# Change screenshot delay (in seconds)
export SWEER_SCREENSHOT_DELAY="0.5"

If navigating a lot, you can activate automatic screenshotting with

export SWEER_AUTOSCREENSHOT="1"

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

sweer-1.0.0.dev2.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

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

sweer-1.0.0.dev2-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file sweer-1.0.0.dev2.tar.gz.

File metadata

  • Download URL: sweer-1.0.0.dev2.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for sweer-1.0.0.dev2.tar.gz
Algorithm Hash digest
SHA256 a14110503b83e9a970628fde0178fa34e0dadf8311839ad7498bbaa1e0b462c0
MD5 bb5951ff230b07f9e723726cb677eb78
BLAKE2b-256 ec5d7e5b0c1359adfc2e9633b19f17e45640f9862dac9ee8113b44c33b6a0d27

See more details on using hashes here.

File details

Details for the file sweer-1.0.0.dev2-py3-none-any.whl.

File metadata

  • Download URL: sweer-1.0.0.dev2-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for sweer-1.0.0.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 ec5309cc4c3289ff399e4d524ef19ead059abc1f7c480786b5bb0c4c9e3f3e72
MD5 110bb67a3347fa5e77aa004fe7fb54fb
BLAKE2b-256 425ef5a4913d77ee7d6e110345f0be01deef9a7fe297fe810d26a5c309dc3482

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