Source health monitoring for economic data pipelines. Continuously validates the availability, structure, and freshness of financial data sources across Indian and global markets.
- Health Checks -- Concurrent HTTP-based monitoring of all configured data sources with status classification (healthy, warning, degraded, broken).
- Structure Validation -- Compares live page structure against saved baselines to detect silent breaking changes such as site redesigns, removed data tables, or altered API schemas.
- Baseline Management -- Captures and stores structural fingerprints (HTML selectors, table counts, section headers, JSON schemas, RSS field sets) for drift detection.
- Data Freshness Tracking -- Fuzzy date parsing with weekday-aware staleness detection to flag sources that have stopped updating.
- AI-Powered Analysis -- Sends health results to an LLM for root cause analysis, urgency assessment, and actionable fix recommendations.
- Telegram Alerts -- Sends automated alerts on source breakage, structural changes, or stale data via Telegram Bot API.
- Scheduler -- Built-in daemon with quick checks every 6 hours and deep checks daily at 07:00 IST. Optional Celery Beat integration for production deployments.
- CLI Interface -- Full command-line interface for manual checks, report generation, baseline updates, and report history browsing.
- Markdown Reports -- Generates and archives daily health reports with problem summaries and remediation guidance.
| Component | Technology |
|---|---|
| Language | Python 3.12+ |
| HTTP Client | httpx (with HTTP/2 support) |
| HTML Parsing | BeautifulSoup 4 + lxml |
| Async Runtime | asyncio |
| Scheduling | Built-in async scheduler / Celery Beat |
| Alerting | Telegram Bot API |
| AI Analysis | Claude (via OpenAI-compatible proxy) |
| Configuration | YAML |
| Date Parsing | python-dateutil |
- Python 3.12 or later
- (Optional) A Telegram bot token and chat ID for alerts
- (Optional) A FRED API key for full API validation
git clone https://github.com/beepboop2025/econscraper.git
cd econscraper
pip install -r requirements.txtRun a full health check with structure validation:
python -m monitoring checkRun a quick HTTP-only reachability check:
python -m monitoring check --quickGenerate an AI-analyzed report and save it to monitoring/reports/:
python -m monitoring reportUpdate structural baselines for all sources:
python -m monitoring baselineUpdate the baseline for a single source:
python -m monitoring baseline fredView recent report history:
python -m monitoring history --days 7
python -m monitoring history --fullStart the background scheduler daemon:
python -m monitoring scheduleSet the following environment variables for optional features:
export FRED_API_KEY="your-fred-api-key"
export TELEGRAM_BOT_TOKEN="your-bot-token"
export TELEGRAM_CHAT_ID="your-chat-id"Alert behavior is configured in config/alerts.yaml.
| Source | Type | What is Checked |
|---|---|---|
| RBI DBIE | Government | Weekly Statistical Supplement availability, data dates |
| RBI Circulars | Government | Press releases and notification freshness |
| NSE India | Exchange | Market data page, FII/DII data sections |
| CCIL | Clearing House | FBIL reference rates, rate publication dates |
| SEBI | Regulator | Circulars listing page, circular dates |
| data.gov.in | Government | Open data catalog availability |
| Source | Type | What is Checked |
|---|---|---|
| FRED API | Central Bank | API availability, JSON schema validation, deprecation headers |
| Feed | Publisher |
|---|---|
| Reuters Business | Google News (India) |
| ET Economy | Economic Times |
| Livemint Economy | Livemint |
| Business Standard | Business Standard |
| Moneycontrol | Moneycontrol |
Each RSS feed is validated for XML structure, required fields (title, link, date), entry count, and publication freshness.
econscraper/
config/
alerts.yaml # Alert channel and schedule configuration
monitoring/
__init__.py
__main__.py # Entry point for python -m monitoring
source_health_checker.py # Core health check logic for all sources
structure_validator.py # Baseline fingerprinting and drift detection
ai_change_detector.py # LLM-powered change analysis
alert_sender.py # Telegram notification delivery
health_scheduler.py # Async scheduler and Celery Beat integration
cli.py # Command-line interface
baselines/ # Stored structural fingerprints (JSON)
reports/ # Archived daily health reports (Markdown)
requirements.txt
Source-available — free to view, study, and run locally for non-commercial use. Commercial use requires a separate license. See LICENSE.md for the full terms.