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,FlowResulteFlowEvent. - 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,elapsedeevents_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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66900ee22e09f3d5cc1733ad27bc83288a238607912857cfaeb5c9771e3e6204
|
|
| MD5 |
a95c22ff70b48d70e3dd6d4694e43609
|
|
| BLAKE2b-256 |
79d0f6fb8f994be42868de54d67f34d6ebb6741b206c2435cc7dbed298828310
|
Provenance
The following attestation bundles were made for merotec_autoflow-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on Romero-Softwares/merotecflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
merotec_autoflow-0.1.0.tar.gz -
Subject digest:
66900ee22e09f3d5cc1733ad27bc83288a238607912857cfaeb5c9771e3e6204 - Sigstore transparency entry: 1999508374
- Sigstore integration time:
-
Permalink:
Romero-Softwares/merotecflow@7f5da1eee22c0c730594ef7ae7ee948c27537994 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Romero-Softwares
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@7f5da1eee22c0c730594ef7ae7ee948c27537994 -
Trigger Event:
push
-
Statement type:
File details
Details for the file merotec_autoflow-0.1.0-py3-none-any.whl.
File metadata
- Download URL: merotec_autoflow-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c60710b5a0d8336e8254afaf453717ead0d0036aeb22fc1cd7dc8a868c040bd
|
|
| MD5 |
90c8d7e381cd6056ece7a6fce760e4c1
|
|
| BLAKE2b-256 |
353e36c4921e58e74e0a976fb2dbbb80118605cb40e4516c37d9eec7282d9f49
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
merotec_autoflow-0.1.0-py3-none-any.whl -
Subject digest:
6c60710b5a0d8336e8254afaf453717ead0d0036aeb22fc1cd7dc8a868c040bd - Sigstore transparency entry: 1999508439
- Sigstore integration time:
-
Permalink:
Romero-Softwares/merotecflow@7f5da1eee22c0c730594ef7ae7ee948c27537994 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Romero-Softwares
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@7f5da1eee22c0c730594ef7ae7ee948c27537994 -
Trigger Event:
push
-
Statement type: