{
"info": {
"author": "Adam Gilman",
"author_email": "oss+stairstep@adamgilman.com",
"bugtrack_url": null,
"classifiers": [
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3"
],
"description": "# stairstep\n\nStairStep is a Pythonic API for designing [AWS Step Functions](https://aws.amazon.com/step-functions/) using [Amazon's State Language](https://states-language.net/spec.html)\n\n\n\nInstead of hand crafting JSON, StairStep allows you define step functions using Python code which allows you to easily import information from outside sources and dynamically create step functions on the fly. \n\n# Development Progress / Coverage\n| Lanuage Feature | Type | Progress | \n|---|---|---|\n| State | Pass | \u2705 |\n| State | Task | \u2705 |\n| State | Succeed | \u2705 |\n| State | Fail | \u2705 |\n| State | Choice | \u2705 |\n| Field | Common Validations | \u2705 |\n| State | Wait | Next \ud83d\udee3 |\n| State | Parallel | Next \ud83d\udee3 |\n\n\n# Examples\n* [Hello World](#helloworld)\n* [Complex Choice State](#choicestate)\n\n## Hello World \nUsing the example from the [Amazon's State Language](https://states-language.net/spec.html#example) page\n\n```\n{\n \"Comment\": \"A simple minimal example of the States language\",\n \"StartAt\": \"Hello World\",\n \"States\": {\n \"Hello World\": { \n \"Type\": \"Task\",\n \"Resource\": \"arn:aws:lambda:us-east-1:123456789012:function:HelloWorld\",\n \"End\": true\n }\n }\n}\n```\n\nWe can easily craft that in StairStep as follows\n\n```\n# Create a parent StairStep object\nss = StairStep(comment=\"A simple minimal example of the States language\", startAt=\"Hello World\")\n\n# Create the HelloWorld step\nStateTask(name=\"Hello World\", resource=\"arn:aws:lambda:us-east-1:123456789012:function:HelloWorld\", end=True)\n\n# Add the step into the StairStep object\nss.addState(hello)\n\n# Create the Amazon State Language Export\nss.json()\n\n{ \n \"Comment\":\"A simple minimal example of the States language\",\n \"StartAt\":\"Hello World\",\n \"States\":{ \n \"Hello World\":{ \n \"Type\":\"Task\",\n \"Resource\":\"arn:aws:lambda:us-east-1:123456789012:function:HelloWorld\",\n \"End\":true\n }\n }\n}\n```\n\n\n## Complex Choice State\n\n```\nss = StairStep(\n comment = \"Example Choice State\",\n startAt = \"ChoiceStateX\"\n)\n# Create a ChoiceRule, which is composed of choice expression(s)\n# This checks to see if the variable $.type is not \"Private\"\ntypeNotPrivate = ChoiceRule(operator=\"Not\", snext=\"Public\", conditions=\n ChoiceExpression(operator=\"StringEquals\", variable=\"$.type\", value=\"Private\")\n)\n\n# This checks to see if the value of $.value is >=20 or <30\nvalueInTwenties = ChoiceRule(operator=\"And\", snext=\"ValueInTwenties\", conditions=\n [\n ChoiceExpression(operator=\"NumericGreaterThanEquals\", variable=\"$.value\", value=20),\n ChoiceExpression(operator=\"NumericLessThan\", variable=\"$.value\", value=30)\n ]\n)\nstate = StateChoice(name=\"ChoiceStateX\", choices=[typeNotPrivate,valueInTwenties],default=\"DefaultState\")\n\ndefault = StatePass(name=\"DefaultState\", end=True)\nin_twenties = StatePass(name=\"ValueInTwenties\", end=True)\npublic = StatePass(name=\"Public\", end=True)\n\nss.addState(state)\nss.addState(in_twenties)\nss.addState(public)\nss.addState(default)\nss.json()\n```\n\n```\n{\n\t\"Comment\": \"Example Choice State\",\n\t\"StartAt\": \"ChoiceStateX\",\n\t\"States\": {\n\t\t\"ChoiceStateX\": {\n\t\t\t\"Type\": \"Choice\",\n\t\t\t\"Default\": \"DefaultState\",\n\t\t\t\"Choices\": [{\n\t\t\t\t\"Next\": \"Public\",\n\t\t\t\t\"Not\": {\n\t\t\t\t\t\"Variable\": \"$.type\",\n\t\t\t\t\t\"StringEquals\": \"Private\"\n\t\t\t\t}\n\t\t\t}, {\n\t\t\t\t\"Next\": \"ValueInTwenties\",\n\t\t\t\t\"And\": [{\n\t\t\t\t\t\"Variable\": \"$.value\",\n\t\t\t\t\t\"NumericGreaterThanEquals\": 20\n\t\t\t\t}, {\n\t\t\t\t\t\"Variable\": \"$.value\",\n\t\t\t\t\t\"NumericLessThan\": 30\n\t\t\t\t}]\n\t\t\t}]\n\t\t},\n\t\t\"ValueInTwenties\": {\n\t\t\t\"Type\": \"Pass\",\n\t\t\t\"End\": true\n\t\t},\n\t\t\"Public\": {\n\t\t\t\"Type\": \"Pass\",\n\t\t\t\"End\": true\n\t\t},\n\t\t\"DefaultState\": {\n\t\t\t\"Type\": \"Pass\",\n\t\t\t\"End\": true\n\t\t}\n\t}\n}\n```\n\n\n\n",
"description_content_type": "text/markdown",
"docs_url": null,
"download_url": "",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/adamgilman/stairstep",
"keywords": "",
"license": "",
"maintainer": "",
"maintainer_email": "",
"name": "stairstep",
"package_url": "https://pypi.org/project/stairstep/",
"platform": "",
"project_url": "https://pypi.org/project/stairstep/",
"project_urls": {
"Homepage": "https://github.com/adamgilman/stairstep"
},
"release_url": "https://pypi.org/project/stairstep/0.1/",
"requires_dist": null,
"requires_python": "",
"summary": "A Pythonic API for Amazon's States Language for defining AWS Step Functions",
"version": "0.1"
},
"last_serial": 4143053,
"releases": {
"0.1": [
{
"comment_text": "",
"digests": {
"md5": "a83b350ceeb5b68411c620390736df18",
"sha256": "509171dd1e3d81ed054915964b240e05e7b3a165aa8f5416f7c82c1a5f1e5830"
},
"downloads": -1,
"filename": "stairstep-0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a83b350ceeb5b68411c620390736df18",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 10447,
"upload_time": "2018-08-07T07:08:14",
"url": "https://files.pythonhosted.org/packages/b9/e9/f63f22d8abcf20200c5b88f32ae0f9485302c802ab709fa947e87cc0d23c/stairstep-0.1-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "850229f7860d0e9dd33dade75b885ffa",
"sha256": "76657982fe09b9521e95860b6debfa67472eaf002c97210f32d4bffcca0aceba"
},
"downloads": -1,
"filename": "stairstep-0.1.tar.gz",
"has_sig": false,
"md5_digest": "850229f7860d0e9dd33dade75b885ffa",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8451,
"upload_time": "2018-08-07T07:08:16",
"url": "https://files.pythonhosted.org/packages/51/df/f6790b7ebfa53f63e464297234ee9be9e75204f8a6be3749a8b42af3c934/stairstep-0.1.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "a83b350ceeb5b68411c620390736df18",
"sha256": "509171dd1e3d81ed054915964b240e05e7b3a165aa8f5416f7c82c1a5f1e5830"
},
"downloads": -1,
"filename": "stairstep-0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a83b350ceeb5b68411c620390736df18",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 10447,
"upload_time": "2018-08-07T07:08:14",
"url": "https://files.pythonhosted.org/packages/b9/e9/f63f22d8abcf20200c5b88f32ae0f9485302c802ab709fa947e87cc0d23c/stairstep-0.1-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "850229f7860d0e9dd33dade75b885ffa",
"sha256": "76657982fe09b9521e95860b6debfa67472eaf002c97210f32d4bffcca0aceba"
},
"downloads": -1,
"filename": "stairstep-0.1.tar.gz",
"has_sig": false,
"md5_digest": "850229f7860d0e9dd33dade75b885ffa",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8451,
"upload_time": "2018-08-07T07:08:16",
"url": "https://files.pythonhosted.org/packages/51/df/f6790b7ebfa53f63e464297234ee9be9e75204f8a6be3749a8b42af3c934/stairstep-0.1.tar.gz"
}
]
}