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.1.tar.gz (20.3 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.1-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for apex_taskflow-0.1.1.tar.gz
Algorithm Hash digest
SHA256 367442db1e7b5fe8604b8200188b9f848a9b7a05f785ecf84acb4fdfdc741a93
MD5 c4c9a15214091b8ad201b7b3903895cf
BLAKE2b-256 d8ca622dca0f7a7b7fcf19530f09f0a9bdae3c67abaca23ab2eeb0850d1b36e9

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for apex_taskflow-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0ac4b0d1fa89b41c94b40501a03d411851fa545bcf89ec69107eea0efcd207a6
MD5 b8f3486197d7eee0feac3229b99f00b4
BLAKE2b-256 93a13e6435f42b42082ff6d0f42c8ef0f1f5dbbfb223c7540da68abe2392aa21

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