skillfed

automaton

Friendly state machines for Python.

automaton v3.4.0 137.8K downloads/30d#11,357 on PyPI
Permissive license Apache-2.0 Active released

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 automaton

uv

uv add automaton

poetry

poetry add automaton

Installing 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

Environment :: OpenStackIntended Audience :: Information TechnologyIntended Audience :: System AdministratorsLicense :: OSI Approved :: Apache Software LicenseOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Typing :: Typed

Tags

state machine libraryfinite state machine pythonstate transitionsworkflow state managementtask scheduling state machinestate validationstate machine pattern
state-machineworkflowopenstack

More Software Development packages

Further reading