Skip to main content

Python object model for the Amazon States Language

Project description


Python Object Model for Amazon State Language

This package provides an object model for creating Step Functions


Simple Hello World Example

import py_asl

def hello_world():
    state_machine = py_asl.StateMachine(Comment="A simple minimal example of the States language", StartAt="Hello World")
    state = py_asl.TaskState("Hello World", Resource="arn:aws:lambda:us-east-1:123456789012:function:HelloWorld", End=True)
    hw = state_machine.dumps(indent=2)
    return hw


Example of creating a Parallel Task

import py_asl

def parallel_states():
    state1 = py_asl.TaskState("Hello World", Resource="arn:aws:lambda:us-east-1:123456789012:function:HelloWorld", End=True)
    state2 = py_asl.TaskState("Goodbye World", Resource="arn:aws:lambda:us-east-1:123456789012:function:GoodbyeWorld", End=True)
    parallel_state = state_model.ParallelState("Hello Goodbye", Branches=[state1, state2], Next="Foo")
    ps = parallel_state.dumps(indent=2)
    return ps


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for py-asl, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size py_asl-0.1.1-py2.py3-none-any.whl (3.6 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size py_asl-0.1.1.tar.gz (3.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page