Reference:
Stateflow in python
I want to build my own stateflow python library from strach and along with learn the concept
What are applications of state machine and why and when use it
Basic concepts
State Representation
Implementation of the state machine
Table-Driven State Machine
Advance
Data Structure Options for States and Transitions