PyStator Documentation¶
PyStator is a configuration-driven, stateless finite state machine library for Python. Define behavior in YAML or JSON; compute transitions from (current state + event + context); run guards and actions.
Documentation map¶
| Section | Description |
|---|---|
| Getting started | Install, first FSM, first process() call |
| Concepts | States, transitions, guards, actions, EntitySession vs Orchestrator, hierarchical and parallel |
| Package structure | Core (machine, instance, guards, actions, stores, orchestrator) vs optional (API, DB, UI, schedulers) |
| Architecture | Design goals, core flow, components, sandwich pattern |
| Schedulers | Choosing a scheduler, delayed transitions (after), minimal Orchestrator example |
| Configuration | Config file, environment, database (API) |
| Worker | Continuous event-processing service: pystator worker, worker_events, submit_event |
| Tutorials | Step-by-step: order workflow, API & UI |
| Examples | Runnable examples and what they demonstrate |
| Reference | FSM config (YAML/JSON) schema and validation |
| API reference | StateMachine, EntitySession, Orchestrator, Worker, schedulers, execution modes |
Quick links¶
- I want to run something in 2 minutes → README Quick start or Getting started
- I want to understand states and transitions → Concepts
- I want to know what's core vs optional → Package structure
- I want to understand how to run / scale → Concepts: Running a machine, Schedulers
- I want a continuous service that processes events from a queue → Worker
- I want to build an order workflow → Tutorial: Order workflow
- I want to use the REST API and UI → Tutorial: API and UI
- I want to see full code examples → Examples and examples/ directory
- I want the full YAML/config schema → FSM configuration reference
- I want to understand design and architecture → Architecture
Prerequisites¶
- Python 3.10+
- For API/UI:
pip install pystator[api] - For inline guard expressions:
pip install pystator[recipes]