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.workflow 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 execute(self):
logging.info(f"Hello {self.username}")
# output
return {"greetings": f"Hello {self.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
Release process
A release is automatically published when a new version is bumped using make bump
. See .github/workflows/build.yml
for more details. Once the release is published, .github/workflows/publish.yml
will automatically publish it to PyPI.
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-1.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8273a19d00f71fc81856ea49088540c54164db1d52d93b3829212dace95f955d |
|
MD5 | e612747e977ee88b6283820314cd2c4f |
|
BLAKE2b-256 | cc905cd6850a95c067c701b25f4f40e23fe82cd122cf478278e757da141b9caa |
Close
Hashes for py_executable_checklist-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5012a5cdd6c813cbe68b07125cbd13d0f85c701bce183846b33f04c06c6e8f01 |
|
MD5 | 2c6ccf5e7428ee0cf62c4d5fdc4c7af9 |
|
BLAKE2b-256 | 2cda5e00ccf6a6371ae10bf38fcf55f8af3145ae7d4e7d4d9a629ee0dfaab59c |