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.4.0.tar.gz (15.1 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.4.0-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: python-state-manager-0.4.0.tar.gz
  • Upload date:
  • Size: 15.1 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.4.0.tar.gz
Algorithm Hash digest
SHA256 0d102c1b4114eafd221e723ffbd96797515e94cbef011ede100deb6fc2553ba9
MD5 5a487c65924cbbb6e65c3e34214c81f6
BLAKE2b-256 389d7bdda4b7d285a3146833e093059fc6eb5f3e2d73a542a8d261545e7a18ec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_state_manager-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0ba5f3ac90244cec403bcc35d50baea5ef348e9401b96f4d9ae1e9ebc6864b0c
MD5 56f5dc206d5e3a51832825bf48081088
BLAKE2b-256 fb6f22c087b28dd10d7fa8486701c2b4227147545181ee5bf5a6f7763e972b92

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