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.5.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.5.0-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file python-state-manager-0.5.0.tar.gz.

File metadata

  • Download URL: python-state-manager-0.5.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.5.0.tar.gz
Algorithm Hash digest
SHA256 bdce09e1ecb185abe8c118436b1ca9ab47c2ab93016d56a6f76c44fa7d4bf2b8
MD5 a6519da2c2a4c86fa6dc6654f1c49546
BLAKE2b-256 6732fffc46f135a1993fe8fecdb7cb36bd86fdf98dea14317c3fe3c159eb6923

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_state_manager-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 13ae2f9c97eded907358fd5794a45f5493ee02eba752698fd2c2cdad95b89ef7
MD5 094217428b9a4885182d93df4470231e
BLAKE2b-256 1f19e6dd2d989d9468e442c068d8d50ae4e43513cf24e6c1a8027317331acbaa

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