Skip to main content

Anomaly detection, impact explanation, forecasting, and alerting toolkit.

Project description

anomaly_impact_alert

Telegram Alert

Anomaly Impact Alert — a lightweight Python toolkit for detecting anomalies, forecasting metrics, explaining deviations, and sending alerts (e.g. via Telegram).


Purpose

This library helps analytics and monitoring teams automatically:

  • Detect abnormal metric values in time-series data
  • Forecast expected ranges (with confidence intervals)
  • Explain the drivers behind changes (countries, platforms, etc.)
  • Send structured alerts to Telegram

Example Output

Detection visualization

Shows detected anomalies (red dots), confidence intervals, and model outputs:

Anomaly Detection]

Telegram alert

Example of an automatically formatted alert with top contributing segments:

Telegram Alert

Quick Start

pip install anomaly_impact_alert
from anomaly_impact_alert import (
    AnomalyParams, analyze_latest_point,
    ImpactConfig, attach_impact_text,
    BFConfig, forecast_values_for_targets_better,
    AlertConfig, send_alert_for_date,
)

# 1. Detect anomalies
params = AnomalyParams(threshold=3.0)
anomalies = analyze_latest_point(df, params)

# 2. Forecast expected values
forecast_cfg = BFConfig(periods=7)
forecast = forecast_values_for_targets_better(df, forecast_cfg)

# 3. Explain the impact
impact_cfg = ImpactConfig(metric="amount")
text = attach_impact_text(anomalies, impact_cfg)

# 4. Send alert to Telegram
alert_cfg = AlertConfig(bot_token="YOUR_BOT_TOKEN", chat_id="YOUR_CHAT_ID")
send_alert_for_date(text, alert_cfg)

Modules Overview

Module Description
anomaly_detector Detects anomalies using statistical and ML methods
forecast Forecasts values and confidence intervals
impact_explainer Explains which dimensions cause deviations
alert_bot_telegram Sends rich alerts to Telegram

Dependencies

pandas, numpy, scikit-learn, matplotlib, prophet, tqdm, requests, python-telegram-bot


License

MIT © 2025 Aleksey Voronko, Petr Devitsin

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

anomaly_impact_alert-0.4.0.tar.gz (668.2 kB view details)

Uploaded Source

File details

Details for the file anomaly_impact_alert-0.4.0.tar.gz.

File metadata

  • Download URL: anomaly_impact_alert-0.4.0.tar.gz
  • Upload date:
  • Size: 668.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for anomaly_impact_alert-0.4.0.tar.gz
Algorithm Hash digest
SHA256 31cf616b98a2ab81448664a35552dd95ba2c685fd66a01f2d1e445813ad50247
MD5 bbad7f887e2dd40aa13ae0f3966fc6b3
BLAKE2b-256 42629be9e3ee0dd6d7398dc2d7ca86ca668ce0f64ee41e5551d70ca39e20599e

See more details on using hashes here.

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