Skip to main content

State-driven web automation framework for complex workflows

Project description

Athesa

PyPI version Python 3.9+ License: MIT Tests

State-driven web automation framework for complex workflows

Athesa is a protocol-oriented Python framework for building maintainable web automation processes using state machines, screen detection, and declarative action sequences.


โœจ Features

  • ๐ŸŽฏ State Machine Architecture - Clear workflow definition with explicit state transitions
  • ๐Ÿ” Smart Screen Detection - Robust page state detection with multiple strategies
  • ๐Ÿ”Œ Pluggable Adapters - Support for Selenium, Playwright, and custom automation tools
  • ๐Ÿ“ฆ Protocol-Oriented - Duck typing with Python protocols, no forced inheritance
  • ๐ŸŽช Event System - Built-in event emitter (no PyQt/GUI dependencies)
  • ๐Ÿญ Process Factory - Registry for managing and discovering automation processes
  • Testable - Clean separation of concerns, easy to unit test

Quick Start

Installation

pip install athesa

Basic Example

from athesa import ProcessRunner, ProcessContext
from athesa.adapters.selenium import SeleniumBridge
from selenium import webdriver

# Setup browser
driver = webdriver.Chrome()
bridge = SeleniumBridge(driver)

# Create context
context = ProcessContext(
    credentials={'username': 'user@example.com', 'password': 'secret'}
)

# Run process
from my_processes import LoginProcess
process = LoginProcess()
runner = ProcessRunner(process, context, bridge)
outcome = runner.run()

print(f"Result: {outcome}")  # 'success', 'failure', or 'retry'
driver.quit()

๐Ÿ“– Documentation


๐ŸŽ“ Core Concepts

Process

A complete workflow from start to finish. Defines screens, handlers, states, and transitions.

State

A step in your workflow. Each state knows what screens to expect.

Screen

A detectable page state using selectors and verification criteria.

Handler

Actions to perform when a screen is detected.

Bridge

Abstraction layer for browser automation (Selenium, Playwright, custom).


๐Ÿ’ก Why Athesa?

Problem: Web automation is brittle. Pages change, flows have edge cases, errors are hard to debug.

Solution: Athesa uses explicit state machines and screen detection:

  • โœ… Clear state transitions make debugging easy
  • โœ… Multiple detection strategies handle dynamic pages
  • โœ… Process registry allows flow composition
  • โœ… Event system provides observability
  • โœ… Protocol-based (no forced inheritance)

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚         Your Process Definition         โ”‚
โ”‚  (States, Screens, Handlers)           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ”‚
       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
       โ”‚ ProcessRunner  โ”‚
       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚          โ”‚          โ”‚
โ”Œโ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ–ผโ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”
โ”‚State  โ”‚  โ”‚Page โ”‚  โ”‚Action  โ”‚
โ”‚Machineโ”‚  โ”‚Det. โ”‚  โ”‚Executorโ”‚
โ””โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”ฌโ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜
    โ”‚         โ”‚         โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
              โ”‚
        โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”
        โ”‚  Bridge   โ”‚
        โ”‚ (Selenium)โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Contributing

Contributions are welcome! Please read CONTRIBUTING.md first.


๐Ÿ“ License

MIT License - see LICENSE file


Acknowledgments

Built with โค๏ธ for the automation community.


Athesa - Smooth automation flows, state by state.

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

athesa-0.1.2.tar.gz (30.1 kB view details)

Uploaded Source

Built Distribution

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

athesa-0.1.2-py3-none-any.whl (41.5 kB view details)

Uploaded Python 3

File details

Details for the file athesa-0.1.2.tar.gz.

File metadata

  • Download URL: athesa-0.1.2.tar.gz
  • Upload date:
  • Size: 30.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for athesa-0.1.2.tar.gz
Algorithm Hash digest
SHA256 af762c82ff5d8b83a6a5c78cf8b0151aeae625cd0ca2be1fef4d16b3b9466037
MD5 4038e0578a006a6632ceb9fca06f42c2
BLAKE2b-256 6bb30d625b0c91bf0b7e9b0ec0aac3be59bbf781555962a3ac4d8c8d0eebbac9

See more details on using hashes here.

File details

Details for the file athesa-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: athesa-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 41.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for athesa-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 83f2b13104fe069edf137e6b9823a6413a4104f6cdfdb340727810663c3a4d1a
MD5 91956e17821b71e734b9aa6be8c9472a
BLAKE2b-256 5f425b03fdaab4c98ddedb33e1a5f30ed9e386144ca7bfd386fc51d1286f3e4e

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