This release is a pre-release and may not be stable for production use.
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
A Simple Example
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()
First Steps
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()
More Examples
Commit Style
- ⚙️ FEATURE
- 📝 PEP8
- 📌 ISSUE
- 🪲 BUG
- 📘 DOCS
- 📦 PyPI
- ❤️️ TEST
- ⬆️ CI/CD
- ⚠️ SECURITY
License
This project is licensed under the terms of the MIT License.
Metadata
Release files for dotflow 0.8.0.dev1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dotflow-0.8.0.dev1.tar.gz | 14.5 kB | Without provenance | Details for dotflow-0.8.0.dev1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dotflow-0.8.0.dev1-py3-none-any.whl | Python 3 | none | any | Details for dotflow-0.8.0.dev1-py3-none-any.whl |
Total release size: 38.2 kB
Release files / dotflow-0.8.0.dev1.tar.gz
| Download URL | dotflow-0.8.0.dev1.tar.gz |
|---|---|
| Size | 14.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
396885a2b96bdb68e82a0299fce35e57943efb035687d47f92090f1cd6d8b874
|
|
BLAKE2b-256 checksum How to use checksums |
3fcdc5bec939cfa483e4d4739549e74051148d4ed481a4d087ffcea36b3af18c
|
| 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.8.0.dev1-py3-none-any.whl
| Download URL | dotflow-0.8.0.dev1-py3-none-any.whl |
|---|---|
| Size | 23.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
988b680996a605be54a6004230c7753dac4295b53e16f127418fe6803aa7d291
|
|
BLAKE2b-256 checksum How to use checksums |
2d1971d4c0b0e02c776e8703d571d3300022bc327782a7341a42e62680aeefd4
|
| 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.8.0.dev1
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.