Skip to main content

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


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.10.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

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

steppygraph-0.1.10-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file steppygraph-0.1.10.tar.gz.

File metadata

  • Download URL: steppygraph-0.1.10.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.3

File hashes

Hashes for steppygraph-0.1.10.tar.gz
Algorithm Hash digest
SHA256 b00761d1e867134db20079f5833f64e33e4d5ade04a3ed00d1e60249652995aa
MD5 f3fa10de74577e716894b16e9ef00e5f
BLAKE2b-256 f75c9b33a881c5259f482ae2e56ed84a78ce0ea863898330b967d895666f9ecf

See more details on using hashes here.

File details

Details for the file steppygraph-0.1.10-py3-none-any.whl.

File metadata

  • Download URL: steppygraph-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.3

File hashes

Hashes for steppygraph-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 8f9723ff1f4251294f0b6482d659d7c12c2ee4ea6d6b50cb55ff5cca05740f4f
MD5 b87d83aac917444b0355a72e527c991e
BLAKE2b-256 a8073cf7aefe543ccffcbba22fa5b370135864a2c609d7a8bb20eaa0b5485a0e

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