Welcome to aws_stepfunction Documentation
Why this Library?
aws_stepfunction provides AWS StepFunction developer a “smooth”, “interruption free”, “enjoyable” development experience.
If your mind set matches most of the following, aws_stepfunction is the right tool for you:
I love the AWS StepFunction Visual Editor
I love Python
I don’t want to spent much time learning the Amazon State Machine JSON DSL (Domain Specific Language)
I can’t memorize the code syntax
I respect code readability and maintainability
Talk is cheap, show me the code
The following code snippet is an equivalent of the below Workflow in the Visual Editor
import aws_stepfunction as sfn
from boto_session_manager import BotoSesManager
# Declare a workflow object
workflow = sfn.Workflow(comment="The power of aws_stepfunction library!")
# Define some tasks and states
task_invoke_lambda = sfn.actions.lambda_invoke(func_name="stepfunction_quick_start")
succeed = sfn.Succeed()
fail = sfn.Fail()
# Orchestrate the Workflow
(
workflow.start_from(task_invoke_lambda)
.choice([
( # define condition
sfn.not_(sfn.Var("$.body").string_equals("failed!"))
.next_then(succeed)
),
( # define condition
sfn.Var("$.body").string_equals("failed!")
.next_then(fail)
),
])
)
# Declare an instance of State Machine
state_machine = sfn.StateMachine(
name="stepfunction_quick_start",
workflow=workflow,
role_arn="arn:aws:iam::111122223333:role/my_lambda_role",
)
# Deploy state machine
bsm = BotoSesManager(profile_name="my_aws_profile", region_name="us-east-1")
state_machine.deploy(bsm)
# Execute state machine with custom payload
state_machine.execute(bsm, payload={"name": "alice"})
# delete step function
state_machine.delete(bsm)
You mentioned “Smooth Development Experiment”?
I guess “a picture is worth a thousand words”:
Install
aws_stepfunction is released on PyPI, so all you need is:
$ pip install aws_stepfunction
To upgrade to latest version:
$ pip install --upgrade aws_stepfunction
Metadata
Release files for aws-stepfunction 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aws_stepfunction-0.0.5.tar.gz | 41.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aws_stepfunction-0.0.5-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 88.2 kB
Release files / aws_stepfunction-0.0.5.tar.gz
| Download URL | aws_stepfunction-0.0.5.tar.gz |
|---|---|
| Size | 41.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d544b12d89595f613c53a15d0381f4461cc465bc30191ba3d7cbab1798700509
|
|
BLAKE2b-256 checksum How to use checksums |
6c10a958b4ddf893271a21711ffdf8a71ff99e85973ce912d38adc17136780a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.11
|
Release files / aws_stepfunction-0.0.5-py2.py3-none-any.whl
| Download URL | aws_stepfunction-0.0.5-py2.py3-none-any.whl |
|---|---|
| Size | 46.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
a0fc8e34fc567dca74b286b773af05a4c0808c4b5d830335e0ba247a2461196d
|
|
BLAKE2b-256 checksum How to use checksums |
299acf650e58e86467453484dfb749bbf2a2631a5ddc920176ee3894dd7d62c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.11
|