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
Development and Release process
A release is automatically published when a new version is bumped using make bump
.
See .github/workflows/test_release.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-0.8.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2222e033c88626e33d52346b27790beede9dea7994146e9d5a575f0dc8b001a9 |
|
MD5 | 3a53bd6780b56665b85b64c5411426b6 |
|
BLAKE2b-256 | fd588a5c2fb1cf0b85f5ce051abc1d1d5d7dfe494619bb96ac0f64a396f577cf |
Close
Hashes for py_executable_checklist-0.8.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33372b6282dd0a30eb25e548aa450a3bd511ec5740236491e117f476ae0aedbe |
|
MD5 | 44d54634162f51124a12e0512ee228eb |
|
BLAKE2b-256 | 3024c88607938d8add9566e2140a4e13a619186b5d4f5b6ae409181df7ab3ed1 |