Skip to content

Nanoflow is a simple and efficient workflow framework. It allows you to define and execute tasks and workflows with ease.

License

Notifications You must be signed in to change notification settings

zrr-lab/nanoflow

Repository files navigation

Nanoflow

PyPI - Python Version pypi PyPI - Downloads LICENSE
CodSpeed Badge
uv ruff Gitmoji

Nanoflow is a simple and efficient workflow framework for Python. It allows you to define and execute tasks and workflows with ease.

Features

  • Define tasks and workflows using decorators
  • Support for task dependencies
  • Retry functionality for tasks
  • GPU resource management for parallel task execution
  • Support flow matrix and task matrix
  • Dynamic update resource pool

Roadmap

  • Split commands into command and args to avoid too long
  • Integration with FastAPI for managing workflows as web APIs
  • Enhance TUI, improve task log display, use terminal-like style
  • Support for multiple configuration files or folders
  • Support for passing parameters and matrix
  • Support to depend on a task that has matrix

Installation Downloads

Installation using pip/pipx/uv

Before this, please ensure that Python 3.12 or above is installed, along with pip.

pip install nanoflow

If you want to try the Nightly version, you can try

pip install git+https://github.com/zrr1999/nanoflow@main

Before this, please ensure that pipx/uv is installed.

pipx install nanoflow
uv tool install nanoflow

Source Installation

git clone https://github.com/zrr1999/nanoflow
cd nanoflow
pip install .

Usage

To use Nanoflow as a package, you can define tasks and workflows using decorators:

from nanoflow import workflow, task

@task
def task_a():
    print("a")

@workflow
async def workflow_a():
    await task_a.submit()


if __name__ == "__main__":
    workflow_a.run()

To use Nanoflow as a cli or tui, you can use the following command:

nanoflow run examples/simple.toml
nanoflow run examples/simple.toml --use-tui

About

Nanoflow is a simple and efficient workflow framework. It allows you to define and execute tasks and workflows with ease.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published