# pytransitions/transitions

A lightweight, object-oriented finite state machine implementation in Python with many extensions

Repository: https://github.com/pytransitions/transitions
Canonical: https://ross.abutalabs.com/products/transitions
Language: Python
License: MIT
License Family: permissive
Topics: python, state-machine, nested-states, hierarchical-state-machine, state-diagram
Last push: 2025-09-11T04:34:54+00:00

## Health v2 (maintenance only)
Score: 41/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 41, release rhythm 8, longevity 100
- inputs: {"age_days": 4343, "days_push": 356, "days_rel": 427, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 6582, forks 568 (observed 2026-08-28T04:09:45.438596+00:00)

## What it is
A lightweight, object-oriented finite state machine library for Python with extensions for nested/hierarchical states, conditions, callbacks, and diagram generation. It is installable via pip and compatible with Python 2.7+ and 3.0+.

## Use cases
- implement a finite state machine in python
- model object states with transitions and callbacks
- create hierarchical or nested state machines
- add conditional transitions to python objects
- generate state diagrams from machine definitions
- manage workflow states in a python application

## When to choose
- you need a lightweight, pure-Python state machine with no heavy dependencies
- you want features like nested states, ordered/queued transitions, and conditions
- you want to attach state machine behavior directly to your own classes

## When to avoid
- you need a distributed or persistent workflow engine rather than an in-process FSM
- your project is not in Python

## Facets
- artifact type: library
- maturity: stable
- function: state-management, developer-tools
- domain: developer-tools
- platform: python, cross-platform
- tags: finite-state-machine, state-machine, hierarchical-states, nested-states, state-diagram, object-oriented, algorithms, automation

## Member repositories
- pytransitions/transitions (main) score 41

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:45.438596+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:43:35.765021+00:00, confidence not recorded.
  - readme: https://github.com/pytransitions/transitions (fetched 2026-08-28T04:09:45.438596+00:00, sha f9d4e15aa9cc)
  - registry_pypi: https://pypi.org/pypi/transitions/json (fetched 2026-08-29T08:40:02.943090+00:00, sha 7ac3cc8d0329)
- Data as of 2026-08-30T08:39:29.467469+00:00.
