--- id: fysom version: "2.1.6" license: MIT license_treatment: permissive maintenance: abandoned --- # fysom — pYthOn Finite State Machine License: permissive · Maintenance: abandoned · Downloads: 129.1K/mo ## What it is and what it does Fysom is a lightweight finite state machine library that lets you define states, events, and transitions declaratively in a configuration dictionary. You create a Fysom object with an initial state and a list of events (each specifying source and destination states), and the library automatically generates methods for each event that trigger state transitions. You can query the current state, check if a transition is allowed, and optionally define callbacks to run on state changes. The library is a Python port of Jake Gordon's JavaScript state machine, ported by Mansour Behabadi and maintained with unit tests and a build process. It has no external runtime dependencies and is designed for simple, deterministic state workflows—traffic light sequences, workflow pipelines, or any system with discrete states and well-defined transitions between them. Use it for: - Model a workflow with discrete states (draft, review, approved, published) and define which transitions are allowed between them. - Implement a traffic light or similar simple state machine where events trigger deterministic state changes. - Build a game or interactive system with defined states (menu, playing, paused, game over) and event-driven transitions. - Validate state transitions in a business process to ensure only legal state changes occur. - Create a simple task scheduler or job runner that tracks job states (pending, running, completed, failed) and transitions. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Fysom is a finite state machine library that lets you define states, events, and transitions declaratively, then trigger state changes by calling event methods or the trigger() function. No. The package is abandoned (last release September 2021, no commits since October 2021) and has high install friction due to source-only distribution. While it is MIT-licensed and has no known vulnerabilities, the lack of maintenance means no bug fixes or Python version updates. Use only if you have an existing codebase already depending on it; for new projects, choose an actively maintained state machine library. ## Install pip install fysom uv add fysom poetry add fysom ## Installing fysom Before you install: High install friction: the package is abandoned (last release 2021-09-10, no commits since 2021-10-26) and has no runtime dependencies, but the distribution is source-only (tar.gz), requiring a build step on install. License in practice: MIT licensed (permissive). You can use, modify, and distribute fysom freely in commercial and private projects, provided you include the license notice. Quickstart: from fysom import Fysom fsm = Fysom({'initial': 'green', 'events': [ {'name': 'warn', 'src': 'green', 'dst': 'yellow'}, {'name': 'panic', 'src': 'yellow', 'dst': 'red'}]}) print(fsm.current) # 'green' fsm.warn() print(fsm.current) # 'yellow' Verify before relying: - Whether the package works reliably on Python versions beyond 3.5 (documentation mentions testing on 2.6–3.5 and PyPy, but no recent verification). - Whether there are known issues or edge cases in production use given the abandoned status since late 2021. ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: high - Maintenance: abandoned - Downloads: 129.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags finite state machine, state machine library, fsm python, state transitions, event-driven state, workflow state management, state machine framework, state-machine, workflow, abandoned [View on SkillFed](https://skillfed.io/packages/fysom) · [View on PyPI](https://pypi.org/project/fysom/)