Skip to main content

normbeat (Python)

Alerts for jobs that succeed but do nothing. normbeat compares each run's output count with that job's recent runs on the same weekday and tells you when a run loads zero, far too little, or suspiciously much, with no thresholds to set.

▶ 90-second demo · normbeat.com

Zero dependencies. Python 3.9+. MIT licensed.

Offline mode (no account)

Keep history in a local SQLite file and check each run:

normbeat local check --name orders --count 48211
# OK: Loaded 48,211. Normal for Tuesdays (39k–56k).

normbeat local check --name orders --count 0
# ZERO: Loaded 0. Tuesdays usually load 39k–56k.      (exit code 2)
  • Exit code 0 = normal or still learning, 2 = anomaly (zero / low / high). Use it to fail a pipeline step or trigger your own alert.
  • --period hourly (or seconds) for jobs that run more than twice a day; they're compared by weekday + hour, with fallbacks while history builds up.
  • --at 2026-11-20T02:00 to record a run with its real time (useful for backfilling history).
  • Anomalies are recorded but not learned from, so a week-long outage can't teach normbeat that zero is normal. If volume really changed for good, pass --accept and it becomes the new normal.
  • History lives in ~/.normbeat/history.db (--db or NORMBEAT_DB to change).

Hosted service

import normbeat

with normbeat.run("YOUR_CHECK_KEY") as r:   # sends "start"; sends "fail" if the block raises
    rows = load_orders()
    r.count(rows)                           # sends success with the count

Or from a shell job: normbeat ping YOUR_CHECK_KEY --count 48211.

The client never breaks your job: network problems are logged and ignored, with a 10-second timeout. Create a free account (5 checks, no card) at https://app.normbeat.com/login.

Create checks from code

With many jobs, let each one create its own check the first time it runs. Create an API key on the Account page and set it as NORMBEAT_API_KEY.

import normbeat

key = normbeat.check("orders load", cron="0 2 * * *", tz="Europe/Berlin")
with normbeat.run(key) as r:
    r.count(load_orders())

Give one schedule: cron="0 2 * * *" or every="15m" / "6h" / "1d". Optional: minimum= and maximum= counts. If a check with that name already exists it's reused as it is. Like everything in this client, check() never raises: if it can't reach normbeat it logs a warning and the job runs as usual.

How the normal range works

For each run, normbeat looks at the last 8 runs on the same weekday (or same weekday and hour for frequent jobs), takes the median and a robust spread (median absolute deviation), and flags a run only if it is both a statistical outlier and a big practical change:

Alert When
zero count is 0 and zero isn't normal for that day (works from the first run)
too low below the range and under 50% of the usual count
too high above the range and over 150% of the usual count

While a weekday has fewer than 5 runs, it's stricter (under 40% / at least 2×), and it needs at least 3 runs before low/high alerts start.

Measured on 200 simulated noisy jobs (±5–30% daily noise, half-volume weekends): 0.03% false alarms over 16,800 runs. Caught: zero rows 100%, duplicate loads (2×) 94%, loads at 30% of normal 88%, at 45% of normal 68%. Partial loads at 60% of normal are deliberately not flagged (4%); that's the price of near-zero false alarms.

Not handled yet: month-end spikes and public holidays.

Development

PYTHONPATH=src python -m unittest discover -s tests

Metadata

Release files for normbeat 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for normbeat 0.2.1
File Size Uploaded Provenance Actions
normbeat-0.2.1.tar.gz 16.7 kB With provenance Details for normbeat-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for normbeat 0.2.1
File Interpreter ABI Platform Actions
normbeat-0.2.1-py3-none-any.whl Python 3 none any Details for normbeat-0.2.1-py3-none-any.whl

Total release size: 29.3 kB

Release files / normbeat-0.2.1.tar.gz

Download URL normbeat-0.2.1.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
20cccb17617ef3e42a0de8bf52a162eac02a52ef63c7768cce2d0b34624deca1
BLAKE2b-256 checksum
How to use checksums
e62d08430aacce9c43ebefdede213bd27831e3b24673500cb45141c578d4da80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Dec 5, 2026.

Transparency log

Release files / normbeat-0.2.1-py3-none-any.whl

Download URL normbeat-0.2.1-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5bbb342dd920050c869de4b229c5e9dd7018067f7e185ee4da86cabf2d17787a
BLAKE2b-256 checksum
How to use checksums
e5dc437bf24cf06ca6c7733108839b5c626f73cfe379a7e936a4b19567c71f68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Dec 5, 2026.

Transparency log

Security for normbeat 0.2.1

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.

Select from 2 files

Attestation for normbeat-0.2.1.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 Dec 5, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page