feat: calendar eco

This commit is contained in:
OpenSquared
2026-07-21 14:49:59 +02:00
parent 59fbb9b023
commit 5f23141992
5 changed files with 67 additions and 13 deletions

View File

@@ -3,10 +3,12 @@ Unified calendar sync.
1. FF live JSON (nfs.faireconomy.media) → this week + next week (actual values, precise)
2. FF HTML scraper → weeks 3..N ahead (upcoming forecasts)
3. Fallback for weeks 3..N, only if step 2 got blocked (ForexFactory now 403s the
scraper — likely Cloudflare): Trading Economics first (services.te_calendar, free
tier, no card required), then FMP (services.fmp_calendar, free tier doesn't include
the economic_calendar endpoint — needs their paid Starter plan) — whichever has a
configured key and actually returns events.
scraper — likely Cloudflare): Trading Economics first (services.te_calendar), then
FMP (services.fmp_calendar) — whichever has a configured key and actually returns
events. NOTE: neither is actually free for this endpoint — TE's calendar needs
their $149/mo base plan, FMP's free tier excludes economic_calendar (needs their
$14.99/mo Starter). Kept wired for whichever the user ends up paying for; look for
a cheaper source before recommending either.
Called by the background loop in main.py and manually via POST /api/eco/calendar-sync.
"""
import logging