Helper classes to develop executable workflow scripts
Project description
Executable Workflow
Documentation: https://namuan.github.io/py-executable-checklist
Source Code: https://github.com/namuan/py-executable-checklist
PyPI: https://pypi.org/project/py-executable-checklist/
Helper classes to develop executable workflow scripts
Installation
pip install py-executable-checklist
Example Usage
import logging
from argparse import ArgumentParser, RawDescriptionHelpFormatter
from py_executable_checklist import run_workflow, WorkflowBase
# Common functions across steps
# Workflow steps
class DoSomething(WorkflowBase):
"""
Go to this page
Copy the command
Run the command
Copy the output and paste it into the email
"""
username: str
def run(self, context):
logging.info(f"Hello {self.username}")
# output
context["greetings"] = f"Hello {context['username']}"
# Workflow definition
def workflow():
return [
DoSomething,
]
# Boilerplate
def parse_args():
parser = ArgumentParser(
description=__doc__, formatter_class=RawDescriptionHelpFormatter
)
parser.add_argument("-u", "--username", type=str, required=True, help="User name")
parser.add_argument(
"-v",
"--verbose",
action="store_true",
default=False,
dest="verbose",
help="Display context variables at each step",
)
return parser.parse_args()
def main(args):
context = args.__dict__
run_workflow(context, workflow())
if __name__ == "__main__":
args = parse_args()
main(args)
Development
- Clone this repository
- Requirements:
- Poetry
- Python 3.7+
- Create a virtual environment and install the dependencies
poetry install
- Activate the virtual environment
poetry shell
Validating build
make build
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
Built Distribution
Close
Hashes for py-executable-checklist-0.5.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42491e26d2a23711972a1840e18cbf2a6c11d389d6adcb794c33a42ae91cd29f |
|
MD5 | 4dd9f8c9852e664685000d6d164ff103 |
|
BLAKE2b-256 | cd54c91072e67b01355190f60ac0577e98ac19ee2ba23e48e68ad4bc778fc1f5 |
Close
Hashes for py_executable_checklist-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff982dbdba366a74501e923340e9cb0406bd16a40bc37e2362a296ca6f954daf |
|
MD5 | 72b71f724935d984b4aa91edf3ca51f6 |
|
BLAKE2b-256 | f2a1bb490b313c055339ce3ad7eb5ef15c6b1bb82587f6b98e87c258146042e6 |