A Python DSL for AWS Step Functions
Project description
Steppy Graph - An alpha-quality DSL for Step Functions
Example Usage:
s = StateMachine()
res = Resource(name="foores", type=ResourceType.LAMBDA)
s.next(Task(resource=res, name="Kermit", comment='Foo'))
s.next(Wait(name="Waiting time", comment='Foo', seconds=2))
s.next(Pass(name="Pass the buck"))
s.next(Task(resource=res, name="Miss Piggy", comment='Foo'))
s.build()
print(s.to_json())
should produce output similar to:
{
"StartAt": "Kermit",
"States": {
"Kermit": {
"Comment": "Foo",
"End": false,
"Next": "Waiting time",
"Resource": "arn:aws:lambda:::function:foores",
"TimeoutSeconds": 600,
"Type": "Task"
},
"Miss Piggy": {
"Comment": "Foo",
"End": true,
"Resource": "arn:aws:lambda:::function:foores",
"TimeoutSeconds": 600,
"Type": "Task"
},
"Pass the buck": {
"Comment": "",
"End": false,
"Next": "Miss Piggy",
"Type": "Pass"
},
"Waiting time": {
"Comment": "Foo",
"End": false,
"Next": "Pass the buck",
"Seconds": 2,
"Type": "Wait"
}
},
"TimeoutSeconds": 600
}
Note - states added via the next() method in StateMachine are always "autoconnected", that is they have a boolean flag set which will automatically wire them up to the next state in the graph. Use add_state for states that you want to add without any auto-connection of the Next attribute.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
steppygraph-0.1.3.tar.gz
(5.2 kB
view hashes)
Built Distribution
Close
Hashes for steppygraph-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3cbe059a35a8ad31a3fcbf1e3c43a338770cf519e8a86e1363a3c7c74f4de31 |
|
MD5 | 20a8fed7b8a904700626b8eb911e7efd |
|
BLAKE2b-256 | 6d89d26338e92b4855f8c57d276961691376801b7594fef5356954edc369d2f0 |