automaton
Friendly state machines for Python.
What it is and what it does
Automaton is a state machine library for Python that abstracts the state machine pattern into reusable, well-documented classes. It lets you define states, transitions between them, and validation rules, then execute state changes in a controlled way. The library is built on top of PrettyTable for display and typing-extensions for type hints, making it suitable for applications that need explicit state management—from workflow engines to task orchestration to event-driven systems.
The package is actively maintained, supports modern Python versions (3.10 through 3.13), and carries no known security vulnerabilities. It's positioned as part of the OpenStack ecosystem but is general-purpose enough for any Python project requiring state machine semantics.
Use it for:
- Build workflow engines where tasks move through defined states (pending, running, completed, failed) with validation at each transition.
- Implement event-driven systems that respond to specific triggers by transitioning between states in a predictable manner.
- Create task scheduling systems that track job state and enforce valid state transitions to prevent invalid operations.
- Validate state sequences in application logic to catch bugs where code attempts invalid state changes.
- Model complex business logic as explicit state machines to improve code clarity and testability.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Automaton provides state machine classes and utilities for Python, enabling you to define, validate, and execute state transitions in your application logic.
Yes. Automaton is a lightweight, actively maintained library with no security issues, low install friction, and permissive licensing. It's well-suited if you need explicit state machine semantics in your application. Install it if you're building workflows, event handlers, or any system where state transitions need to be validated and controlled; skip it if your use case is simple enough to handle with conditionals or if you prefer a different state machine abstraction.
Install
automaton on PyPI
pip
pip install automatonuv
uv add automatonpoetry
poetry add automatonInstalling automaton
Before you install
Low install friction with a pure-wheel distribution and only two lightweight runtime dependencies. Active maintenance status with a recent release.
License in practice
Licensed under Apache-2.0 (permissive), allowing use in commercial and proprietary projects with minimal restrictions.
Quickstart
pip install automaton
from automaton import machines
machine = machines.FiniteMachine()
machine.add_state('start')
machine.add_state('end')
machine.add_transition('start', 'end', 'go')
machine.initialize(start_state='start')
machine.process_event('go')
Requires Python 3.10 or later.
Verify before relying
- Whether the library supports hierarchical or nested state machines beyond basic finite state machine patterns.
- Performance characteristics when handling large numbers of states or transitions.
- Whether task scheduling and execution features are built-in or require external integration.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — PrettyTable, typing-extensions |
| Maintenance | actively maintained — 143 days since the last release |
| First released | |
| Downloads | 137,778/month — #11,357 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: automaton-3.4.0-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
AutomatAutomat provides a Python library for building…
permissive · top 5,000 on PyPI
cellpylibCellPyLib simulates 1- and 2-dimensional…
permissive · top 15,000 on PyPI
django-fsm-2Adds declarative finite state machine support…
permissive · top 15,000 on PyPI
python-statemachineDefines finite state machines and statecharts…
permissive · top 5,000 on PyPI
django-fsmProvides finite state machine support for…
permissive · top 15,000 on PyPI
taskflowTaskFlow is a library for defining and…
permissive · top 15,000 on PyPI
transitionsTransitions is a lightweight state machine…
permissive · top 5,000 on PyPI
django-fsm-logAutomatically logs state transitions for Django…
permissive · top 15,000 on PyPI
greeneryParses and manipulates regular expressions by…
permissive · top 15,000 on PyPI
fysomFysom is a finite state machine library that…
permissive · top 15,000 on PyPI