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.2.0.tar.gz (611.1 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: anomaly_impact_alert-0.2.0.tar.gz
  • Upload date:
  • Size: 611.1 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.2.0.tar.gz
Algorithm Hash digest
SHA256 bf665c720ae51dc55c161eb25c1bfa5158698403935bb0f07c7d244e2dc653ab
MD5 56e89688cf4529cd9f49d97540ab3ce2
BLAKE2b-256 8853aa887e01e1673ab2cc282b43397ab8fe0b1d69d8a5f305e75c9f8d1112a4

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