flâneur

pytransitions/transitions: A lightweight, object-oriented finite state machine implementation in Python with many extensions ·

github.com · saved by 1 readers

A lightweight, object-oriented state machine implementation in Python with many extensions. Compatible with Python 2.7+ and 3.0+. ... or clone the repo from GitHub and then: They say a good example is worth 100 pages of API documentation, a million directives, or a thousand words. Well, "they" probably lie... but here's an example anyway: There, now you've baked a state machine into NarcolepticSuperhero. Let's take him/her/it out for a spin... While we cannot read the mind of the actual batman, we surely can visualize the current state of our NarcolepticSuperhero. Have a look at the Diagrams extensions if you want to know how. A state machine is a model of behavior composed of a finite number of states and transitions between those states. Within each state and transition some action can be performed. A state machine needs to start at some initial state. When using transitions, a state machine may consist of multiple objects where some (machines) contain definitions for the manipulatio

saved by