Anomaly detection, impact explanation, forecasting, and alerting toolkit.
Project description
anomaly_impact_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:
Telegram alert
Example of an automatically formatted alert with top contributing segments:
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file anomaly_impact_alert-0.3.0.tar.gz.
File metadata
- Download URL: anomaly_impact_alert-0.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a13d557dc3810e7fd0e8f6cf7689ff292805dca7bb474e3ad9121ffbbaa8eb59
|
|
| MD5 |
2bcc85a369a8bc84b9c394ed31c38fbb
|
|
| BLAKE2b-256 |
d0969ca1807f4eb4e315a126c7d45791f013a6f3a59b727fa47c004cb50127e5
|