by João Casella
This repository hosts a continuously updated collection of global economic calendars — one for each country — provided in the standard ICS (iCalendar) format.
All calendars are automatically updated through GitHub Actions and can be easily downloaded and added to Outlook, Google Calendar, Apple Calendar, or any other calendar app supporting iCalendar feeds.
Access all country calendars here:
🔗 https://joaoalonsocasella.github.io/Economic_Calendar/
After downloading the .ics, you may choose:
- Static Import → drag and drop into your calendar
- Dynamic Subscription (recommended) → copy the feed URL and paste it in your calendar’s subscription area (auto-updates)
EconomicCalendar is an open-source project designed to aggregate, classify, and distribute global macroeconomic event data in a clean and machine-readable format.
All data is sourced from:
MarketPulse – Economic Calendar
The project is divided into five main modules that form a complete automated pipeline:
| Script | Description |
|---|---|
Update.py |
Runs all country scrapers in parallel to collect .csv and .ics data from MarketPulse. |
Combine.py |
Merges all .ics files into a single unified global calendar. |
GenerateLinks.py |
Updates the HTML index with calendar URLs for GitHub Pages. |
Output:
Fresh calendar data saved in data/raw/ (CSV + ICS, per country).
| Script | Description |
|---|---|
main.py |
FastAPI backend serving endpoints with calendar, category, and impact data. |
utils.py |
Helper utilities for JSON normalization, caching, and request parsing. |
https://economic-calendar-api-h9hr.onrender.com
To start the API in your own machine:
uvicorn api.main:app --reload
Base Adress (generic output from FastAPI):
http://127.0.0.1:8000
- Country's entire economic calendar info:
- add
/events?country={iso3} - Example:
http://127.0.0.1:8000/events?country=BRA
- add
- Country's calendar events filtered by Impact (LOW | MEDIUM | HIGH):
- add
&impact={impact_level}to the country query - Example:
http://127.0.0.1:8000/events?country=BRA&impact=HIGH
- add
- Country's calendar events filtered by macroeconomic theme (Inflation | Growth | Labor Market | Monetary Policy | Confidence | Trade and External | Housing | Money and Credit):
- add
¯ocateg={categ}to the country query - Example:
http://127.0.0.1:8000/events?country=BRA¯ocateg=Labor%20Market
- add
- Country's calendar events filtered by Event Name:
- add
&release={event_name}to the country query` - Example:
http://127.0.0.1:8000/events?country=BRA&release=PMI
- add
- Country's calendar events filtered by Event Type (Release or Speech):
- add
&type=Releaseto the country query - Example:
http://127.0.0.1:8000/events?country=BRA&type=Release
- add
- Country's calendar events filtered by Start Date & End Date:
- add
&start_date={yyyy-mm-dd}&end_date={yyyy-mm-dd}to the country query - Example:
http://127.0.0.1:8000/events/?country=BRA&start_date=2025-10-01&end_date=2026-12-31
- add
Of course, you can use multiple filters at the same time, apart from filtering multiple countries at once.
Output:
Dynamic API serving real-time data through lightweight JSON endpoints.
| Script / File | Description |
|---|---|
LLM_destil_faster.py |
Distills macroeconomic categories using GPT, batching and checkpointing for efficiency. |
ec_calend_1418.xlsx |
Historical labeled dataset (2014–2018) used for training local classifiers. |
Output:
Validated labeled dataset (data/datasets/ec_calend_1418_labeled.xlsx) for model training.
For classification of economic theme, I adopted a hybrid Logistic Regression + TF-IDF Vectorizer pipeline:
- Texts are preprocessed (lowercasing, token cleaning, lemmatization by regex).
- TF-IDF captures token importance:
tf(t,d) * (log(n/df(t)) + 1) - Logistic Regression provides robust, interpretable boundaries for sparse vectors.
- Parameters were tuned via cross-validation and sensitivity analysis to optimize generalization.
This combination delivered a model that balances explainability, scalability, and accuracy without relying on heavy transformer-based models — ideal for continuous retraining from LLM-labeled data.
| Script | Description |
|---|---|
train_macro_model.py |
Trains the macroeconomic category classifier (MacroCateg) |
train_type_model.py |
Trains the type classifier distinguishing Release and Speech. |
apply_real.py |
Applies both trained models to new MarketPulse data, generating labeled CSVs in data/processed/. |
Below is an example of the model’s parameter sensitivity curve and final classification report.
Evaluation:
Reports and confusion matrices are generated under
scripts/Classification_Models/Quality_training/{macro_model, type_model}/.
Output:
Processed and labeled CSVs with MacroCateg and Type.
| Script | Description |
|---|---|
Impact_model.py |
Computes a proprietary Impact_score combining Macro Category × Country × Event Type. |
Scoring thresholds:
| Range | Category |
|---|---|
> 0.15 |
HIGH |
0.10 – 0.15 |
MEDIUM |
< 0.10 |
LOW |
Output:
Final enriched CSVs with:
Id, Start, Name, Currency, Type, MacroCateg, Impact_score, Impact
┌───────────────────────────────────────────────┐
│ MarketPulse Economic Calendar (Source) │
└───────────────────────────────────────────────┘
│
▼
[1] Scraping & Update (raw CSV/ICS)
│
▼
[2] Classification (Macro + Type)
│
▼
[3] Impact Model (weighted scoring)
│
▼
[4] API JSON Generation
│
▼
FastAPI Endpoints → GitHub Pages → Public Feed
This project is a non-commercial educational initiative. All information originates from publicly available sources. No paid or credentialed APIs are used at any stage.
Maintained by: João Alonso Casella
📧 @joaoalonsocasella


