Skip to main content

Welcome to dotflow

GitHub Org's stars GitHub last commit PyPI PyPI - Python Version PyPI - Downloads

This is a very simple library that is still in the early stages of development. The main goal of this tool is to create a simple and secure workflow for executing any type of task. The library's API design was made to make it easy to add tasks and control their execution. To keep it simple, just instantiate the DotFlow class, use the add method, and the start method to begin execution.

Start with the basics here.

Getting Help

We use GitHub issues for tracking bugs and feature requests and have limited bandwidth to address them. If you need anything, I ask you to please follow our templates for opening issues or discussions.

Getting Started

Install

To install Dotflow, run the following command from the command line:

With Pip

pip install dotflow

With Poetry

poetry add dotflow

First Steps

The simplest file could look like this:

from dotflow import DotFlow, action

def my_callback(*args, **kwargs):
    print(args, kwargs)

@action(retry=5)
def my_task():
    print("task")

workflow = DotFlow()
workflow.task.add(step=my_task, callback=my_callback)
workflow.start()

1 - Import

Start with the basics, which is importing the necessary classes and methods. (DotFlow, action)

from dotflow import DotFlow, action

2 - Callback function

Create a my_callback function to receive execution information of a task. It is not necessary to include this function, as you will still have a report at the end of the execution in the instantiated object of the DotFlow class. This my_callback function is only needed if you need to do something after the execution of the task, for example: sending a message to someone, making a phone call, or sending a letter.

def my_callback(*args, **kwargs):
    print(args, kwargs)

3 - Task function

Now, create the function responsible for executing your task. It's very simple; just use the action decorator above the function, and that's it—you've created a task. If necessary, you can also add the parameter called retry to set the maximum number of execution attempts if the function fails.

@action(retry=5)
def my_task():
    print("task")

4 - DotFlow Class

Instantiate the DotFlow class in a workflow variable to be used in the following steps. More details.

workflow = DotFlow()

5 - Add Task

Now, simply add the my_task and my_callback functions you created earlier to the workflow using the code below. This process is necessary to define which tasks will be executed and the order in which they will run. The execution order follows the sequence in which they were added to the workflow.

workflow.task.add(step=my_task, callback=my_callback)

6 - Start

Finally, just execute the workflow with the following code snippet.

workflow.start()

Commit Style

  • ⚙️ FEATURE
  • 📝 PEP8
  • 📌 ISSUE
  • 🪲 BUG
  • 📘 DOCS
  • 📦 PyPI
  • ❤️️ TEST
  • ⬆️ CI/CD
  • ⚠️ SECURITY

License

GitHub License

This project is licensed under the terms of the MIT License.

Metadata

Release files for dotflow 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dotflow 0.6.0
File Size Uploaded Provenance Actions
dotflow-0.6.0.tar.gz 9.8 kB Without provenance Details for dotflow-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dotflow 0.6.0
File Interpreter ABI Platform Actions
dotflow-0.6.0-py3-none-any.whl Python 3 none any Details for dotflow-0.6.0-py3-none-any.whl

Total release size: 24.1 kB

Release files / dotflow-0.6.0.tar.gz

Download URL dotflow-0.6.0.tar.gz
Size 9.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b4d3976fe2e81cdde9a726c099313f05c1ad194b965241c2878976921d13e2c0
BLAKE2b-256 checksum
How to use checksums
777061168a54dd3d59c38e2e8870dffae223e7394e1d9497c0f5beb43aa09013
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Release files / dotflow-0.6.0-py3-none-any.whl

Download URL dotflow-0.6.0-py3-none-any.whl
Size 14.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
52e855df12f948840fb909eef16b2910e49f07f61b0e8421725ff79171c595cf
BLAKE2b-256 checksum
How to use checksums
a18ef56abcb659c9986591e9b45c002c1fea3ee4cb52bdfc88632eba1921e14a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Security for dotflow 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page