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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

python_state_manager-0.1.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for python_state_manager-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a1f9df1c78b9e337f7f9908558275a874ed069241ff4f9420fcd2e917097735a
MD5 9ed84f52b46532b5e6ec7b6f3c1e69e4
BLAKE2b-256 5c3f8c89b81b8f455d58fd65ae66a8007d51636f9dba262cdf13cbf21123b4c6

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