A simple state machine to handle states of programs.
Project description
python-state-manager
A simple state machine to handle states of programs.
Usage
Example:
from python_state_manager import StateManager
stateids = ["state1", "state2", "state3"]
statevalues = [1, 2, 3]
metadatas = [{"a": 1}, {"b": 2}, {"c": 3}]
sm = StateManager(stateids, statevalues, metadatas, currentstateid="state1")
print(sm.get_current_state().stateid)
# output: state1
sm.complete_state()
print(sm.is_finished())
# output: False
print(sm.get_current_state().stateid)
# state2
Enjoy!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 python-state-manager-0.3.0.tar.gz.
File metadata
- Download URL: python-state-manager-0.3.0.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e23db852642426566ba8651da1c10776bed27c0c5479e78131eaa481e029281
|
|
| MD5 |
1266ae839fe9ac2f368f36d7ad6f0e53
|
|
| BLAKE2b-256 |
87abde6e6110464b52daeef3749075bdd9f4cc0905161eeb11229df3f785ab29
|
File details
Details for the file python_state_manager-0.3.0-py3-none-any.whl.
File metadata
- Download URL: python_state_manager-0.3.0-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ebfbc7e00174ebcecd88fae12da7e6ade33e7e3ea7cfd1535db68291da6c390
|
|
| MD5 |
0e60356299213ad4476d129d8930514d
|
|
| BLAKE2b-256 |
d25b1227e3f35d104d9daffda8753708dfbeaaa3f9115705fe540df6d2a10ea7
|