{
  "id": "task_libraries:state-machine/python",
  "path": "/exapedia/python-state-machine-libraries",
  "template": {
    "id": "task_libraries",
    "version": 4
  },
  "title": "Python state machine libraries",
  "answer": [
    {
      "t": "text",
      "text": "Python state machine libraries model an object's behavior as a fixed set of states and the transitions between them. A machine accepts only the transitions its definition allows and runs callbacks when the state changes. These libraries keep order workflows, Django models, and AI agent loops in a known state at every step."
    }
  ],
  "breadcrumb": [
    {
      "label": "Tools"
    },
    {
      "label": "Python state machine libraries"
    }
  ],
  "sections": [
    {
      "id": "libraries_popularity",
      "anchor": "popularity",
      "heading": "Popularity",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Monthly downloads",
            "Stars",
            "Last release",
            "License"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#automat-library",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F123"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F124"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F132"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F127"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F125"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#python-statemachine",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F137"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F138"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F144"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F141"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F139"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#transitions",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F154"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F155"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F161"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F158"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F156"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#django-fsm-two",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F170"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F171"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F179"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F174"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F172"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#django-fsm",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F185"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F186"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F194"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F189"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F187"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#fysom",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F200"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F201"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F209"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F204"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F202"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#automaton",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F218"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F219"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F225"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F222"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F220"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#sismic",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F234"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F235"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F243"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F238"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F236"
                }
              ]
            ]
          ],
          "variant": "pop",
          "caption": [
            {
              "t": "text",
              "text": "Downloads: "
            },
            {
              "t": "text",
              "text": "PyPI"
            },
            {
              "t": "text",
              "text": ", last thirty days. Stars and releases: GitHub. Amber: no release in over a year."
            }
          ]
        }
      ],
      "note": [
        {
          "t": "link",
          "href": "#automat-library",
          "label": [
            {
              "t": "text",
              "text": "Automat"
            }
          ]
        },
        {
          "t": "text",
          "text": " has the most monthly downloads in this comparison, at "
        },
        {
          "t": "fact",
          "fact": "F124"
        },
        {
          "t": "text",
          "text": "."
        }
      ]
    },
    {
      "id": "libraries_capabilities",
      "anchor": "capabilities",
      "heading": "Capabilities",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Django model integration",
            "Hierarchical states",
            "Awaits coroutine callbacks"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#automat-library",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F123"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F133"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F134"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F135"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#python-statemachine",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F137"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F145"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F146"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F147"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#transitions",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F154"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F162"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F163"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F164"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#django-fsm-two",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F170"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F180"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F181"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F182"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#django-fsm",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F185"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F195"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F196"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F197"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#fysom",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F200"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F210"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F211"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F212"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#automaton",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F218"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F226"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F227"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F228"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#sismic",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F234"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F244"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F245"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F246"
                }
              ]
            ]
          ],
          "variant": "cap"
        }
      ]
    },
    {
      "id": "libraries_entries",
      "anchor": "libraries",
      "heading": "Libraries",
      "blocks": [
        {
          "b": "entry",
          "anchor": "automat-library",
          "name": [
            {
              "t": "fact",
              "fact": "F123"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/glyph/automat"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/automat"
            },
            {
              "label": "Docs",
              "href": "https://automat.readthedocs.io/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F130"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F124"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F132"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F126"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F125"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://automat.readthedocs.io/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F123"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from typing import Protocol\nfrom automat import TypeMachineBuilder\n\nclass Inputs(Protocol):\n    def finish(self) -> None: ...\n\nbuilder = TypeMachineBuilder(Inputs, object)\nstart = builder.state('start')\ndone = builder.state('done')\n@start.upon(Inputs.finish).to(done)\ndef finish(controller: Inputs, data: object) -> None:\n    pass\nmachine = builder.build()(object())\nmachine.finish()\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://automat.readthedocs.io/en/latest/tutorial.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "tutorial.rst"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=automat%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F123"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F128"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "python-statemachine",
          "name": [
            {
              "t": "fact",
              "fact": "F137"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/fgmacedo/python-statemachine"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/python-statemachine"
            },
            {
              "label": "Docs",
              "href": "https://pypi.org/project/python-statemachine/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F35"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F138"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F144"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F140"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F139"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://pypi.org/project/python-statemachine/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F137"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F36"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F37"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F38"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F39"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F40"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F41"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F152"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F153"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/ArjanCodes/examples",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F152"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def main() -> None:\n    payment = PaymentMachine()\n\n    print_configuration(payment)\n\n    payment.authorize(Decimal(\"49.95\"))\n    print_configuration(payment)\n\n    payment.capture()\n    print_configuration(payment)",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/ArjanCodes/examples/blob/ab66e16c6379227b604c15ccb8e4fbcd9df3862d/2026/libraries/05_state_machine.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F151"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Public%20Python%20projects%20using%20python-statemachine%20for%20workflow%20transitions%2C%20state%20guards%2C%20connection%20lifecycles%20and%20event-driven%20processing&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F137"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from statemachine import StateChart, State\n\nclass Switch(StateChart):\n    off = State(initial=True)\n    on = State()\n    turn_on = off.to(on)\n\nswitch = Switch()\nswitch.send('turn_on')\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://pypi.org/pypi/python-statemachine/3.2.2/json#info.description",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F142"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "transitions",
          "name": [
            {
              "t": "fact",
              "fact": "F154"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/pytransitions/transitions"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/transitions"
            },
            {
              "label": "Docs",
              "href": "https://pypi.org/project/transitions/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F55"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F155"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F161"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F157"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F156"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://pypi.org/project/transitions/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F154"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F56"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F57"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F58"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F59"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F60"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F61"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F168"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F169"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/allenai/alexafsm",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F168"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def __init__(self, states: States, request: dict = None, with_graph: bool = False):\n    self.states = states\n    self.state = states.attributes.state\n    state_names, transitions = type(states).get_states_transitions()\n    machine_cls = \\\n        importlib.import_module('transitions.extensions').GraphMachine if with_graph else \\\n        importlib.import_module('transitions').Machine\n    self.machine = machine_cls(\n        model=self,\n        states=state_names,\n        initial=states.attributes.state,\n        auto_transitions=False\n    )\n\n    for transition in transitions:\n        self.machine.add_transition(**transition)",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/allenai/alexafsm/blob/0c2e8842ddbb4a34ac64a5139e7febee3b28889a/alexafsm/policy.py#L25-L40",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F167"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Public%20Python%20projects%20using%20transitions%20for%20workflow%20transitions%2C%20state%20guards%2C%20connection%20lifecycles%20and%20event-driven%20processing&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F154"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from transitions import Machine\nmachine = Machine(states=['a', 'b'], initial='a')\nmachine.add_transition('advance', 'a', 'b')\nmachine.advance()\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/pytransitions/transitions",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F159"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "django-fsm-two",
          "name": [
            {
              "t": "fact",
              "fact": "F170"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/django-commons/django-fsm-2"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/django-fsm-2"
            },
            {
              "label": "Docs",
              "href": "http://github.com/django-commons/django-fsm-2"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F177"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F171"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F179"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F173"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F172"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "http://github.com/django-commons/django-fsm-2",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F170"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from django.db import models\nfrom django_fsm import FSMField, FSMModelMixin, transition\n\nclass Article(FSMModelMixin, models.Model):\n    state = FSMField(default='draft')\n    @transition(field=state, source='draft', target='published')\n    def publish(self):\n        pass\n\narticle = Article()\narticle.publish()\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://pypi.org/pypi/django-fsm-2/4.3.0/json#info.description",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=django-fsm-2%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F170"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F175"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "django-fsm",
          "name": [
            {
              "t": "fact",
              "fact": "F185"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/viewflow/django-fsm"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/django-fsm"
            },
            {
              "label": "Docs",
              "href": "https://pypi.org/project/django-fsm/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F192"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F186"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F194"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F188"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F187"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://pypi.org/project/django-fsm/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F185"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from django_fsm import State\n\nclass Review:\n    state = State(states=None, default='draft')\n    @state.transition(source='draft', target='published')\n    def publish(self):\n        pass\n\nreview = Review()\nreview.publish()\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://pypi.org/pypi/django-fsm/5.0.2/json#info.description",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.rst"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=django-fsm%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F185"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F190"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "fysom",
          "name": [
            {
              "t": "fact",
              "fact": "F200"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/mriehl/fysom"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/fysom"
            },
            {
              "label": "Docs",
              "href": "https://pypi.org/project/fysom/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F207"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F201"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F209"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F203"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F202"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://pypi.org/project/fysom/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F200"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F216"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F217"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/Ulm-IQO/qudi-legacy",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F216"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "@QtCore.Slot(str, str)\ndef stopModule(self, base, key):\n    \"\"\" Figure out the module dependencies in terms of connections and deactivate module.\n\n      @param str base: Module category\n      @param str key: Unique module name\n\n    \"\"\"\n    deps = self.getRecursiveModuleDependencies(base, key)\n    sorteddeps = toposort(deps)\n    if len(sorteddeps) == 0:\n        sorteddeps.append(key)\n\n    for mkey in reversed(sorteddeps):\n        for mbase in ('hardware', 'logic', 'gui'):\n            if mkey in self.tree['defined'][mbase] and mkey in self.tree['loaded'][mbase]:\n                try:\n                    deact = self.tree['loaded'][mbase][mkey].module_state.can('deactivate')\n                except:\n                    deact = True\n                if deact:\n                    logger.info('Deactivating module {0}.{1}'.format(mbase, mkey))\n                    self.deactivateModule(mbase, mkey)",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/Ulm-IQO/qudi-legacy/blob/765180e1a6ef79ddcf8e548dfd3e0458a257cb5d/core/manager.py#L1181-L1203",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F215"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=fysom%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F200"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from fysom import Fysom\nfsm = Fysom(initial='green', events=[('warn', 'green', 'yellow')])\nfsm.warn()\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/mriehl/fysom",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.rst"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F205"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "automaton",
          "name": [
            {
              "t": "fact",
              "fact": "F218"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/openstack/automaton"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/automaton"
            },
            {
              "label": "Docs",
              "href": "https://pypi.org/project/automaton/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F78"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F219"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F225"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F221"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F220"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://pypi.org/project/automaton/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F218"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F79"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F80"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F81"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F82"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F83"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F84"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F232"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F233"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/openstack/taskflow",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F232"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def build(self, statistics, timeout=None, gather_statistics=True):\n    \"\"\"Builds a state-machine (that is used during running).\"\"\"\n    if gather_statistics:\n        watches = {}\n        state_statistics = {}\n        statistics['seconds_per_state'] = state_statistics\n        watches = {}\n        for timed_state in TIMED_STATES:\n            state_statistics[timed_state.lower()] = 0.0\n            watches[timed_state] = timeutils.StopWatch()\n        statistics['discarded_failures'] = 0\n        statistics['awaiting'] = 0\n        statistics['completed'] = 0\n        statistics['incomplete'] = 0\n\n    memory = MachineMemory()\n    if timeout is None:\n        timeout = WAITING_TIMEOUT\n\n    # Cache some local functions/methods...\n    do_complete = self._completer.complete\n    do_complete_failure = self._completer.complete_failure\n    get_atom_intention = self._storage.get_atom_intention\n\n    def do_schedule(next_nodes):\n        with self._storage.lock.write_lock():\n            return self._scheduler.schedule(\n                sorted(\n                    next_nodes,\n                    key=lambda node: getattr(node, 'priority', 0),\n                    reverse=True,\n                )\n            )\n\n    def iter_next_atoms(atom=None, apply_deciders=True):\n        # Yields and filters and tweaks the next atoms to run...\n        maybe_atoms_it = self._selector.iter_next_atoms(atom=atom)\n        for atom, late_decider in maybe_atoms_it:\n            if apply_deciders:\n                proceed = late_decider.check_and_affect(self._runtime)\n                if proceed:\n                    yield atom\n            else:\n                yield atom\n\n    def resume(old_state, new_state, event):\n        # This reaction function just updates the state machines memory\n        # to include any nodes that need to be executed (from a previous\n        # attempt, which may be empty if never ran before) and any nodes\n        # that are now ready to be ran.\n        with self._storage.lock.write_lock():\n            memory.next_up.update(\n                iter_utils.unique_seen(\n                    (self._completer.resume(), iter_next_atoms())\n                )\n            )\n        return SCHEDULE\n\n    def game_over(old_state, new_state, event):\n        # This reaction function is mainly a intermediary delegation\n        # function that analyzes the current memory and transitions to\n        # the appropriate handler that will deal with the memory values,\n        # it is *always* called before the final state is entered.\n        if memory.failures:\n            return FAILED\n        with self._storage.lock.read_lock():\n            leftover_atoms = iter_utils.count(\n                # Avoid activating the deciders, since at this point\n                # the engine is finishing and there will be no more further\n                # work done anyway...\n                iter_next_atoms(apply_deciders=False)\n            )\n        if leftover_atoms:\n            # Ok we didn't finish (either reverting or executing...) so\n            # that means we must of been stopped at some point...\n            LOG.trace(\n                \"Suspension determined to have been reacted to\"\n                \" since (at least) %s atoms have been left in an\"\n                \" unfinished state\",\n                leftover_atoms,\n            )\n            return SUSPENDED\n        elif self._runtime.is_success():\n            return SUCCESS\n        else:\n            return REVERTED\n\n    def schedule(old_state, new_state, event):\n        # This reaction function starts to schedule the memory's next\n        # nodes (iff the engine is still runnable, which it may not be\n        # if the user of this engine has requested the engine/storage\n        # that holds this information to stop or suspend); handles failures\n        # that occur during this process safely...\n        with self._storage.lock.write_lock():\n            current_flow_state = self._storage.get_flow_state()\n            if current_flow_state == st.RUNNING and memory.next_up:\n                not_done, failures = do_schedule(memory.next_up)\n                if not_done:\n                    memory.not_done.update(not_done)\n                if failures:\n                    memory.failures.extend(failures)\n                memory.next_up.intersection_update(not_done)\n            elif current_flow_state == st.SUSPENDING and memory.not_done:\n                # Try to force anything not cancelled to now be cancelled\n                # so that the executor that gets it does not continue to\n                # try to work on it (if the future execution is still in\n                # its backlog, if it's already being executed, this will\n                # do nothing).\n                memory.cancel_futures()\n        return WAIT\n\n    def complete_an_atom(fut):\n        # This completes a single atom saving its result in\n        # storage and preparing whatever predecessors or successors will\n        # now be ready to execute (or revert or retry...); it also\n        # handles failures that occur during this process safely...\n        atom = fut.atom\n        try:\n            outcome, result = fut.result()\n            do_complete(atom, outcome, result)\n            if isinstance(result, failure.Failure):\n                retain = do_complete_failure(atom, outcome, result)\n                if retain:\n                    memory.failures.append(result)\n                else:\n                    # NOTE(harlowja): avoid making any intention request\n                    # to storage unless we are sure we are in DEBUG\n                    # enabled logging (otherwise we will call this all\n                    # the time even when DEBUG is not enabled, which\n                    # would suck...)\n                    if LOG.isEnabledFor(logging.DEBUG):\n                        intention = get_atom_intention(atom.name)\n                        LOG.debug(\n                            \"Discarding failure '%s' (in response\"\n                            \" to outcome '%s') under completion\"\n                            \" units request during completion of\"\n                            \" atom '%s' (intention is to %s)\",\n                            result,\n                            outcome,\n                            atom,\n                            intention,\n                        )\n                    if gather_statistics:\n                        statistics['discarded_failures'] += 1\n            if gather_statistics:\n                statistics['completed'] += 1\n        except futures.CancelledError:\n            # Well it got cancelled, skip doing anything\n            # and move on; at a further time it will be resumed\n            # and something should be done with it to get it\n            # going again.\n            return WAS_CANCELLED\n        except Exception:\n            memory.failures.append(failure.Failure())\n            LOG.exception(\"Engine '%s' atom post-completion failed\", atom)\n            return FAILED_COMPLETING\n        else:\n            return SUCCESSFULLY_COMPLETED\n\n    def wait(old_state, new_state, event):\n        # TODO(harlowja): maybe we should start doing 'yield from' this\n        # call sometime in the future, or equivalent that will work in\n        # py2 and py3.\n        if memory.not_done:\n            done, not_done = self._waiter(memory.not_done, timeout=timeout)\n            memory.done.update(done)\n            memory.not_done = not_done\n        return ANALYZE\n\n    def analyze(old_state, new_state, event):\n        # This reaction function is responsible for analyzing all nodes\n        # that have finished executing/reverting and figuring\n        # out what nodes are now ready to be ran (and then triggering those\n        # nodes to be scheduled in the future); handles failures that\n        # occur during this process safely...\n        next_up = set()\n        with self._storage.lock.write_lock():\n            while memory.done:\n                fut = memory.done.pop()\n                # Force it to be completed so that we can ensure that\n                # before we iterate over any successors or predecessors\n                # that we know it has been completed and saved and so on...\n                completion_status = complete_an_atom(fut)\n                if (\n                    not memory.failures\n                    and completion_status != WAS_CANCELLED\n                ):\n                    atom = fut.atom\n                    try:\n                        more_work = set(iter_next_atoms(atom=atom))\n                    except Exception:\n                        memory.failures.append(failure.Failure())\n                        LOG.exception(\n                            \"Engine '%s' atom post-completion\"\n                            \" next atom searching failed\",\n                            atom,\n                        )\n                    else:\n                        next_up.update(more_work)\n        current_flow_state = self._storage.get_flow_state()\n        if (\n            current_flow_state == st.RUNNING\n            and next_up\n            and not memory.failures\n        ):\n            memory.next_up.update(next_up)\n            return SCHEDULE\n        elif memory.not_done:\n            if current_flow_state == st.SUSPENDING:\n                memory.cancel_futures()\n            return WAIT\n        else:\n            return FINISH\n\n    def on_exit(old_state, event):\n        LOG.trace(\n            \"Exiting old state '%s' in response to event '%s'\",\n            old_state,\n            event,\n        )\n        if gather_statistics:\n            if old_state in watches:\n                w = watches[old_state]\n                w.stop()\n                state_statistics[old_state.lower()] += w.elapsed()\n            if old_state in (st.SCHEDULING, st.WAITING):\n                statistics['incomplete'] = len(memory.not_done)\n            if old_state in (st.ANALYZING, st.SCHEDULING):\n                statistics['awaiting'] = len(memory.next_up)\n\n    def on_enter(new_state, event):\n        LOG.trace(\n            \"Entering new state '%s' in response to event '%s'\",\n            new_state,\n            event,\n        )\n        if gather_statistics and new_state in watches:\n            watches[new_state].restart()\n\n    state_kwargs = {\n        'on_exit': on_exit,\n        'on_enter': on_enter,\n    }\n    m = machines.FiniteMachine()\n    m.add_state(GAME_OVER, **state_kwargs)\n    m.add_state(UNDEFINED, **state_kwargs)\n    m.add_state(st.ANALYZING, **state_kwargs)\n    m.add_state(st.RESUMING, **state_kwargs)\n    m.add_state(st.REVERTED, terminal=True, **state_kwargs)\n    m.add_state(st.SCHEDULING, **state_kwargs)\n    m.add_state(st.SUCCESS, terminal=True, **state_kwargs)\n    m.add_state(st.SUSPENDED, terminal=True, **state_kwargs)\n    m.add_state(st.WAITING, **state_kwargs)\n    m.add_state(st.FAILURE, terminal=True, **state_kwargs)\n    m.default_start_state = UNDEFINED\n\n    m.add_transition(GAME_OVER, st.REVERTED, REVERTED)\n    m.add_transition(GAME_OVER, st.SUCCESS, SUCCESS)\n    m.add_transition(GAME_OVER, st.SUSPENDED, SUSPENDED)\n    m.add_transition(GAME_OVER, st.FAILURE, FAILED)\n    m.add_transition(UNDEFINED, st.RESUMING, START)\n    m.add_transition(st.ANALYZING, GAME_OVER, FINISH)\n    m.add_transition(st.ANALYZING, st.SCHEDULING, SCHEDULE)\n    m.add_transition(st.ANALYZING, st.WAITING, WAIT)\n    m.add_transition(st.RESUMING, st.SCHEDULING, SCHEDULE)\n    m.add_transition(st.SCHEDULING, st.WAITING, WAIT)\n    m.add_transition(st.WAITING, st.ANALYZING, ANALYZE)\n\n    m.add_reaction(GAME_OVER, FINISH, game_over)\n    m.add_reaction(st.ANALYZING, ANALYZE, analyze)\n    m.add_reaction(st.RESUMING, START, resume)\n    m.add_reaction(st.SCHEDULING, SCHEDULE, schedule)\n    m.add_reaction(st.WAITING, WAIT, wait)\n\n    m.freeze()\n    return (m, memory)",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/openstack/taskflow/blob/c485e402f117a07e8e75723e4d3d95c3f0fc371a/taskflow/engines/action_engine/builder.py#L119-L394",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F231"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Public%20Python%20projects%20using%20automaton%20for%20workflow%20transitions%2C%20state%20guards%2C%20connection%20lifecycles%20and%20event-driven%20processing&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F218"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from automaton.machines import FiniteMachine\nmachine = FiniteMachine()\nmachine.add_state('a')\nmachine.add_state('b')\nmachine.add_transition('a', 'b', 'advance')\nmachine.initialize(start_state='a')\nmachine.process_event('advance')\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://docs.openstack.org/automaton/latest/reference/index.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "examples.rst"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F223"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "sismic",
          "name": [
            {
              "t": "fact",
              "fact": "F234"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/AlexandreDecan/sismic"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/sismic"
            },
            {
              "label": "Docs",
              "href": "https://pypi.org/project/sismic/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F241"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F235"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F243"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F237"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F236"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://pypi.org/project/sismic/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F234"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from sismic.io import import_from_yaml\nfrom sismic.interpreter import Interpreter\n\nchart = import_from_yaml('''statechart:\n  name: Example\n  root state:\n    name: root\n    initial: idle\n    states:\n      - name: idle\n''')\ninterpreter = Interpreter(chart)\ninterpreter.execute()\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://sismic.readthedocs.io/en/latest/api/io.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "io.html"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=sismic%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F234"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F239"
            }
          ]
        }
      ]
    }
  ],
  "questions": [
    {
      "q": "Which Python state machine library should I use?",
      "a": [
        {
          "t": "link",
          "href": "#python-statemachine",
          "label": [
            {
              "t": "text",
              "text": "Python StateMachine"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits workflows with compound states, parallel regions, and async callbacks. "
        },
        {
          "t": "link",
          "href": "#transitions",
          "label": [
            {
              "t": "text",
              "text": "transitions"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits object-oriented machines with hierarchy, asyncio, and diagram extensions. "
        },
        {
          "t": "link",
          "href": "#django-fsm",
          "label": [
            {
              "t": "text",
              "text": "Django FSM"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits state fields on Django models."
        }
      ]
    },
    {
      "q": "Which Python state machine libraries support asyncio?",
      "a": [
        {
          "t": "link",
          "href": "#transitions",
          "label": [
            {
              "t": "text",
              "text": "transitions"
            }
          ]
        },
        {
          "t": "text",
          "text": " provides asynchronous machine extensions. "
        },
        {
          "t": "link",
          "href": "#python-statemachine",
          "label": [
            {
              "t": "text",
              "text": "Python StateMachine"
            }
          ]
        },
        {
          "t": "text",
          "text": " selects its async engine automatically when async callbacks are registered."
        }
      ]
    },
    {
      "q": "Can one machine instance be shared across threads?",
      "a": [
        {
          "t": "link",
          "href": "#python-statemachine",
          "label": [
            {
              "t": "text",
              "text": "Python StateMachine"
            }
          ]
        },
        {
          "t": "text",
          "text": " requires external synchronization for an instance shared across threads."
        }
      ]
    },
    {
      "q": "Do diagram exports need extra dependencies?",
      "a": [
        {
          "t": "text",
          "text": "Yes. Python StateMachine diagrams require pydot and the Graphviz tool. Automat image generation also requires Graphviz."
        }
      ]
    }
  ],
  "facts": {
    "F1": {
      "label": "Library name, Automat",
      "display": "Automat",
      "asOf": "2026-11-17"
    },
    "F2": {
      "label": "Monthly downloads, Automat",
      "display": "14.2M",
      "asOf": "2026-11-16"
    },
    "F3": {
      "label": "License, Automat",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F4": {
      "label": "Package release, Automat",
      "display": "25.4.16, Apr 2025",
      "asOf": "2025-04-16"
    },
    "F5": {
      "label": "Package release date, Automat",
      "display": "Apr 2025",
      "asOf": "2025-04-16"
    },
    "F6": {
      "label": "Repository stars, Automat",
      "display": "651",
      "asOf": "2026-11-17"
    },
    "F7": {
      "label": "Diagrams, Automat",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F8": {
      "label": "Output formats, Automat",
      "display": "PNG",
      "asOf": "2026-11-17"
    },
    "F9": {
      "label": "Install, Automat",
      "display": "pip install Automat",
      "asOf": "2026-11-17"
    },
    "F10": {
      "label": "What it does, Automat",
      "display": "Expresses deterministic finite-state transducers with Python interfaces.",
      "asOf": "2026-11-17"
    },
    "F11": {
      "label": "strengths lead, Automat",
      "display": "Builds typed event interfaces",
      "asOf": "2026-11-17"
    },
    "F12": {
      "label": "strengths, Automat",
      "display": "Define the input protocol, shared core, and state-specific behavior separately.",
      "asOf": "2026-11-17"
    },
    "F13": {
      "label": "strengths lead, Automat",
      "display": "Restores state-specific data",
      "asOf": "2026-11-17"
    },
    "F14": {
      "label": "strengths, Automat",
      "display": "Supply a starting state and data factory when rebuilding a machine.",
      "asOf": "2026-11-17"
    },
    "F15": {
      "label": "limitations lead, Automat",
      "display": "Reentrant return values raise errors",
      "asOf": "2026-11-17"
    },
    "F16": {
      "label": "limitations, Automat",
      "display": "Schedule value-returning inputs after the current behavior finishes.",
      "asOf": "2026-11-17"
    },
    "F17": {
      "label": "Quickstart, Automat",
      "display": "import dataclasses\nimport typing\nfrom enum import Enum, auto\n\nfrom automat import NoTransition, TypeMachineBuilder\n\n\nclass Direction(Enum):\n    up = auto()\n    stopped = auto()\n    down = auto()\n\n\n@dataclasses.dataclass\nclass Motor:\n    direction: Direction = Direction.stopped\n\n    def up(self) -> None:\n        assert self.direction is Direction.stopped\n        self.direction = Direction.up\n        print(\"motor running up\")\n\n    def stop(self) -> None:\n        self.direction = Direction.stopped\n        print(\"motor stopped\")\n\n    def down(self) -> None:\n        assert self.direction is Direction.stopped\n        self.direction = Direction.down\n        print(\"motor running down\")\n\n\n@dataclasses.dataclass\nclass Alarm:\n    def beep(self) -> None:\n        \"Sound an alarm so that the user can hear.\"\n        print(\"beep beep beep\")\n\n\n# protocol definition\nclass GarageController(typing.Protocol):\n    def pushButton(self) -> None:\n        \"Push the button to open or close the door\"\n\n    def openSensor(self) -> None:\n        \"The 'open' sensor activated; the door is fully open.\"\n\n    def closeSensor(self) -> None:\n        \"The 'close' sensor activated; the door is fully closed.\"\n\n\n# end protocol definition\n# core definition\n@dataclasses.dataclass\nclass DoorDevices:\n    motor: Motor\n    alarm: Alarm\n\n\n\"end core definition\"\n\n# end core definition\n\n# start building\nbuilder = TypeMachineBuilder(GarageController, DoorDevices)\n# build states\nclosed = builder.state(\"closed\")\nopening = builder.state(\"opening\")\nopened = builder.state(\"opened\")\nclosing = builder.state(\"closing\")\n# end states\n\n\n# build methods\n@closed.upon(GarageController.pushButton).to(opening)\ndef startOpening(controller: GarageController, devices: DoorDevices) -> None:\n    devices.motor.up()\n\n\n@opening.upon(GarageController.openSensor).to(opened)\ndef finishedOpening(controller: GarageController, devices: DoorDevices):\n    devices.motor.stop()\n\n\n@opened.upon(GarageController.pushButton).to(closing)\ndef startClosing(controller: GarageController, devices: DoorDevices) -> None:\n    devices.alarm.beep()\n    devices.motor.down()\n\n\n@closing.upon(GarageController.closeSensor).to(closed)\ndef finishedClosing(controller: GarageController, devices: DoorDevices):\n    devices.motor.stop()\n    # end methods\n\n\n# do build\nmachineFactory = builder.build()\n# end building\n# story\nif __name__ == \"__main__\":\n    # do instantiate\n    machine = machineFactory(DoorDevices(Motor(), Alarm()))\n    # end instantiate\n    print(\"pushing button...\")\n    # do open\n    machine.pushButton()\n    # end open\n    print(\"pushedW\")\n    try:\n        machine.pushButton()\n    except NoTransition:\n        print(\"this is not implemented yet\")\n    print(\"triggering open sensor, pushing button again\")\n    # sensor and close\n    machine.openSensor()\n    machine.pushButton()\n    # end close\n    print(\"pushed\")\n    machine.closeSensor()\n\n# end story\n",
      "asOf": "2026-11-17"
    },
    "F18": {
      "label": "Project function, Automat",
      "display": "def makeMachine() -> Callable[[_Core], _Client]:\n    machine = TypeMachineBuilder(_Client, _Core)\n\n    def waitForRetry(\n        c: _Client, s: _Core, failure: Failure | None = None\n    ) -> IDelayedCall:\n        s.failedAttempts += 1\n        delay = s.timeoutForAttempt(s.failedAttempts)\n        s.log.info(\n            \"Scheduling retry {attempt} to connect {endpoint} in {delay} seconds.\",\n            attempt=s.failedAttempts,\n            endpoint=s.endpoint,\n            delay=delay,\n        )\n        return s.clock.callLater(delay, c._reconnect)\n\n    def rememberConnection(\n        c: _Client, s: _Core, protocol: _ReconnectingProtocolProxy\n    ) -> _ReconnectingProtocolProxy:\n        s.failedAttempts = 0\n        s.unawait(protocol._protocol)\n        return protocol\n\n    def attemptConnection(\n        c: _Client, s: _Core, failure: Failure | None = None\n    ) -> Deferred[_ReconnectingProtocolProxy]:\n        factoryProxy = _DisconnectFactory(s.factory, c._clientDisconnected)\n        connecting: Deferred[IProtocol] = s.endpoint.connect(factoryProxy)\n\n        def prepare(\n            protocol: _ReconnectingProtocolProxy,\n        ) -> Deferred[_ReconnectingProtocolProxy]:\n            if s.prepareConnection is not None:\n                return maybeDeferred(s.prepareConnection, protocol).addCallback(\n                    lambda _: protocol\n                )\n            return succeed(protocol)\n\n        # endpoint.connect() is actually generic on the type of the protocol,\n        # but this is not expressible via zope.interface, so we have to cast\n        # https://github.com/Shoobx/mypy-zope/issues/95\n        connectingProxy: Deferred[_ReconnectingProtocolProxy]\n        connectingProxy = connecting  # type:ignore[assignment]\n        (\n            connectingProxy.addCallback(prepare)\n            .addCallback(c._connectionMade)\n            .addErrback(c._connectionFailed)\n        )\n        return connectingProxy\n\n    # States:\n    Init = machine.state(\"Init\")\n    Connecting = machine.state(\"Connecting\", attemptConnection)\n    Stopped = machine.state(\"Stopped\")\n    Waiting = machine.state(\"Waiting\", waitForRetry)\n    Connected = machine.state(\"Connected\", rememberConnection)\n    Disconnecting = machine.state(\"Disconnecting\")\n    Restarting = machine.state(\"Restarting\")\n    Stopped = machine.state(\"Stopped\")\n\n    # Behavior-less state transitions:\n    Init.upon(_Client.start).to(Connecting).returns(None)\n    Connecting.upon(_Client.start).loop().returns(None)\n    Connecting.upon(_Client._connectionMade).to(Connected).returns(None)\n    Waiting.upon(_Client.start).loop().returns(None)\n    Waiting.upon(_Client._reconnect).to(Connecting).returns(None)\n    Connected.upon(_Client._connectionFailed).to(Waiting).returns(None)\n    Connected.upon(_Client.start).loop().returns(None)\n    Connected.upon(_Client._clientDisconnected).to(Waiting).returns(None)\n    Disconnecting.upon(_Client.start).to(Restarting).returns(None)\n    Restarting.upon(_Client.start).to(Restarting).returns(None)\n    Stopped.upon(_Client.start).to(Connecting).returns(None)\n\n    # Behavior-full state transitions:\n    @pep614(Init.upon(_Client.stop).to(Stopped))\n    @pep614(Stopped.upon(_Client.stop).to(Stopped))\n    def immediateStop(c: _Client, s: _Core) -> Deferred[None]:\n        return succeed(None)\n\n    @pep614(Connecting.upon(_Client.stop).to(Disconnecting))\n    def connectingStop(\n        c: _Client, s: _Core, attempt: Deferred[_ReconnectingProtocolProxy]\n    ) -> Deferred[None]:\n        waited = s.waitForStop()\n        attempt.cancel()\n        return waited\n\n    @pep614(Connecting.upon(_Client._connectionFailed, nodata=True).to(Waiting))\n    def failedWhenConnecting(c: _Client, s: _Core, failure: Failure) -> None:\n        ready = []\n        notReady: list[tuple[Deferred[IProtocol], int | None]] = []\n        for w, remaining in s.awaitingConnected:\n            if remaining is None:\n                notReady.append((w, remaining))\n            elif remaining <= 1:\n                ready.append(w)\n            else:\n                notReady.append((w, remaining - 1))\n        s.awaitingConnected = notReady\n        for w in ready:\n            w.callback(failure)\n\n    @pep614(Waiting.upon(_Client.stop).to(Stopped))\n    def stop(c: _Client, s: _Core, futureRetry: IDelayedCall) -> Deferred[None]:\n        waited = s.waitForStop()\n        s.cancelConnectWaiters()\n        futureRetry.cancel()\n        s.finishStopping()\n        return waited\n\n    @pep614(Connected.upon(_Client.stop).to(Disconnecting))\n    def stopWhileConnected(\n        c: _Client, s: _Core, protocol: _ReconnectingProtocolProxy\n    ) -> Deferred[None]:\n        waited = s.waitForStop()\n        protocol._transport.loseConnection()\n        return waited\n\n    @pep614(Connected.upon(_Client.whenConnected).loop())\n    def whenConnectedWhenConnected(\n        c: _Client,\n        s: _Core,\n        protocol: _ReconnectingProtocolProxy,\n        failAfterFailures: int | None = None,\n    ) -> Deferred[IProtocol]:\n        return succeed(protocol._protocol)\n\n    @pep614(Disconnecting.upon(_Client.stop).loop())\n    @pep614(Restarting.upon(_Client.stop).to(Disconnecting))\n    def discoStop(c: _Client, s: _Core) -> Deferred[None]:\n        return s.waitForStop()\n\n    @pep614(Disconnecting.upon(_Client._connectionFailed).to(Stopped))\n    @pep614(Disconnecting.upon(_Client._clientDisconnected).to(Stopped))\n    def disconnectingFinished(\n        c: _Client, s: _Core, failure: Failure | None = None\n    ) -> None:\n        s.cancelConnectWaiters()\n        s.finishStopping()\n\n    @pep614(Connecting.upon(_Client.whenConnected, nodata=True).loop())\n    @pep614(Waiting.upon(_Client.whenConnected, nodata=True).loop())\n    @pep614(Init.upon(_Client.whenConnected).to(Init))\n    @pep614(Restarting.upon(_Client.whenConnected).to(Restarting))\n    @pep614(Disconnecting.upon(_Client.whenConnected).to(Disconnecting))\n    def awaitingConnection(\n        c: _Client, s: _Core, failAfterFailures: int | None = None\n    ) -> Deferred[IProtocol]:\n        result: Deferred[IProtocol] = Deferred()\n        s.awaitingConnected.append((result, failAfterFailures))\n        return result\n\n    @pep614(Restarting.upon(_Client._clientDisconnected).to(Connecting))\n    def restartDone(c: _Client, s: _Core, failure: Failure | None = None) -> None:\n        s.finishStopping()\n\n    @pep614(Stopped.upon(_Client.whenConnected).to(Stopped))\n    def notGoingToConnect(\n        c: _Client, s: _Core, failAfterFailures: int | None = None\n    ) -> Deferred[IProtocol]:\n        return fail(CancelledError())\n\n    return machine.build()\n",
      "asOf": "2026-11-17"
    },
    "F19": {
      "label": "Project function reference, Automat",
      "display": "_client_service.py · makeMachine()",
      "asOf": "2026-11-17"
    },
    "F20": {
      "label": "Project repository, Automat",
      "display": "twisted/twisted",
      "asOf": "2026-11-17"
    },
    "F21": {
      "label": "Project stars, twisted/twisted",
      "display": "6.0K",
      "asOf": "2026-11-17"
    },
    "F22": {
      "label": "Project push date, twisted/twisted",
      "display": "Nov 2026",
      "asOf": "2026-11-14"
    },
    "F23": {
      "label": "Library name, python-statemachine",
      "display": "python-statemachine",
      "asOf": "2026-11-17"
    },
    "F24": {
      "label": "Monthly downloads, python-statemachine",
      "display": "3.1M",
      "asOf": "2026-11-16"
    },
    "F25": {
      "label": "License, python-statemachine",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F26": {
      "label": "Package release, python-statemachine",
      "display": "3.2.2, Oct 2026",
      "asOf": "2026-10-14"
    },
    "F27": {
      "label": "Package release date, python-statemachine",
      "display": "Oct 2026",
      "asOf": "2026-10-14"
    },
    "F28": {
      "label": "Repository stars, python-statemachine",
      "display": "1.3K",
      "asOf": "2026-11-17"
    },
    "F29": {
      "label": "Guarded transitions, python-statemachine",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F30": {
      "label": "Hierarchical states, python-statemachine",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F31": {
      "label": "Native asyncio, python-statemachine",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F32": {
      "label": "Diagrams, python-statemachine",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F33": {
      "label": "Output formats, python-statemachine",
      "display": "PNG SVG PDF",
      "asOf": "2026-11-17"
    },
    "F34": {
      "label": "Install, python-statemachine",
      "display": "pip install python-statemachine",
      "asOf": "2026-11-17"
    },
    "F35": {
      "label": "What it does, python-statemachine",
      "display": "Defines declarative state machines and statecharts for synchronous and asynchronous Python.",
      "asOf": "2026-11-17"
    },
    "F36": {
      "label": "strengths lead, python-statemachine",
      "display": "Declares workflows as Python classes",
      "asOf": "2026-11-17"
    },
    "F37": {
      "label": "strengths, python-statemachine",
      "display": "Express states, transitions, and guards together in a machine class.",
      "asOf": "2026-11-17"
    },
    "F38": {
      "label": "strengths lead, python-statemachine",
      "display": "Detects async callbacks automatically",
      "asOf": "2026-11-17"
    },
    "F39": {
      "label": "strengths, python-statemachine",
      "display": "Use the same event API with an automatically selected async engine.",
      "asOf": "2026-11-17"
    },
    "F40": {
      "label": "limitations lead, python-statemachine",
      "display": "Thread sharing needs synchronization",
      "asOf": "2026-11-17"
    },
    "F41": {
      "label": "limitations, python-statemachine",
      "display": "Protect a shared machine instance when callbacks run across multiple threads.",
      "asOf": "2026-11-17"
    },
    "F42": {
      "label": "Quickstart, python-statemachine",
      "display": "from statemachine import StateChart, State\nclass TrafficLightMachine(StateChart):\n    \"A traffic light machine\"\n    green = State(initial=True)\n    yellow = State()\n    red = State()\n\n    cycle = (\n        green.to(yellow)\n        | yellow.to(red)\n        | red.to(green)\n    )\n\n    def before_cycle(self, event: str, source: State, target: State):\n        return f\"Running {event} from {source.id} to {target.id}\"\n\n    def on_enter_red(self):\n        print(\"Don't move.\")\n\n    def on_exit_red(self):\n        print(\"Go ahead!\")\nsm = TrafficLightMachine()\nsm.send(\"cycle\")\nsm.send(\"cycle\")\nsm.send(\"cycle\")\n",
      "asOf": "2026-11-17"
    },
    "F43": {
      "label": "Library name, transitions",
      "display": "transitions",
      "asOf": "2026-11-17"
    },
    "F44": {
      "label": "Monthly downloads, transitions",
      "display": "1.9M",
      "asOf": "2026-11-16"
    },
    "F45": {
      "label": "License, transitions",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F46": {
      "label": "Package release, transitions",
      "display": "0.9.3, Jul 2025",
      "asOf": "2025-07-02"
    },
    "F47": {
      "label": "Package release date, transitions",
      "display": "Jul 2025",
      "asOf": "2025-07-02"
    },
    "F48": {
      "label": "Repository stars, transitions",
      "display": "6.6K",
      "asOf": "2026-11-17"
    },
    "F49": {
      "label": "Guarded transitions, transitions",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F50": {
      "label": "Hierarchical states, transitions",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F51": {
      "label": "Native asyncio, transitions",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F52": {
      "label": "Diagrams, transitions",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F53": {
      "label": "Output formats, transitions",
      "display": "PNG",
      "asOf": "2026-11-17"
    },
    "F54": {
      "label": "Install, transitions",
      "display": "pip install transitions",
      "asOf": "2026-11-17"
    },
    "F55": {
      "label": "What it does, transitions",
      "display": "Defines object-oriented finite state machines with optional extension classes.",
      "asOf": "2026-11-17"
    },
    "F56": {
      "label": "strengths lead, transitions",
      "display": "Binds transitions to existing models",
      "asOf": "2026-11-17"
    },
    "F57": {
      "label": "strengths, transitions",
      "display": "Attach states, triggers, and callbacks to application objects.",
      "asOf": "2026-11-17"
    },
    "F58": {
      "label": "strengths lead, transitions",
      "display": "Combines hierarchy and async callbacks",
      "asOf": "2026-11-17"
    },
    "F59": {
      "label": "strengths, transitions",
      "display": "Choose the matching machine extension for nested states and asynchronous processing.",
      "asOf": "2026-11-17"
    },
    "F60": {
      "label": "limitations lead, transitions",
      "display": "Queued success means accepted",
      "asOf": "2026-11-17"
    },
    "F61": {
      "label": "limitations, transitions",
      "display": "A queued trigger returns True before its eventual transition outcome is known.",
      "asOf": "2026-11-17"
    },
    "F62": {
      "label": "Quickstart, transitions",
      "display": "from transitions import Machine\nimport random\n\nclass NarcolepticSuperhero(object):\n\n    # Define some states. Most of the time, narcoleptic superheroes are just like\n    # everyone else. Except for...\n    states = ['asleep', 'hanging out', 'hungry', 'sweaty', 'saving the world']\n\n    def __init__(self, name):\n\n        # No anonymous superheroes on my watch! Every narcoleptic superhero gets\n        # a name. Any name at all. SleepyMan. SlumberGirl. You get the idea.\n        self.name = name\n\n        # What have we accomplished today?\n        self.kittens_rescued = 0\n\n        # Initialize the state machine\n        self.machine = Machine(model=self, states=NarcolepticSuperhero.states, initial='asleep')\n\n        # Add some transitions. We could also define these using a static list of\n        # dictionaries, as we did with states above, and then pass the list to\n        # the Machine initializer as the transitions= argument.\n\n        # At some point, every superhero must rise and shine.\n        self.machine.add_transition(trigger='wake_up', source='asleep', dest='hanging out')\n\n        # Superheroes need to keep in shape.\n        self.machine.add_transition('work_out', 'hanging out', 'hungry')\n\n        # Those calories won't replenish themselves!\n        self.machine.add_transition('eat', 'hungry', 'hanging out')\n\n        # Superheroes are always on call. ALWAYS. But they're not always\n        # dressed in work-appropriate clothing.\n        self.machine.add_transition('distress_call', '*', 'saving the world',\n                         before='change_into_super_secret_costume')\n\n        # When they get off work, they're all sweaty and disgusting. But before\n        # they do anything else, they have to meticulously log their latest\n        # escapades. Because the legal department says so.\n        self.machine.add_transition('complete_mission', 'saving the world', 'sweaty',\n                         after='update_journal')\n\n        # Sweat is a disorder that can be remedied with water.\n        # Unless you've had a particularly long day, in which case... bed time!\n        self.machine.add_transition('clean_up', 'sweaty', 'asleep', conditions=['is_exhausted'])\n        self.machine.add_transition('clean_up', 'sweaty', 'hanging out')\n\n        # Our NarcolepticSuperhero can fall asleep at pretty much any time.\n        self.machine.add_transition('nap', '*', 'asleep')\n\n    def update_journal(self):\n        \"\"\" Dear Diary, today I saved Mr. Whiskers. Again. \"\"\"\n        self.kittens_rescued += 1\n\n    @property\n    def is_exhausted(self):\n        \"\"\" Basically a coin toss. \"\"\"\n        return random.random() < 0.5\n\n    def change_into_super_secret_costume(self):\n        print(\"Beauty, eh?\")\n",
      "asOf": "2026-11-17"
    },
    "F63": {
      "label": "Project function, transitions",
      "display": "def __init__(self, states: States, request: dict = None, with_graph: bool = False):\n    self.states = states\n    self.state = states.attributes.state\n    state_names, transitions = type(states).get_states_transitions()\n    machine_cls = \\\n        importlib.import_module('transitions.extensions').GraphMachine if with_graph else \\\n        importlib.import_module('transitions').Machine\n    self.machine = machine_cls(\n        model=self,\n        states=state_names,\n        initial=states.attributes.state,\n        auto_transitions=False\n    )\n\n    for transition in transitions:\n        self.machine.add_transition(**transition)\n",
      "asOf": "2026-11-17"
    },
    "F64": {
      "label": "Project function reference, transitions",
      "display": "policy.py · __init__()",
      "asOf": "2026-11-17"
    },
    "F65": {
      "label": "Project repository, transitions",
      "display": "allenai/alexafsm",
      "asOf": "2026-11-17"
    },
    "F66": {
      "label": "Project stars, allenai/alexafsm",
      "display": "112",
      "asOf": "2026-11-17"
    },
    "F67": {
      "label": "Project push date, allenai/alexafsm",
      "display": "May 2023",
      "asOf": "2023-05-01"
    },
    "F68": {
      "label": "Library name, automaton",
      "display": "automaton",
      "asOf": "2026-11-17"
    },
    "F69": {
      "label": "Monthly downloads, automaton",
      "display": "84.3K",
      "asOf": "2026-11-16"
    },
    "F70": {
      "label": "License, automaton",
      "display": "Apache-2.0",
      "asOf": "2026-11-17"
    },
    "F71": {
      "label": "Package release, automaton",
      "display": "3.5.0, Aug 2026",
      "asOf": "2026-08-26"
    },
    "F72": {
      "label": "Package release date, automaton",
      "display": "Aug 2026",
      "asOf": "2026-08-26"
    },
    "F73": {
      "label": "Repository stars, automaton",
      "display": "61",
      "asOf": "2026-11-17"
    },
    "F74": {
      "label": "Hierarchical states, automaton",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F75": {
      "label": "Diagrams, automaton",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F76": {
      "label": "Output formats, automaton",
      "display": "Text",
      "asOf": "2026-11-17"
    },
    "F77": {
      "label": "Install, automaton",
      "display": "pip install automaton",
      "asOf": "2026-11-17"
    },
    "F78": {
      "label": "What it does, automaton",
      "display": "Provides developer-friendly state machines for Python.",
      "asOf": "2026-11-17"
    },
    "F79": {
      "label": "strengths lead, automaton",
      "display": "Separates events from reaction execution",
      "asOf": "2026-11-17"
    },
    "F80": {
      "label": "strengths, automaton",
      "display": "Drive events explicitly or use a runner for callback-driven transitions.",
      "asOf": "2026-11-17"
    },
    "F81": {
      "label": "strengths lead, automaton",
      "display": "Supports hierarchical machines",
      "asOf": "2026-11-17"
    },
    "F82": {
      "label": "strengths, automaton",
      "display": "Compose nested finite machines for hierarchical state processing.",
      "asOf": "2026-11-17"
    },
    "F83": {
      "label": "limitations lead, automaton",
      "display": "Frozen definitions reject additions",
      "asOf": "2026-11-17"
    },
    "F84": {
      "label": "limitations, automaton",
      "display": "Finish adding states, transitions, and reactions before freezing the machine.",
      "asOf": "2026-11-17"
    },
    "F85": {
      "label": "Quickstart, automaton",
      "display": "from automaton import machines\nm = machines.FiniteMachine()\nm.add_state('up')\nm.add_state('down')\nm.add_transition('down', 'up', 'jump')\nm.add_transition('up', 'down', 'fall')\nm.default_start_state = 'down'\nprint(m.pformat())\nm.initialize()\nm.process_event('jump')\nprint(m.pformat())\nprint(m.current_state)\nprint(m.terminated)\nm.process_event('fall')\nprint(m.pformat())\nprint(m.current_state)\nprint(m.terminated)\nfrom automaton import machines\nfrom automaton import runners\n\n\n# These reaction functions will get triggered when the registered state\n# and event occur, it is expected to provide a new event that reacts to the\n# new stable state (so that the state-machine can transition to a new\n# stable state, and repeat, until the machine ends up in a terminal\n# state, whereby it will stop...)\n\ndef react_to_squirrel(old_state, new_state, event_that_triggered):\n    return \"gets petted\"\n\n\ndef react_to_wagging(old_state, new_state, event_that_triggered):\n    return \"gets petted\"\n\n\nm = machines.FiniteMachine()\n\nm.add_state(\"sits\")\nm.add_state(\"lies down\", terminal=True)\nm.add_state(\"barks\")\nm.add_state(\"wags tail\")\n\nm.default_start_state = 'sits'\n\nm.add_transition(\"sits\", \"barks\", \"squirrel!\")\nm.add_transition(\"barks\", \"wags tail\", \"gets petted\")\nm.add_transition(\"wags tail\", \"lies down\", \"gets petted\")\n\nm.add_reaction(\"barks\", \"squirrel!\", react_to_squirrel)\nm.add_reaction('wags tail', \"gets petted\", react_to_wagging)\n\nprint(m.pformat())\nr = runners.FiniteRunner(m)\nfor (old_state, new_state) in r.run_iter(\"squirrel!\"):\n    print(\"Leaving '%s'\" % old_state)\n    print(\"Entered '%s'\" % new_state)\n",
      "asOf": "2026-11-17"
    },
    "F86": {
      "label": "Project function, automaton",
      "display": "def build(self, statistics, timeout=None, gather_statistics=True):\n    \"\"\"Builds a state-machine (that is used during running).\"\"\"\n    if gather_statistics:\n        watches = {}\n        state_statistics = {}\n        statistics['seconds_per_state'] = state_statistics\n        watches = {}\n        for timed_state in TIMED_STATES:\n            state_statistics[timed_state.lower()] = 0.0\n            watches[timed_state] = timeutils.StopWatch()\n        statistics['discarded_failures'] = 0\n        statistics['awaiting'] = 0\n        statistics['completed'] = 0\n        statistics['incomplete'] = 0\n\n    memory = MachineMemory()\n    if timeout is None:\n        timeout = WAITING_TIMEOUT\n\n    # Cache some local functions/methods...\n    do_complete = self._completer.complete\n    do_complete_failure = self._completer.complete_failure\n    get_atom_intention = self._storage.get_atom_intention\n\n    def do_schedule(next_nodes):\n        with self._storage.lock.write_lock():\n            return self._scheduler.schedule(\n                sorted(\n                    next_nodes,\n                    key=lambda node: getattr(node, 'priority', 0),\n                    reverse=True,\n                )\n            )\n\n    def iter_next_atoms(atom=None, apply_deciders=True):\n        # Yields and filters and tweaks the next atoms to run...\n        maybe_atoms_it = self._selector.iter_next_atoms(atom=atom)\n        for atom, late_decider in maybe_atoms_it:\n            if apply_deciders:\n                proceed = late_decider.check_and_affect(self._runtime)\n                if proceed:\n                    yield atom\n            else:\n                yield atom\n\n    def resume(old_state, new_state, event):\n        # This reaction function just updates the state machines memory\n        # to include any nodes that need to be executed (from a previous\n        # attempt, which may be empty if never ran before) and any nodes\n        # that are now ready to be ran.\n        with self._storage.lock.write_lock():\n            memory.next_up.update(\n                iter_utils.unique_seen(\n                    (self._completer.resume(), iter_next_atoms())\n                )\n            )\n        return SCHEDULE\n\n    def game_over(old_state, new_state, event):\n        # This reaction function is mainly a intermediary delegation\n        # function that analyzes the current memory and transitions to\n        # the appropriate handler that will deal with the memory values,\n        # it is *always* called before the final state is entered.\n        if memory.failures:\n            return FAILED\n        with self._storage.lock.read_lock():\n            leftover_atoms = iter_utils.count(\n                # Avoid activating the deciders, since at this point\n                # the engine is finishing and there will be no more further\n                # work done anyway...\n                iter_next_atoms(apply_deciders=False)\n            )\n        if leftover_atoms:\n            # Ok we didn't finish (either reverting or executing...) so\n            # that means we must of been stopped at some point...\n            LOG.trace(\n                \"Suspension determined to have been reacted to\"\n                \" since (at least) %s atoms have been left in an\"\n                \" unfinished state\",\n                leftover_atoms,\n            )\n            return SUSPENDED\n        elif self._runtime.is_success():\n            return SUCCESS\n        else:\n            return REVERTED\n\n    def schedule(old_state, new_state, event):\n        # This reaction function starts to schedule the memory's next\n        # nodes (iff the engine is still runnable, which it may not be\n        # if the user of this engine has requested the engine/storage\n        # that holds this information to stop or suspend); handles failures\n        # that occur during this process safely...\n        with self._storage.lock.write_lock():\n            current_flow_state = self._storage.get_flow_state()\n            if current_flow_state == st.RUNNING and memory.next_up:\n                not_done, failures = do_schedule(memory.next_up)\n                if not_done:\n                    memory.not_done.update(not_done)\n                if failures:\n                    memory.failures.extend(failures)\n                memory.next_up.intersection_update(not_done)\n            elif current_flow_state == st.SUSPENDING and memory.not_done:\n                # Try to force anything not cancelled to now be cancelled\n                # so that the executor that gets it does not continue to\n                # try to work on it (if the future execution is still in\n                # its backlog, if it's already being executed, this will\n                # do nothing).\n                memory.cancel_futures()\n        return WAIT\n\n    def complete_an_atom(fut):\n        # This completes a single atom saving its result in\n        # storage and preparing whatever predecessors or successors will\n        # now be ready to execute (or revert or retry...); it also\n        # handles failures that occur during this process safely...\n        atom = fut.atom\n        try:\n            outcome, result = fut.result()\n            do_complete(atom, outcome, result)\n            if isinstance(result, failure.Failure):\n                retain = do_complete_failure(atom, outcome, result)\n                if retain:\n                    memory.failures.append(result)\n                else:\n                    # NOTE(harlowja): avoid making any intention request\n                    # to storage unless we are sure we are in DEBUG\n                    # enabled logging (otherwise we will call this all\n                    # the time even when DEBUG is not enabled, which\n                    # would suck...)\n                    if LOG.isEnabledFor(logging.DEBUG):\n                        intention = get_atom_intention(atom.name)\n                        LOG.debug(\n                            \"Discarding failure '%s' (in response\"\n                            \" to outcome '%s') under completion\"\n                            \" units request during completion of\"\n                            \" atom '%s' (intention is to %s)\",\n                            result,\n                            outcome,\n                            atom,\n                            intention,\n                        )\n                    if gather_statistics:\n                        statistics['discarded_failures'] += 1\n            if gather_statistics:\n                statistics['completed'] += 1\n        except futures.CancelledError:\n            # Well it got cancelled, skip doing anything\n            # and move on; at a further time it will be resumed\n            # and something should be done with it to get it\n            # going again.\n            return WAS_CANCELLED\n        except Exception:\n            memory.failures.append(failure.Failure())\n            LOG.exception(\"Engine '%s' atom post-completion failed\", atom)\n            return FAILED_COMPLETING\n        else:\n            return SUCCESSFULLY_COMPLETED\n\n    def wait(old_state, new_state, event):\n        # TODO(harlowja): maybe we should start doing 'yield from' this\n        # call sometime in the future, or equivalent that will work in\n        # py2 and py3.\n        if memory.not_done:\n            done, not_done = self._waiter(memory.not_done, timeout=timeout)\n            memory.done.update(done)\n            memory.not_done = not_done\n        return ANALYZE\n\n    def analyze(old_state, new_state, event):\n        # This reaction function is responsible for analyzing all nodes\n        # that have finished executing/reverting and figuring\n        # out what nodes are now ready to be ran (and then triggering those\n        # nodes to be scheduled in the future); handles failures that\n        # occur during this process safely...\n        next_up = set()\n        with self._storage.lock.write_lock():\n            while memory.done:\n                fut = memory.done.pop()\n                # Force it to be completed so that we can ensure that\n                # before we iterate over any successors or predecessors\n                # that we know it has been completed and saved and so on...\n                completion_status = complete_an_atom(fut)\n                if (\n                    not memory.failures\n                    and completion_status != WAS_CANCELLED\n                ):\n                    atom = fut.atom\n                    try:\n                        more_work = set(iter_next_atoms(atom=atom))\n                    except Exception:\n                        memory.failures.append(failure.Failure())\n                        LOG.exception(\n                            \"Engine '%s' atom post-completion\"\n                            \" next atom searching failed\",\n                            atom,\n                        )\n                    else:\n                        next_up.update(more_work)\n        current_flow_state = self._storage.get_flow_state()\n        if (\n            current_flow_state == st.RUNNING\n            and next_up\n            and not memory.failures\n        ):\n            memory.next_up.update(next_up)\n            return SCHEDULE\n        elif memory.not_done:\n            if current_flow_state == st.SUSPENDING:\n                memory.cancel_futures()\n            return WAIT\n        else:\n            return FINISH\n\n    def on_exit(old_state, event):\n        LOG.trace(\n            \"Exiting old state '%s' in response to event '%s'\",\n            old_state,\n            event,\n        )\n        if gather_statistics:\n            if old_state in watches:\n                w = watches[old_state]\n                w.stop()\n                state_statistics[old_state.lower()] += w.elapsed()\n            if old_state in (st.SCHEDULING, st.WAITING):\n                statistics['incomplete'] = len(memory.not_done)\n            if old_state in (st.ANALYZING, st.SCHEDULING):\n                statistics['awaiting'] = len(memory.next_up)\n\n    def on_enter(new_state, event):\n        LOG.trace(\n            \"Entering new state '%s' in response to event '%s'\",\n            new_state,\n            event,\n        )\n        if gather_statistics and new_state in watches:\n            watches[new_state].restart()\n\n    state_kwargs = {\n        'on_exit': on_exit,\n        'on_enter': on_enter,\n    }\n    m = machines.FiniteMachine()\n    m.add_state(GAME_OVER, **state_kwargs)\n    m.add_state(UNDEFINED, **state_kwargs)\n    m.add_state(st.ANALYZING, **state_kwargs)\n    m.add_state(st.RESUMING, **state_kwargs)\n    m.add_state(st.REVERTED, terminal=True, **state_kwargs)\n    m.add_state(st.SCHEDULING, **state_kwargs)\n    m.add_state(st.SUCCESS, terminal=True, **state_kwargs)\n    m.add_state(st.SUSPENDED, terminal=True, **state_kwargs)\n    m.add_state(st.WAITING, **state_kwargs)\n    m.add_state(st.FAILURE, terminal=True, **state_kwargs)\n    m.default_start_state = UNDEFINED\n\n    m.add_transition(GAME_OVER, st.REVERTED, REVERTED)\n    m.add_transition(GAME_OVER, st.SUCCESS, SUCCESS)\n    m.add_transition(GAME_OVER, st.SUSPENDED, SUSPENDED)\n    m.add_transition(GAME_OVER, st.FAILURE, FAILED)\n    m.add_transition(UNDEFINED, st.RESUMING, START)\n    m.add_transition(st.ANALYZING, GAME_OVER, FINISH)\n    m.add_transition(st.ANALYZING, st.SCHEDULING, SCHEDULE)\n    m.add_transition(st.ANALYZING, st.WAITING, WAIT)\n    m.add_transition(st.RESUMING, st.SCHEDULING, SCHEDULE)\n    m.add_transition(st.SCHEDULING, st.WAITING, WAIT)\n    m.add_transition(st.WAITING, st.ANALYZING, ANALYZE)\n\n    m.add_reaction(GAME_OVER, FINISH, game_over)\n    m.add_reaction(st.ANALYZING, ANALYZE, analyze)\n    m.add_reaction(st.RESUMING, START, resume)\n    m.add_reaction(st.SCHEDULING, SCHEDULE, schedule)\n    m.add_reaction(st.WAITING, WAIT, wait)\n\n    m.freeze()\n    return (m, memory)\n",
      "asOf": "2026-11-17"
    },
    "F87": {
      "label": "Project function reference, automaton",
      "display": "builder.py · build()",
      "asOf": "2026-11-17"
    },
    "F88": {
      "label": "Project repository, automaton",
      "display": "openstack/taskflow",
      "asOf": "2026-11-17"
    },
    "F89": {
      "label": "Project stars, openstack/taskflow",
      "display": "376",
      "asOf": "2026-11-17"
    },
    "F90": {
      "label": "Project push date, openstack/taskflow",
      "display": "Nov 2026",
      "asOf": "2026-11-05"
    },
    "F91": {
      "label": "Developer need",
      "display": "Binding workflows to existing objects",
      "asOf": "2026-11-17"
    },
    "F92": {
      "label": "Why choose transitions",
      "display": "model-bound state and callback configuration",
      "asOf": "2026-11-17"
    },
    "F93": {
      "label": "Developer need in introduction",
      "display": "binding workflows to existing objects",
      "asOf": "2026-11-17"
    },
    "F94": {
      "label": "Developer need",
      "display": "Declarative class-based statecharts",
      "asOf": "2026-11-17"
    },
    "F95": {
      "label": "Why choose python-statemachine",
      "display": "states, transitions, and guards defined together",
      "asOf": "2026-11-17"
    },
    "F96": {
      "label": "Developer need in introduction",
      "display": "declarative class-based statecharts",
      "asOf": "2026-11-17"
    },
    "F97": {
      "label": "Developer need",
      "display": "Typed input interfaces",
      "asOf": "2026-11-17"
    },
    "F98": {
      "label": "Why choose Automat",
      "display": "typed event protocols and separate shared data",
      "asOf": "2026-11-17"
    },
    "F99": {
      "label": "Developer need in introduction",
      "display": "typed input interfaces",
      "asOf": "2026-11-17"
    },
    "F100": {
      "label": "When to consider python-statemachine",
      "display": "explicit asyncio callbacks should select the processing engine",
      "asOf": "2026-11-17"
    },
    "F101": {
      "label": "Developer need",
      "display": "Callback-driven event runners",
      "asOf": "2026-11-17"
    },
    "F102": {
      "label": "Why choose automaton",
      "display": "explicit event processing or reaction-driven runners",
      "asOf": "2026-11-17"
    },
    "F103": {
      "label": "Developer need in introduction",
      "display": "callback-driven event runners",
      "asOf": "2026-11-17"
    },
    "F104": {
      "label": "Page introduction",
      "display": "Python state machine libraries let developers model state transitions and event-driven behavior.",
      "asOf": "2026-11-17"
    },
    "F105": {
      "label": "FAQ: Which Python state machine library should I choose?",
      "display": "transitions binds states and triggers to a supplied model.",
      "asOf": "2026-11-17"
    },
    "F106": {
      "label": "FAQ: Which Python state machine library should I choose?",
      "display": "python-statemachine declares guards and transitions in a Python class.",
      "asOf": "2026-11-17"
    },
    "F107": {
      "label": "FAQ: Which Python state machine library should I choose?",
      "display": "Automat builds an event protocol around shared application data.",
      "asOf": "2026-11-17"
    },
    "F108": {
      "label": "FAQ: Which Python state machine library should I choose?",
      "display": "automaton supports explicit event processing and reaction-driven runners.",
      "asOf": "2026-11-17"
    },
    "F109": {
      "label": "FAQ: Does a successful queued trigger prove the transition completed?",
      "display": "transitions queued triggers return True when queued, before the eventual outcome is known.",
      "asOf": "2026-11-17"
    },
    "F110": {
      "label": "FAQ: Which libraries support asyncio callbacks?",
      "display": "transitions provides asynchronous machine extensions.",
      "asOf": "2026-11-17"
    },
    "F111": {
      "label": "FAQ: Which libraries support asyncio callbacks?",
      "display": "python-statemachine selects its async engine automatically when async callbacks are registered.",
      "asOf": "2026-11-17"
    },
    "F112": {
      "label": "FAQ: Can one machine instance be shared across threads?",
      "display": "python-statemachine requires external synchronization when sharing an instance across threads.",
      "asOf": "2026-11-17"
    },
    "F113": {
      "label": "FAQ: Can the workflows include nested states?",
      "display": "transitions provides hierarchical machine extensions.",
      "asOf": "2026-11-17"
    },
    "F114": {
      "label": "FAQ: Can the workflows include nested states?",
      "display": "python-statemachine supports compound states and parallel regions.",
      "asOf": "2026-11-17"
    },
    "F115": {
      "label": "FAQ: Can the workflows include nested states?",
      "display": "automaton provides a hierarchical finite machine class.",
      "asOf": "2026-11-17"
    },
    "F116": {
      "label": "FAQ: Do diagram exports require extra dependencies?",
      "display": "python-statemachine diagrams require pydot and the Graphviz tool.",
      "asOf": "2026-11-17"
    },
    "F117": {
      "label": "FAQ: Do diagram exports require extra dependencies?",
      "display": "Automat image generation also requires Graphviz.",
      "asOf": "2026-11-17"
    },
    "F118": {
      "label": "FAQ: Why can an Automat event raise an error during another event?",
      "display": "Automat cannot reentrantly return a value from future behavior; invoke value-returning inputs after current behavior completes.",
      "asOf": "2026-11-17"
    },
    "F119": {
      "label": "FAQ: Can a frozen automaton definition be extended?",
      "display": "Freezing stops additions of states, transitions, and reactions.",
      "asOf": "2026-11-17"
    },
    "F120": {
      "label": "FAQ: Does a diagram or transition table persist a running workflow?",
      "display": "python-statemachine exports diagrams through a pydot graph object.",
      "asOf": "2026-11-17"
    },
    "F121": {
      "label": "FAQ: Does a diagram or transition table persist a running workflow?",
      "display": "automaton pformat returns a formatted state and transition table.",
      "asOf": "2026-11-17"
    },
    "F122": {
      "label": "FAQ: Does a diagram or transition table persist a running workflow?",
      "display": "Automat restores state-specific data by constructing a machine with a chosen state and data factory.",
      "asOf": "2026-11-17"
    },
    "F123": {
      "label": "Library name, automat",
      "display": "Automat",
      "asOf": "2026-11-20"
    },
    "F124": {
      "label": "Monthly downloads, automat",
      "display": "14.8M",
      "asOf": "2026-11-20"
    },
    "F125": {
      "label": "License, automat",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F126": {
      "label": "Package release, automat",
      "display": "25.4.16",
      "asOf": "2026-11-20"
    },
    "F127": {
      "label": "Package release date, automat",
      "display": "Apr 2025",
      "asOf": "2026-11-20"
    },
    "F128": {
      "label": "Install, automat",
      "display": "pip install automat",
      "asOf": "2026-11-20"
    },
    "F129": {
      "label": "Quickstart, automat",
      "display": "from typing import Protocol\nfrom automat import TypeMachineBuilder\n\nclass Inputs(Protocol):\n    def finish(self) -> None: ...\n\nbuilder = TypeMachineBuilder(Inputs, object)\nstart = builder.state('start')\ndone = builder.state('done')\n@start.upon(Inputs.finish).to(done)\ndef finish(controller: Inputs, data: object) -> None:\n    pass\nmachine = builder.build()(object())\nmachine.finish()\n",
      "asOf": "2026-11-20"
    },
    "F130": {
      "label": "Official description, automat",
      "display": "Builds finite-state machines.",
      "asOf": "2026-11-20"
    },
    "F131": {
      "label": "Quickstart source file, automat",
      "display": "docs/tutorial.rst",
      "asOf": "2026-11-20"
    },
    "F132": {
      "label": "Repository stars, automat",
      "display": "651",
      "asOf": "2026-11-20"
    },
    "F133": {
      "label": "Django model integration, automat",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F134": {
      "label": "Hierarchical states, automat",
      "display": "Undocumented",
      "asOf": "2026-11-20"
    },
    "F135": {
      "label": "Awaits coroutine callbacks, automat",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F136": {
      "label": "Interface, automat",
      "display": "Typed input Protocol and separate shared data",
      "asOf": "2026-11-20"
    },
    "F137": {
      "label": "Library name, python-statemachine",
      "display": "Python StateMachine",
      "asOf": "2026-11-20"
    },
    "F138": {
      "label": "Monthly downloads, python-statemachine",
      "display": "3.2M",
      "asOf": "2026-11-20"
    },
    "F139": {
      "label": "License, python-statemachine",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F140": {
      "label": "Package release, python-statemachine",
      "display": "3.2.2",
      "asOf": "2026-11-20"
    },
    "F141": {
      "label": "Package release date, python-statemachine",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F142": {
      "label": "Install, python-statemachine",
      "display": "pip install python-statemachine",
      "asOf": "2026-11-20"
    },
    "F143": {
      "label": "Quickstart, python-statemachine",
      "display": "from statemachine import StateChart, State\n\nclass Switch(StateChart):\n    off = State(initial=True)\n    on = State()\n    turn_on = off.to(on)\n\nswitch = Switch()\nswitch.send('turn_on')\n",
      "asOf": "2026-11-20"
    },
    "F144": {
      "label": "Repository stars, python-statemachine",
      "display": "1.3K",
      "asOf": "2026-11-20"
    },
    "F145": {
      "label": "Django model integration, python-statemachine",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F146": {
      "label": "Hierarchical states, python-statemachine",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F147": {
      "label": "Awaits coroutine callbacks, python-statemachine",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F148": {
      "label": "Hierarchy, python-statemachine",
      "display": "StateChart compound, parallel, and history states",
      "asOf": "2026-11-20"
    },
    "F149": {
      "label": "Async callbacks, python-statemachine",
      "display": "Native sync/async engines selected from callbacks",
      "asOf": "2026-11-20"
    },
    "F150": {
      "label": "Project function, python-statemachine",
      "display": "def main() -> None:\n    payment = PaymentMachine()\n\n    print_configuration(payment)\n\n    payment.authorize(Decimal(\"49.95\"))\n    print_configuration(payment)\n\n    payment.capture()\n    print_configuration(payment)",
      "asOf": "2026-11-20"
    },
    "F151": {
      "label": "Project source file, python-statemachine",
      "display": "2026/libraries/05_state_machine.py",
      "asOf": "2026-11-20"
    },
    "F152": {
      "label": "Project full_name, python-statemachine",
      "display": "ArjanCodes/examples",
      "asOf": "2026-11-20"
    },
    "F153": {
      "label": "Project stargazers_count, python-statemachine",
      "display": "1.3K",
      "asOf": "2026-11-20"
    },
    "F154": {
      "label": "Library name, transitions",
      "display": "transitions",
      "asOf": "2026-11-20"
    },
    "F155": {
      "label": "Monthly downloads, transitions",
      "display": "2.0M",
      "asOf": "2026-11-20"
    },
    "F156": {
      "label": "License, transitions",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F157": {
      "label": "Package release, transitions",
      "display": "0.9.3",
      "asOf": "2026-11-20"
    },
    "F158": {
      "label": "Package release date, transitions",
      "display": "Jul 2025",
      "asOf": "2026-11-20"
    },
    "F159": {
      "label": "Install, transitions",
      "display": "pip install transitions",
      "asOf": "2026-11-20"
    },
    "F160": {
      "label": "Quickstart, transitions",
      "display": "from transitions import Machine\nmachine = Machine(states=['a', 'b'], initial='a')\nmachine.add_transition('advance', 'a', 'b')\nmachine.advance()\n",
      "asOf": "2026-11-20"
    },
    "F161": {
      "label": "Repository stars, transitions",
      "display": "6.6K",
      "asOf": "2026-11-20"
    },
    "F162": {
      "label": "Django model integration, transitions",
      "display": "Via plugin",
      "asOf": "2026-11-20"
    },
    "F163": {
      "label": "Hierarchical states, transitions",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F164": {
      "label": "Awaits coroutine callbacks, transitions",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F165": {
      "label": "Extensions, transitions",
      "display": "Hierarchy, asyncio, locking, and graph machine variants",
      "asOf": "2026-11-20"
    },
    "F166": {
      "label": "Project function, transitions",
      "display": "def __init__(self, states: States, request: dict = None, with_graph: bool = False):\n    self.states = states\n    self.state = states.attributes.state\n    state_names, transitions = type(states).get_states_transitions()\n    machine_cls = \\\n        importlib.import_module('transitions.extensions').GraphMachine if with_graph else \\\n        importlib.import_module('transitions').Machine\n    self.machine = machine_cls(\n        model=self,\n        states=state_names,\n        initial=states.attributes.state,\n        auto_transitions=False\n    )\n\n    for transition in transitions:\n        self.machine.add_transition(**transition)",
      "asOf": "2026-11-20"
    },
    "F167": {
      "label": "Project source file, transitions",
      "display": "alexafsm/policy.py",
      "asOf": "2026-11-20"
    },
    "F168": {
      "label": "Project full_name, transitions",
      "display": "allenai/alexafsm",
      "asOf": "2026-11-20"
    },
    "F169": {
      "label": "Project stargazers_count, transitions",
      "display": "112",
      "asOf": "2026-11-20"
    },
    "F170": {
      "label": "Library name, django-fsm-2",
      "display": "Django FSM-2",
      "asOf": "2026-11-20"
    },
    "F171": {
      "label": "Monthly downloads, django-fsm-2",
      "display": "668.6K",
      "asOf": "2026-11-20"
    },
    "F172": {
      "label": "License, django-fsm-2",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F173": {
      "label": "Package release, django-fsm-2",
      "display": "4.3.0",
      "asOf": "2026-11-20"
    },
    "F174": {
      "label": "Package release date, django-fsm-2",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F175": {
      "label": "Install, django-fsm-2",
      "display": "pip install django-fsm-2",
      "asOf": "2026-11-20"
    },
    "F176": {
      "label": "Quickstart, django-fsm-2",
      "display": "from django.db import models\nfrom django_fsm import FSMField, FSMModelMixin, transition\n\nclass Article(FSMModelMixin, models.Model):\n    state = FSMField(default='draft')\n    @transition(field=state, source='draft', target='published')\n    def publish(self):\n        pass\n\narticle = Article()\narticle.publish()\n",
      "asOf": "2026-11-20"
    },
    "F177": {
      "label": "Official description, django-fsm-2",
      "display": "Adds finite state machine support to Django.",
      "asOf": "2026-11-20"
    },
    "F178": {
      "label": "Quickstart source file, django-fsm-2",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F179": {
      "label": "Repository stars, django-fsm-2",
      "display": "287",
      "asOf": "2026-11-20"
    },
    "F180": {
      "label": "Django model integration, django-fsm-2",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F181": {
      "label": "Hierarchical states, django-fsm-2",
      "display": "Undocumented",
      "asOf": "2026-11-20"
    },
    "F182": {
      "label": "Awaits coroutine callbacks, django-fsm-2",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F183": {
      "label": "Persistence, django-fsm-2",
      "display": "In-memory transition requires save for persistence",
      "asOf": "2026-11-20"
    },
    "F184": {
      "label": "Lineage, django-fsm-2",
      "display": "Independent MIT fork sharing django_fsm import namespace",
      "asOf": "2026-11-20"
    },
    "F185": {
      "label": "Library name, django-fsm",
      "display": "Django FSM",
      "asOf": "2026-11-20"
    },
    "F186": {
      "label": "Monthly downloads, django-fsm",
      "display": "553.8K",
      "asOf": "2026-11-20"
    },
    "F187": {
      "label": "License, django-fsm",
      "display": "AGPL-3.0-or-later WITH viewflow-library-exception",
      "asOf": "2026-11-20"
    },
    "F188": {
      "label": "Package release, django-fsm",
      "display": "5.0.2",
      "asOf": "2026-11-20"
    },
    "F189": {
      "label": "Package release date, django-fsm",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F190": {
      "label": "Install, django-fsm",
      "display": "pip install django-fsm",
      "asOf": "2026-11-20"
    },
    "F191": {
      "label": "Quickstart, django-fsm",
      "display": "from django_fsm import State\n\nclass Review:\n    state = State(states=None, default='draft')\n    @state.transition(source='draft', target='published')\n    def publish(self):\n        pass\n\nreview = Review()\nreview.publish()\n",
      "asOf": "2026-11-20"
    },
    "F192": {
      "label": "Official description, django-fsm",
      "display": "Adds state machines to Python objects and Django models.",
      "asOf": "2026-11-20"
    },
    "F193": {
      "label": "Quickstart source file, django-fsm",
      "display": "README.rst",
      "asOf": "2026-11-20"
    },
    "F194": {
      "label": "Repository stars, django-fsm",
      "display": "2.3K",
      "asOf": "2026-11-20"
    },
    "F195": {
      "label": "Django model integration, django-fsm",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F196": {
      "label": "Hierarchical states, django-fsm",
      "display": "Undocumented",
      "asOf": "2026-11-20"
    },
    "F197": {
      "label": "Awaits coroutine callbacks, django-fsm",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F198": {
      "label": "Transition timing, django-fsm",
      "display": "Ordinary target applied before method body in version5",
      "asOf": "2026-11-20"
    },
    "F199": {
      "label": "Standalone mode, django-fsm",
      "display": "Plain-Python State needs no Django settings",
      "asOf": "2026-11-20"
    },
    "F200": {
      "label": "Library name, fysom",
      "display": "fysom",
      "asOf": "2026-11-20"
    },
    "F201": {
      "label": "Monthly downloads, fysom",
      "display": "91.8K",
      "asOf": "2026-11-20"
    },
    "F202": {
      "label": "License, fysom",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F203": {
      "label": "Package release, fysom",
      "display": "2.1.6",
      "asOf": "2026-11-20"
    },
    "F204": {
      "label": "Package release date, fysom",
      "display": "Sep 2021",
      "asOf": "2026-11-20"
    },
    "F205": {
      "label": "Install, fysom",
      "display": "pip install fysom",
      "asOf": "2026-11-20"
    },
    "F206": {
      "label": "Quickstart, fysom",
      "display": "from fysom import Fysom\nfsm = Fysom(initial='green', events=[('warn', 'green', 'yellow')])\nfsm.warn()\n",
      "asOf": "2026-11-20"
    },
    "F207": {
      "label": "Official description, fysom",
      "display": "Implements finite state machines in Python.",
      "asOf": "2026-11-20"
    },
    "F208": {
      "label": "Quickstart source file, fysom",
      "display": "README.rst",
      "asOf": "2026-11-20"
    },
    "F209": {
      "label": "Repository stars, fysom",
      "display": "398",
      "asOf": "2026-11-20"
    },
    "F210": {
      "label": "Django model integration, fysom",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F211": {
      "label": "Hierarchical states, fysom",
      "display": "Undocumented",
      "asOf": "2026-11-20"
    },
    "F212": {
      "label": "Awaits coroutine callbacks, fysom",
      "display": "Undocumented",
      "asOf": "2026-11-20"
    },
    "F213": {
      "label": "Deferred transitions, fysom",
      "display": "Manual deferral through returnFalse and transition()",
      "asOf": "2026-11-20"
    },
    "F214": {
      "label": "Project function, fysom",
      "display": "@QtCore.Slot(str, str)\ndef stopModule(self, base, key):\n    \"\"\" Figure out the module dependencies in terms of connections and deactivate module.\n\n      @param str base: Module category\n      @param str key: Unique module name\n\n    \"\"\"\n    deps = self.getRecursiveModuleDependencies(base, key)\n    sorteddeps = toposort(deps)\n    if len(sorteddeps) == 0:\n        sorteddeps.append(key)\n\n    for mkey in reversed(sorteddeps):\n        for mbase in ('hardware', 'logic', 'gui'):\n            if mkey in self.tree['defined'][mbase] and mkey in self.tree['loaded'][mbase]:\n                try:\n                    deact = self.tree['loaded'][mbase][mkey].module_state.can('deactivate')\n                except:\n                    deact = True\n                if deact:\n                    logger.info('Deactivating module {0}.{1}'.format(mbase, mkey))\n                    self.deactivateModule(mbase, mkey)",
      "asOf": "2026-11-20"
    },
    "F215": {
      "label": "Project source file, fysom",
      "display": "core/manager.py",
      "asOf": "2026-11-20"
    },
    "F216": {
      "label": "Project full_name, fysom",
      "display": "Ulm-IQO/qudi-legacy",
      "asOf": "2026-11-20"
    },
    "F217": {
      "label": "Project stargazers_count, fysom",
      "display": "173",
      "asOf": "2026-11-20"
    },
    "F218": {
      "label": "Library name, automaton",
      "display": "Automaton",
      "asOf": "2026-11-20"
    },
    "F219": {
      "label": "Monthly downloads, automaton",
      "display": "90.2K",
      "asOf": "2026-11-20"
    },
    "F220": {
      "label": "License, automaton",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F221": {
      "label": "Package release, automaton",
      "display": "3.5.0",
      "asOf": "2026-11-20"
    },
    "F222": {
      "label": "Package release date, automaton",
      "display": "Aug 2026",
      "asOf": "2026-11-20"
    },
    "F223": {
      "label": "Install, automaton",
      "display": "pip install automaton",
      "asOf": "2026-11-20"
    },
    "F224": {
      "label": "Quickstart, automaton",
      "display": "from automaton.machines import FiniteMachine\nmachine = FiniteMachine()\nmachine.add_state('a')\nmachine.add_state('b')\nmachine.add_transition('a', 'b', 'advance')\nmachine.initialize(start_state='a')\nmachine.process_event('advance')\n",
      "asOf": "2026-11-20"
    },
    "F225": {
      "label": "Repository stars, automaton",
      "display": "62",
      "asOf": "2026-11-20"
    },
    "F226": {
      "label": "Django model integration, automaton",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F227": {
      "label": "Hierarchical states, automaton",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F228": {
      "label": "Awaits coroutine callbacks, automaton",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F229": {
      "label": "Runners, automaton",
      "display": "Event/generator runners and hierarchical machine variant",
      "asOf": "2026-11-20"
    },
    "F230": {
      "label": "Project function, automaton",
      "display": "def build(self, statistics, timeout=None, gather_statistics=True):\n    \"\"\"Builds a state-machine (that is used during running).\"\"\"\n    if gather_statistics:\n        watches = {}\n        state_statistics = {}\n        statistics['seconds_per_state'] = state_statistics\n        watches = {}\n        for timed_state in TIMED_STATES:\n            state_statistics[timed_state.lower()] = 0.0\n            watches[timed_state] = timeutils.StopWatch()\n        statistics['discarded_failures'] = 0\n        statistics['awaiting'] = 0\n        statistics['completed'] = 0\n        statistics['incomplete'] = 0\n\n    memory = MachineMemory()\n    if timeout is None:\n        timeout = WAITING_TIMEOUT\n\n    # Cache some local functions/methods...\n    do_complete = self._completer.complete\n    do_complete_failure = self._completer.complete_failure\n    get_atom_intention = self._storage.get_atom_intention\n\n    def do_schedule(next_nodes):\n        with self._storage.lock.write_lock():\n            return self._scheduler.schedule(\n                sorted(\n                    next_nodes,\n                    key=lambda node: getattr(node, 'priority', 0),\n                    reverse=True,\n                )\n            )\n\n    def iter_next_atoms(atom=None, apply_deciders=True):\n        # Yields and filters and tweaks the next atoms to run...\n        maybe_atoms_it = self._selector.iter_next_atoms(atom=atom)\n        for atom, late_decider in maybe_atoms_it:\n            if apply_deciders:\n                proceed = late_decider.check_and_affect(self._runtime)\n                if proceed:\n                    yield atom\n            else:\n                yield atom\n\n    def resume(old_state, new_state, event):\n        # This reaction function just updates the state machines memory\n        # to include any nodes that need to be executed (from a previous\n        # attempt, which may be empty if never ran before) and any nodes\n        # that are now ready to be ran.\n        with self._storage.lock.write_lock():\n            memory.next_up.update(\n                iter_utils.unique_seen(\n                    (self._completer.resume(), iter_next_atoms())\n                )\n            )\n        return SCHEDULE\n\n    def game_over(old_state, new_state, event):\n        # This reaction function is mainly a intermediary delegation\n        # function that analyzes the current memory and transitions to\n        # the appropriate handler that will deal with the memory values,\n        # it is *always* called before the final state is entered.\n        if memory.failures:\n            return FAILED\n        with self._storage.lock.read_lock():\n            leftover_atoms = iter_utils.count(\n                # Avoid activating the deciders, since at this point\n                # the engine is finishing and there will be no more further\n                # work done anyway...\n                iter_next_atoms(apply_deciders=False)\n            )\n        if leftover_atoms:\n            # Ok we didn't finish (either reverting or executing...) so\n            # that means we must of been stopped at some point...\n            LOG.trace(\n                \"Suspension determined to have been reacted to\"\n                \" since (at least) %s atoms have been left in an\"\n                \" unfinished state\",\n                leftover_atoms,\n            )\n            return SUSPENDED\n        elif self._runtime.is_success():\n            return SUCCESS\n        else:\n            return REVERTED\n\n    def schedule(old_state, new_state, event):\n        # This reaction function starts to schedule the memory's next\n        # nodes (iff the engine is still runnable, which it may not be\n        # if the user of this engine has requested the engine/storage\n        # that holds this information to stop or suspend); handles failures\n        # that occur during this process safely...\n        with self._storage.lock.write_lock():\n            current_flow_state = self._storage.get_flow_state()\n            if current_flow_state == st.RUNNING and memory.next_up:\n                not_done, failures = do_schedule(memory.next_up)\n                if not_done:\n                    memory.not_done.update(not_done)\n                if failures:\n                    memory.failures.extend(failures)\n                memory.next_up.intersection_update(not_done)\n            elif current_flow_state == st.SUSPENDING and memory.not_done:\n                # Try to force anything not cancelled to now be cancelled\n                # so that the executor that gets it does not continue to\n                # try to work on it (if the future execution is still in\n                # its backlog, if it's already being executed, this will\n                # do nothing).\n                memory.cancel_futures()\n        return WAIT\n\n    def complete_an_atom(fut):\n        # This completes a single atom saving its result in\n        # storage and preparing whatever predecessors or successors will\n        # now be ready to execute (or revert or retry...); it also\n        # handles failures that occur during this process safely...\n        atom = fut.atom\n        try:\n            outcome, result = fut.result()\n            do_complete(atom, outcome, result)\n            if isinstance(result, failure.Failure):\n                retain = do_complete_failure(atom, outcome, result)\n                if retain:\n                    memory.failures.append(result)\n                else:\n                    # NOTE(harlowja): avoid making any intention request\n                    # to storage unless we are sure we are in DEBUG\n                    # enabled logging (otherwise we will call this all\n                    # the time even when DEBUG is not enabled, which\n                    # would suck...)\n                    if LOG.isEnabledFor(logging.DEBUG):\n                        intention = get_atom_intention(atom.name)\n                        LOG.debug(\n                            \"Discarding failure '%s' (in response\"\n                            \" to outcome '%s') under completion\"\n                            \" units request during completion of\"\n                            \" atom '%s' (intention is to %s)\",\n                            result,\n                            outcome,\n                            atom,\n                            intention,\n                        )\n                    if gather_statistics:\n                        statistics['discarded_failures'] += 1\n            if gather_statistics:\n                statistics['completed'] += 1\n        except futures.CancelledError:\n            # Well it got cancelled, skip doing anything\n            # and move on; at a further time it will be resumed\n            # and something should be done with it to get it\n            # going again.\n            return WAS_CANCELLED\n        except Exception:\n            memory.failures.append(failure.Failure())\n            LOG.exception(\"Engine '%s' atom post-completion failed\", atom)\n            return FAILED_COMPLETING\n        else:\n            return SUCCESSFULLY_COMPLETED\n\n    def wait(old_state, new_state, event):\n        # TODO(harlowja): maybe we should start doing 'yield from' this\n        # call sometime in the future, or equivalent that will work in\n        # py2 and py3.\n        if memory.not_done:\n            done, not_done = self._waiter(memory.not_done, timeout=timeout)\n            memory.done.update(done)\n            memory.not_done = not_done\n        return ANALYZE\n\n    def analyze(old_state, new_state, event):\n        # This reaction function is responsible for analyzing all nodes\n        # that have finished executing/reverting and figuring\n        # out what nodes are now ready to be ran (and then triggering those\n        # nodes to be scheduled in the future); handles failures that\n        # occur during this process safely...\n        next_up = set()\n        with self._storage.lock.write_lock():\n            while memory.done:\n                fut = memory.done.pop()\n                # Force it to be completed so that we can ensure that\n                # before we iterate over any successors or predecessors\n                # that we know it has been completed and saved and so on...\n                completion_status = complete_an_atom(fut)\n                if (\n                    not memory.failures\n                    and completion_status != WAS_CANCELLED\n                ):\n                    atom = fut.atom\n                    try:\n                        more_work = set(iter_next_atoms(atom=atom))\n                    except Exception:\n                        memory.failures.append(failure.Failure())\n                        LOG.exception(\n                            \"Engine '%s' atom post-completion\"\n                            \" next atom searching failed\",\n                            atom,\n                        )\n                    else:\n                        next_up.update(more_work)\n        current_flow_state = self._storage.get_flow_state()\n        if (\n            current_flow_state == st.RUNNING\n            and next_up\n            and not memory.failures\n        ):\n            memory.next_up.update(next_up)\n            return SCHEDULE\n        elif memory.not_done:\n            if current_flow_state == st.SUSPENDING:\n                memory.cancel_futures()\n            return WAIT\n        else:\n            return FINISH\n\n    def on_exit(old_state, event):\n        LOG.trace(\n            \"Exiting old state '%s' in response to event '%s'\",\n            old_state,\n            event,\n        )\n        if gather_statistics:\n            if old_state in watches:\n                w = watches[old_state]\n                w.stop()\n                state_statistics[old_state.lower()] += w.elapsed()\n            if old_state in (st.SCHEDULING, st.WAITING):\n                statistics['incomplete'] = len(memory.not_done)\n            if old_state in (st.ANALYZING, st.SCHEDULING):\n                statistics['awaiting'] = len(memory.next_up)\n\n    def on_enter(new_state, event):\n        LOG.trace(\n            \"Entering new state '%s' in response to event '%s'\",\n            new_state,\n            event,\n        )\n        if gather_statistics and new_state in watches:\n            watches[new_state].restart()\n\n    state_kwargs = {\n        'on_exit': on_exit,\n        'on_enter': on_enter,\n    }\n    m = machines.FiniteMachine()\n    m.add_state(GAME_OVER, **state_kwargs)\n    m.add_state(UNDEFINED, **state_kwargs)\n    m.add_state(st.ANALYZING, **state_kwargs)\n    m.add_state(st.RESUMING, **state_kwargs)\n    m.add_state(st.REVERTED, terminal=True, **state_kwargs)\n    m.add_state(st.SCHEDULING, **state_kwargs)\n    m.add_state(st.SUCCESS, terminal=True, **state_kwargs)\n    m.add_state(st.SUSPENDED, terminal=True, **state_kwargs)\n    m.add_state(st.WAITING, **state_kwargs)\n    m.add_state(st.FAILURE, terminal=True, **state_kwargs)\n    m.default_start_state = UNDEFINED\n\n    m.add_transition(GAME_OVER, st.REVERTED, REVERTED)\n    m.add_transition(GAME_OVER, st.SUCCESS, SUCCESS)\n    m.add_transition(GAME_OVER, st.SUSPENDED, SUSPENDED)\n    m.add_transition(GAME_OVER, st.FAILURE, FAILED)\n    m.add_transition(UNDEFINED, st.RESUMING, START)\n    m.add_transition(st.ANALYZING, GAME_OVER, FINISH)\n    m.add_transition(st.ANALYZING, st.SCHEDULING, SCHEDULE)\n    m.add_transition(st.ANALYZING, st.WAITING, WAIT)\n    m.add_transition(st.RESUMING, st.SCHEDULING, SCHEDULE)\n    m.add_transition(st.SCHEDULING, st.WAITING, WAIT)\n    m.add_transition(st.WAITING, st.ANALYZING, ANALYZE)\n\n    m.add_reaction(GAME_OVER, FINISH, game_over)\n    m.add_reaction(st.ANALYZING, ANALYZE, analyze)\n    m.add_reaction(st.RESUMING, START, resume)\n    m.add_reaction(st.SCHEDULING, SCHEDULE, schedule)\n    m.add_reaction(st.WAITING, WAIT, wait)\n\n    m.freeze()\n    return (m, memory)",
      "asOf": "2026-11-20"
    },
    "F231": {
      "label": "Project source file, automaton",
      "display": "taskflow/engines/action_engine/builder.py",
      "asOf": "2026-11-20"
    },
    "F232": {
      "label": "Project full_name, automaton",
      "display": "openstack/taskflow",
      "asOf": "2026-11-20"
    },
    "F233": {
      "label": "Project stargazers_count, automaton",
      "display": "376",
      "asOf": "2026-11-20"
    },
    "F234": {
      "label": "Library name, sismic",
      "display": "Sismic",
      "asOf": "2026-11-20"
    },
    "F235": {
      "label": "Monthly downloads, sismic",
      "display": "6.6K",
      "asOf": "2026-11-20"
    },
    "F236": {
      "label": "License, sismic",
      "display": "LGPL-3.0",
      "asOf": "2026-11-20"
    },
    "F237": {
      "label": "Package release, sismic",
      "display": "1.6.14",
      "asOf": "2026-11-20"
    },
    "F238": {
      "label": "Package release date, sismic",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F239": {
      "label": "Install, sismic",
      "display": "pip install sismic",
      "asOf": "2026-11-20"
    },
    "F240": {
      "label": "Quickstart, sismic",
      "display": "from sismic.io import import_from_yaml\nfrom sismic.interpreter import Interpreter\n\nchart = import_from_yaml('''statechart:\n  name: Example\n  root state:\n    name: root\n    initial: idle\n    states:\n      - name: idle\n''')\ninterpreter = Interpreter(chart)\ninterpreter.execute()\n",
      "asOf": "2026-11-20"
    },
    "F241": {
      "label": "Official description, sismic",
      "display": "Interprets and checks statechart models.",
      "asOf": "2026-11-20"
    },
    "F242": {
      "label": "Quickstart source file, sismic",
      "display": "api/io and api/interpreter (API recipe)",
      "asOf": "2026-11-20"
    },
    "F243": {
      "label": "Repository stars, sismic",
      "display": "172",
      "asOf": "2026-11-20"
    },
    "F244": {
      "label": "Django model integration, sismic",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F245": {
      "label": "Hierarchical states, sismic",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F246": {
      "label": "Awaits coroutine callbacks, sismic",
      "display": "Undocumented",
      "asOf": "2026-11-20"
    },
    "F247": {
      "label": "Execution, sismic",
      "display": "Stepwise statechart interpreter with background execution option",
      "asOf": "2026-11-20"
    },
    "F248": {
      "label": "Visualization, sismic",
      "display": "PlantUML export with external graphical tooling",
      "asOf": "2026-11-20"
    }
  },
  "dataCheckedAt": "2026-11-20",
  "agent": {
    "exaCall": {
      "endpoint": "/search",
      "body": {
        "query": "Best Python state machine libraries transitions python-statemachine Automat automaton examples",
        "numResults": 5
      },
      "docsUrl": "https://exa.ai/docs/reference/search"
    },
    "calls": []
  }
}
