Skip to main content

No project description provided

Project description

PyAutomaton

Description

PyAutomaton is a simple library implementing Mealy state machines, thus meaning that the events produced by the automaton are determined by the tuple (state, event) and not only on the current state, as happens with Moore state machines.

Usage

PyAutomaton offers the possibility of declare State Machines by using a fluent descriptive style. For example, given the state machine in the following figure: turntile-picture

the code implementing this state machine is:

fsm = Automaton().start_from("locked").go_in("locked").when("push") \
                    .coming_from("locked").go_in("unlocked").when("coin") \
                    .coming_from("unlocked").go_in("unlocked").when("coin") \
                    .coming_from("unlocked").go_in("locked").when("push")

And the machine can run by invoking the fsm object as follow:

fsm('push')

each invocation triggers a state transition and returns the corresponding action, if any.

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

pyautomaton-0.2.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

pyautomaton-0.2.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file pyautomaton-0.2.0.tar.gz.

File metadata

  • Download URL: pyautomaton-0.2.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.8.13 Linux/5.15.0-47-generic

File hashes

Hashes for pyautomaton-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ad539c19542d8c43c35aa8dbcb5d72e2e104c8cb1094ef3d335e86af3e816872
MD5 a9a82e3fcbcff0a7de1dd0ced10b597d
BLAKE2b-256 58da9e2526424c9a074b2cafa76e39ee21bf9c079c57b0410224fc4011cf42e3

See more details on using hashes here.

File details

Details for the file pyautomaton-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pyautomaton-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.8.13 Linux/5.15.0-47-generic

File hashes

Hashes for pyautomaton-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f0eb6ff376da60ac98e57399f8f9adff10db8ef7986766556e652dc48bc53479
MD5 759911778a7ed245ef39221677f76858
BLAKE2b-256 c5852ff4f708927bfc9e57c2f452d0604220a8fca3637ac3a08eaba1987223ab

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