blare for Python
Production failures to Slack, Discord and Teams. One line of setup, no server, no spam.
pip install blare
import blare
blare.init()
BLARE_SINKS=https://hooks.slack.com/services/T000/B000/xxxx
BLARE_ENV=production
That is the whole installation. From then on every logger.error(...), every
unhandled exception and every framework 500 becomes a chat alert — grouped so
that one broken endpoint is one message rather than eight hundred.
Check it before you need it:
python -m blare --send
What is captured
| Layer | How | Code to write |
|---|---|---|
logging |
handler on the root logger | none |
| Unhandled exceptions | sys.excepthook, threading.excepthook |
none |
| FastAPI, Starlette, Litestar, Quart | BlareASGIMiddleware |
one line |
| Flask | got_request_exception |
one line |
| Django | got_request_exception |
one line |
| Celery | task_failure |
one line |
| Any WSGI app | BlareWSGIMiddleware |
one line |
# FastAPI
from blare.integrations.asgi import BlareASGIMiddleware
app.add_middleware(BlareASGIMiddleware)
# Flask
from blare.integrations.flask import install
install(app)
# Django, in AppConfig.ready()
from blare.integrations.django import install
install()
# Celery
from blare.integrations.celery import install
install()
Why it does not flood the channel
Identical failures are fingerprinted together and one alert per problem goes out per five minute window. The suppressed occurrences are not lost — they arrive as a count on the next alert:
🟠
OperationalError: connection pool exhausted— 847 times in the last 5 min
There is also a hard ceiling of 20 alerts an hour, and the number dropped by it is reported on the next alert that gets through.
Settings
Every setting is an environment variable, documented in SPEC.md section 2. The ones most people touch:
| Variable | Default | |
|---|---|---|
BLARE_SINKS |
— | webhook URLs, comma separated |
BLARE_ENV |
unknown |
production, staging, … |
BLARE_SERVICE |
derived | name shown in alerts |
BLARE_LEVEL |
ERROR |
minimum level that alerts |
BLARE_DEDUPE_WINDOW |
300 |
seconds of silence per problem |
BLARE_MAX_PER_HOUR |
20 |
hard ceiling; 0 disables |
BLARE_IGNORE |
— | glob patterns to drop |
BLARE_STATE |
file |
memory, file, redis://… |
Running more than one host? Set BLARE_STATE to a Redis URL, or each host
deduplicates on its own and a ten-replica deployment sends ten alerts for one
outage.
Privacy
Local variables, request bodies, response bodies and environment variable
values are never collected, in any configuration. Everything that does leave
the process is scanned for credentials first — bearer tokens, JWTs, AWS keys,
GitHub and Slack tokens, private keys, URL passwords, card numbers — and keys
named password, token, secret and friends are replaced wholesale. See
SPEC.md section 6.
Testing your own code
blare.init(sinks=[], synchronous=True) # captures, sends nowhere
blare.stats() # {'delivered': .., 'suppressed': ..}
Or set BLARE_DRY_RUN=true to render alerts to stderr and send nothing.
Development
uv venv && . .venv/bin/activate
uv pip install -e ".[dev]"
pytest
ruff check .
The suite reads the shared fixtures in ../conformance/, so
behaviour cannot drift from the spec or from the other language ports.
Apache-2.0. Implements spec version 1.
Metadata
Release files for blare 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 | |
|---|---|---|---|---|
| blare-0.1.0.tar.gz | 110.3 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| blare-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 150.5 kB
Release files / blare-0.1.0.tar.gz
| Download URL | blare-0.1.0.tar.gz |
|---|---|
| Size | 110.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7bacc5a3450928187bf594b46c343773ec8b71a88838f891927901520f2b00b1
|
|
BLAKE2b-256 checksum How to use checksums |
79f5db9e52608d33463c60e4de7a8c86d71e14c9e081795fd932de405de1998b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 23, 2026.
Transparency logRelease files / blare-0.1.0-py3-none-any.whl
| Download URL | blare-0.1.0-py3-none-any.whl |
|---|---|
| Size | 40.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ceb127426216048cdb3271edf7e13215c8e18ea3e03daefb9971a25e4e1d22a8
|
|
BLAKE2b-256 checksum How to use checksums |
30b9e65153a78a56d1253a0dda521b8a17043d624a08c6127977d07cb6d63d7e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 23, 2026.
Transparency logSecurity for blare 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
All 2 files in this release have been uploaded with provenance metadata.
Attestation for blare-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 Oct 23, 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.