Python engine for Amazon States Language (ASL) specification that supports parsing and serialization of definitions, and a local interpreter to run them.
Project description
pyaslengine
Python engine for Amazon States Language (ASL) specification that supports parsing and serialization of definitions, and a local interpreter to run them.
Installation
Development
git clone https://github.com/ghukill/pyaslengine
make install
Use in Existing Project
pip install pyaslengine
Examples
Load simple StateMachine definition from local JSON file
import logging
from pyaslengine.data import WorkflowInput
from pyaslengine.workflows import StateMachine
# turn on debug logging
logging.getLogger('pyaslengine').setLevel(logging.DEBUG)
# initialize a state machine by reading a local JSON file
sm = StateMachine.load_definition_file("tests/fixtures/state_machines/do_nothing.json")
# run the state machine by passing an initial payload
results = sm.run(
workflow_input=WorkflowInput(data={"msg": "in a bottle"})
)
# Out[6]: WorkflowOutput(data={'msg': 'in a bottle'}, context=None)
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
pyaslengine-0.5.0.tar.gz
(16.0 kB
view hashes)
Built Distribution
Close
Hashes for pyaslengine-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37896f9f27960cd9ad1996e0063c0fc2f9eaf9f9762aad6aa9295f6cc54b8452 |
|
MD5 | d84b46122cd03c3a5de128a7dddef9ea |
|
BLAKE2b-256 | 32277c46f3869ad674c9447f743d3b6d0e0fe9e76cc2a2a39def9431a87b86db |