Skip to main content

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

python-state-manager-0.3.0.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_state_manager-0.3.0-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

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

Hashes for python-state-manager-0.3.0.tar.gz
Algorithm Hash digest
SHA256 5e23db852642426566ba8651da1c10776bed27c0c5479e78131eaa481e029281
MD5 1266ae839fe9ac2f368f36d7ad6f0e53
BLAKE2b-256 87abde6e6110464b52daeef3749075bdd9f4cc0905161eeb11229df3f785ab29

See more details on using hashes here.

File details

Details for the file python_state_manager-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for python_state_manager-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2ebfbc7e00174ebcecd88fae12da7e6ade33e7e3ea7cfd1535db68291da6c390
MD5 0e60356299213ad4476d129d8930514d
BLAKE2b-256 d25b1227e3f35d104d9daffda8753708dfbeaaa3f9115705fe540df6d2a10ea7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page