Skip to main content

Zero-dependency Python workflow engine — DAG, @flow, @task, state

Project description

Apex Logo

Apex

Motor de workflows em Python — DAG, @flow, @task, state implícito

Python Version License Tests Dependencies


O que é

Apex é um framework Python zero-dependências para construir workflows, automações e agentes. Transforma funções Python comuns em grafos acíclicos dirigidos (DAGs) analisando o código-fonte em tempo real.

from apex.graph import flow, state

@flow
def meu_workflow():
    etapa1()
    etapa2()

meu_workflow.run(state={"chave": "valor"})

Quick Start

pip install apex-taskflow
from apex.graph import flow, task, state

@task(retry=2)
def buscar_dados():
    state.dados = {"valor": 42}

@task(timeout=10)
def processar():
    state.resultado = state.dados["valor"] * 2

@flow
def pipeline():
    buscar_dados()
    processar()

resultado = pipeline.run()
print(resultado.resultado)  # 84

Filosofia

  • Zero configuração — decorators e funções padrão
  • Implícito por designstate global por execução sem injeção manual
  • Tudo é uma task — toda chamada de função vira nó no DAG
  • Paralelismo automático — tasks independentes rodam em paralelo
  • Visualização nativa — ASCII, SVG, Mermaid, HTML, PNG

Estrutura

apex/
├── __init__.py          # from apex.graph import flow, task, state
├── __version__.py       # 0.1.0
└── graph/
    ├── _state.py        # State + _StateProxy + contextvars
    ├── _dag.py          # AST walker → DAG + cycle detection
    ├── _scheduler.py    # Flow, @flow, @task, executor, retry, timeout
    └── _viz.py          # ASCII, SVG, Mermaid, HTML, PNG

Documentação

Seção Conteúdo
graph — motor de workflows @flow, @task, state, scheduler, DAG
Exemplos completos Pipeline, e-commerce, ReAct, padrões

Licença

MIT — veja LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apex_taskflow-0.1.0.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

apex_taskflow-0.1.0-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file apex_taskflow-0.1.0.tar.gz.

File metadata

  • Download URL: apex_taskflow-0.1.0.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for apex_taskflow-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e2ab5782d0029e516885c2d9163b1651000cf5ad732c7ad2d3445915579547e0
MD5 b24966fbb3c6f5e28bad179370e33b97
BLAKE2b-256 7fb5e9de79bd4788f15931698b0a85741c37631f615a24f8ebf1de77f1ceb2ec

See more details on using hashes here.

File details

Details for the file apex_taskflow-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: apex_taskflow-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for apex_taskflow-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 545b325e4d20601379237cf406927c9853c348b541cb83445a6bff701d9fc2da
MD5 89d4a4f0319ab9c5cdf039547d4263ad
BLAKE2b-256 665ac35cd93ec7083fb8318c7eee65711483287f9a94572f0557ea272cda217d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page