Skip to main content

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!

Release files for python-state-manager 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-state-manager 0.5.0
File Size Uploaded
python-state-manager-0.5.0.tar.gz 15.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-state-manager 0.5.0
File Interpreter ABI Platform
python_state_manager-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 30.8 kB

Release files / python-state-manager-0.5.0.tar.gz

Download URL python-state-manager-0.5.0.tar.gz
Size 15.0 kB
Tags Source
SHA-256 checksum
How to use checksums
bdce09e1ecb185abe8c118436b1ca9ab47c2ab93016d56a6f76c44fa7d4bf2b8
BLAKE2b-256 checksum
How to use checksums
6732fffc46f135a1993fe8fecdb7cb36bd86fdf98dea14317c3fe3c159eb6923
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.5

Release files / python_state_manager-0.5.0-py3-none-any.whl

Download URL python_state_manager-0.5.0-py3-none-any.whl
Size 15.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
13ae2f9c97eded907358fd5794a45f5493ee02eba752698fd2c2cdad95b89ef7
BLAKE2b-256 checksum
How to use checksums
1f19e6dd2d989d9468e442c068d8d50ae4e43513cf24e6c1a8027317331acbaa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.5

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page