Miros: a hierarchical state machine module in Python
A Lua implementation is also available. See Lua Projects.
Miros for Python can be found here.
Miros is a module that implements a Hierarchical State Machine (HSM) class (i.e. one that implements behavioral inheritance).
It is based on the excellent work of Miro Samek (hence the module name "miros"). This implementation closely follows an older C/C++ implementation published in the 8/00 edition of "Embedded Systems" magazine by Miro Samek and Paul Montgomery under the title "State Oriented Programming". The article and code can be found here: http://www.embedded.com/2000/0008.
A wealth of more current information can be found at Miro's well kept site: http://www.state-machine.com/. As far as I know this is the first implementation of Samek's HSM in Python. It was tested with Python 2.5.
It is licensed under the same terms as Python itself.