This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
fanout-broadcast
Reparte un mensaje a varios canales, aísla los fallos y te dice qué pasó en cada uno. Python puro, sin dependencias.
El problema
Quieres mandar lo mismo a varios sitios —Slack, Discord, un webhook, un email, una página de LinkedIn— y dos cosas te importan:
- Que un canal caído no tumbe a los demás. Si Discord está fallando, el email debe salir igual.
- Enterarte de qué se entregó y qué no, sin bucear en los logs.
El patrón ingenuo —un for que llama a cada canal— falla en lo primero: la
primera excepción corta el reparto. Y suele fallar en lo segundo: cada canal se
traga su error en un try/except disperso.
La solución
from fanout_broadcast import Broadcaster
bc = Broadcaster()
bc.add("discord", publicar_discord)
bc.add("telegram", publicar_telegram)
bc.add("email", publicar_email, enabled=False) # apagado por ahora
report = bc.broadcast("¡Nueva versión publicada!")
if not report.ok:
for o in report.failed:
log.error("%s falló: %s", o.name, o.error)
Cada canal es un simple invocable. broadcast los llama a todos —en orden de
registro— con los argumentos que le pases, captura la excepción de cada uno por
separado, y devuelve un Report. Un canal que lanza queda como failed y los
siguientes se ejecutan igual.
Instalación
pip install fanout-broadcast
Sin dependencias. Requiere Python ≥ 3.9.
El reporte
report.ok # True si ningún canal falló
report.delivered # [Outcome, ...] los que entregaron
report.failed # [Outcome, ...] los que lanzaron (con .error)
report.skipped # [Outcome, ...] los deshabilitados
report.get("discord") # el Outcome de un canal concreto
for o in report: # iterable, en orden
print(o.name, o.status) # "delivered" / "skipped" / "failed"
¿Prefieres escalar tras intentarlo todo? report.raise_for_failures() lanza una
BroadcastError después de haber llamado a todos los canales — al revés que
dejar que la primera excepción corte el reparto.
Encender y apagar canales
bc.disable("discord") # en runtime
bc.enable("discord")
bc.is_enabled("email")
Y para el patrón habitual de conmutar por variable de entorno:
from fanout_broadcast import env_enabled
bc.add("discord", publicar_discord, enabled=env_enabled("discord"))
# mira DISCORD_ENABLED en el entorno
También como decorador
@bc.channel("discord")
def a_discord(msg):
requests.post(WEBHOOK, json={"content": msg})
De dónde viene
Salió de un agente de publicación multicanal. Extraje solo la fontanería: el qué se publica y a quién es la lógica de tu aplicación; el cómo repartir con aislamiento de fallos y reporte es genérico, y servía para notificaciones, alertas o webhooks tanto como para redes sociales. Por eso es una librería.
Tests
pip install "fanout-broadcast[test]"
pytest
19 tests centrados en el aislamiento de fallos, el orden, los toggles y el
reporte. Verificados por mutación (estrechar el except que aísla rompe justo
los tests del aislamiento).
Licencia
Apache-2.0.
Metadata
Release files for fanout-broadcast 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fanout_broadcast-0.1.0.tar.gz | 11.1 kB | With provenance | Details for fanout_broadcast-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fanout_broadcast-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for fanout_broadcast-0.1.0-py3-none-any.whl |
Total release size: 21.3 kB
Release files / fanout_broadcast-0.1.0.tar.gz
| Download URL | fanout_broadcast-0.1.0.tar.gz |
|---|---|
| Size | 11.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
059b602bbc6cb28c832cbc6b97dd51dad4178158215e2725fd7f7233b46a0efa
|
|
BLAKE2b-256 checksum How to use checksums |
54ded6cd8af6fa81783f458e39ba58abe10f6f9cabada5409b236296a3ac24f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.
Transparency logRelease files / fanout_broadcast-0.1.0-py3-none-any.whl
| Download URL | fanout_broadcast-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2d710ba1303b766372aa6a70bd95ec5262c921e05707de8c00eb6fc65e5f642c
|
|
BLAKE2b-256 checksum How to use checksums |
bf1efd60395fe4e408c3a395243126784c4a3d76e3c3cb5ad0513c4fe97ffb6f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.
Transparency logSecurity for fanout-broadcast 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for fanout_broadcast-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.