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

Built distribution (wheel)

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

Total release size: 67.4 kB

Release files / dotflow-0.4.0.tar.gz

Download URL dotflow-0.4.0.tar.gz
Size 31.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5b82a4ab163714d0949c7efa0870908500e05643eb52960c147401f767500103
BLAKE2b-256 checksum
How to use checksums
ce5855b654742e16aa217adf18291bbe0381c007c19a029403d39a4f1fb6dec9
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.0-py3-none-any.whl

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