Skip to main content

A tiny Python library for composing observable automation flows.

Project description

merotec-autoflow

merotec-autoflow e uma biblioteca Python pequena para criar fluxos de automacao observaveis, testaveis e faceis de compor.

A ideia inicial e simples: cada etapa recebe um dicionario de contexto, devolve novos valores e o fluxo registra eventos de execucao. Isso serve para scripts, rotinas de ETL leves, automacoes internas, bots locais e prototipos que precisam crescer sem virar um bloco unico de codigo.

Exemplo

from autoflow import Flow, step


@step(retries=2)
def normalize_user(ctx):
    return {"email": ctx["email"].lower()}


def make_slug(ctx):
    return {"slug": ctx["email"].split("@")[0]}


result = (
    Flow("signup")
    .add(normalize_user)
    .add(make_slug)
    .run({"email": "ADA@EXAMPLE.COM"})
)

print(result.context)
print([event.name for event in result.events])

Recursos iniciais

  • API publica enxuta: Flow, step, FlowResult e FlowEvent.
  • Contexto compartilhado entre etapas.
  • Merge automatico de resultados em formato de dicionario.
  • Retry por etapa com atraso opcional.
  • Decorator flexivel: @step, @step("nome") ou @step(name="nome").
  • Eventos para observabilidade simples, incluindo falha do fluxo.
  • Resultado com helpers como get, elapsed e events_named.
  • Validacoes claras para nomes, contexto inicial, retries e delay.
  • Zero dependencias externas em runtime.

Desenvolvimento

python -m pip install -e .
python -m unittest

Instalacao pelo repositorio

Depois que o codigo estiver no GitHub, a biblioteca pode ser instalada direto do repositorio:

python -m pip install git+https://github.com/Romero-Softwares/merotecflow.git

Publicacao no PyPI

Antes de publicar, gere e valide o pacote localmente:

python -m pip install --upgrade build twine
python -m build
python -m twine check dist/*

Para testar em um indice separado antes do PyPI oficial:

python -m twine upload --repository testpypi dist/*
python -m pip install --index-url https://test.pypi.org/simple/ merotec-autoflow

Para publicar no PyPI oficial:

python -m twine upload dist/*

Use um token de API do PyPI quando o twine pedir a senha. O usuario pode ser __token__ e a senha deve ser o token completo gerado na conta do PyPI.

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

merotec_autoflow-0.1.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

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

merotec_autoflow-0.1.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: merotec_autoflow-0.1.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for merotec_autoflow-0.1.0.tar.gz
Algorithm Hash digest
SHA256 66900ee22e09f3d5cc1733ad27bc83288a238607912857cfaeb5c9771e3e6204
MD5 a95c22ff70b48d70e3dd6d4694e43609
BLAKE2b-256 79d0f6fb8f994be42868de54d67f34d6ebb6741b206c2435cc7dbed298828310

See more details on using hashes here.

Provenance

The following attestation bundles were made for merotec_autoflow-0.1.0.tar.gz:

Publisher: publish-pypi.yml on Romero-Softwares/merotecflow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for merotec_autoflow-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c60710b5a0d8336e8254afaf453717ead0d0036aeb22fc1cd7dc8a868c040bd
MD5 90c8d7e381cd6056ece7a6fce760e4c1
BLAKE2b-256 353e36c4921e58e74e0a976fb2dbbb80118605cb40e4516c37d9eec7282d9f49

See more details on using hashes here.

Provenance

The following attestation bundles were made for merotec_autoflow-0.1.0-py3-none-any.whl:

Publisher: publish-pypi.yml on Romero-Softwares/merotecflow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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