State-driven web automation framework for complex workflows
Project description
Athesa
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
- Getting Started - Introduction and setup
- API Reference - Complete API documentation
- Quick Reference - Common patterns and snippets
- Examples - Working examples
๐ 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af762c82ff5d8b83a6a5c78cf8b0151aeae625cd0ca2be1fef4d16b3b9466037
|
|
| MD5 |
4038e0578a006a6632ceb9fca06f42c2
|
|
| BLAKE2b-256 |
6bb30d625b0c91bf0b7e9b0ec0aac3be59bbf781555962a3ac4d8c8d0eebbac9
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83f2b13104fe069edf137e6b9823a6413a4104f6cdfdb340727810663c3a4d1a
|
|
| MD5 |
91956e17821b71e734b9aa6be8c9472a
|
|
| BLAKE2b-256 |
5f425b03fdaab4c98ddedb33e1a5f30ed9e386144ca7bfd386fc51d1286f3e4e
|