Skip to content

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. Optional REST API, worker queue, and UI use the same model.

Documentation map

Section Description
Getting started Install, first FSM, process(), EntitySession, API pointers
Concepts States, transitions, guards, actions, Orchestrator, hierarchical and parallel
Naming rules Valid identifiers for states, triggers, guards, actions
Package structure Core vs extras ([api], [worker], [ui], [all], …)
Declarative features YAML check: / effects, builtins, sinks, lint, StateMachineBuilder
Architecture Design goals, sandwich pattern, components
Schedulers Delayed transitions (after), Asyncio / Redis / Celery
Configuration pystator.cfg, environment, database
Worker pystator worker, submit_event, worker_events, scaling
State stores In-memory, Postgres, Redis, MongoDB, custom
Tutorials Order workflow, API & UI
Examples Runnable examples
Reference FSM config schema
API reference Condensed Python API; generated pages under api/

Prerequisites

  • Python 3.11+
  • Core: pip install pystator
  • REST API: pip install pystator[api] (+ [postgres] for PostgreSQL URLs)
  • Worker + submit_event: pip install pystator[worker] and a database (PYSTATOR_DATABASE_URL)
  • Inline guard expressions (expr:): pip install pystator[recipes]
  • Local docs site: pip install pystator[docs] then pystator docs serve