Skip to main content

Welcome to dotflow

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 GNU General Public License v3.0.

Metadata

Release files for dotflow 0.4.1

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.4.1
File Size Uploaded Provenance Actions
dotflow-0.4.1.tar.gz 31.9 kB Without provenance Details for dotflow-0.4.1.tar.gz

Built distribution (wheel)

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

Total release size: 67.4 kB

Release files / dotflow-0.4.1.tar.gz

Download URL dotflow-0.4.1.tar.gz
Size 31.9 kB
Tags Source
SHA-256 checksum
How to use checksums
783b2176a0cb0c5a5de24312bee11c03231d04d33a76d68bbe7f35f85350bf9f
BLAKE2b-256 checksum
How to use checksums
428ac9f72d3325562e0eb7f4bce3391a50ab5ad540e8ec82093df211afa308ae
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.4.1-py3-none-any.whl

Download URL dotflow-0.4.1-py3-none-any.whl
Size 35.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ffe04217fcd68d65adf32c98aea6b6c7e61adae31c6cb97aabee03bff034d8aa
BLAKE2b-256 checksum
How to use checksums
4ce2ae84f5f80c207a3549a9e1fb4752ae7fe8216682dc9a3cee1e87baf1b895
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.4.1

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.4.1 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