Friendly state machines for python.
Project description
Friendly state machines for python.
Examples
Squirrel:
>>> from automaton import machines
>>> f = machines.FiniteMachine("sits")
>>> f.add_state("sits")
>>> f.add_state("barks")
>>> f.add_state("wags tail")
>>> f.add_transition("sits", "barks", "squirrel!")
>>> f.add_transition("barks", "wags tail", "gets petted")
>>> f.add_transition("wags tail", "sits", "gets petted")
>>> f.add_transition("wags tail", "barks", "squirrel!")
>>> print(f.pformat())
+-----------+-------------+-----------+----------+---------+
| Start | Event | End | On Enter | On Exit |
+-----------+-------------+-----------+----------+---------+
| barks | gets petted | wags tail | . | . |
| sits[^] | squirrel! | barks | . | . |
| wags tail | gets petted | sits | . | . |
| wags tail | squirrel! | barks | . | . |
+-----------+-------------+-----------+----------+---------+
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
automaton-0.1.tar.gz
(14.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file automaton-0.1.tar.gz.
File metadata
- Download URL: automaton-0.1.tar.gz
- Upload date:
- Size: 14.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65b4e3cd6b8bf38edfc68cac761de7e0628359e73bf843a6bdcb1dcdd5e17a84
|
|
| MD5 |
0d72b4e315228309d9b745ecea781170
|
|
| BLAKE2b-256 |
9400d796043dc95e396e610e0586b98a55ba16fdcb6edfaf40e26e3dc3f8d935
|
File details
Details for the file automaton-0.1-py2.py3-none-any.whl.
File metadata
- Download URL: automaton-0.1-py2.py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bcad65d28253fe912a0a40fffdec439f9358fcdb602d417042dcb1f7b0eb0337
|
|
| MD5 |
89f83147e794a6a3c1a6e27de666a147
|
|
| BLAKE2b-256 |
7479ac7d8ee9c1ba0f0a27afb9318b1a719e89d1a4e8dd377a5e03a34db55ade
|