TL;DR — I open-sourced the data-fetcher layer of my investment SaaS. ~1.4K LOC, MIT, pure Python. Pulls FRED macro indicators, GDACS disaster events, and runs lightweight news sentiment. Repo: github.com/TCS-PLATFORM-OFFICIAL/tcs-macro-pulse
Why I built this
I'm building TCS-PLATFORM — an investment-intelligence SaaS for Vietnamese retail investors. The system is layered (L1 macro → L9 signal generation), and the lower layers (L1-L3) are just data collection from public sources.
Locking those behind a paywall would be silly. The proprietary engine is the L4-L9 stack. So I carved out L1-L3 into a standalone package: tcs-macro-pulse.
What's inside
L1 — FRED macro fetcher
10 key US macro indicators in one call:
from tcs_macro_pulse.fetchers.fred import FREDFetcher
fred = FREDFetcher()
data = fred.fetch_key_indicators()
# → {'fed_funds_rate': 5.33, 'cpi_yoy': 3.1, 'unemployment': 3.9, ...}
Built-in recession indicator:
spread = fred.yield_curve_spread() # → -47.2 bps (10Y - 2Y, inverted)
L2 — GDACS disaster events
Parses the GDACS RSS feed (no API key needed) and scores events:
from tcs_macro_pulse.fetchers.gdacs import GDACSSentinel
sentinel = GDACSSentinel()
events = sentinel.fetch_recent(days=7)
risk = sentinel.compute_risk_score(events)
# → {'risk_level': 'AMBER', 'risk_score': 25, 'n_red': 1, 'n_orange': 4, ...}
L3 — Keyword sentiment
For when you don't want to spin up FinBERT just to skim 50 headlines:
from tcs_macro_pulse.analysis.keyword_sentiment import KeywordSentiment
ks = KeywordSentiment()
result = ks.analyze_headlines([
"Fed signals rate cuts ahead",
"Markets crash on inflation fears",
"Tech stocks rally"
])
# → {'overall': 'NEUTRAL', 'bullish': 1, 'bearish': 1, 'neutral': 1, 'score': 0.0}
The [nlp] extra installs transformers + torch if you want FinBERT instead.
Install
pip install tcs-macro-pulse
# or
pip install "tcs-macro-pulse[nlp]" # with FinBERT
What's NOT in the package
- L4-L9 signal generation (proprietary)
- Anything Vietnam-specific (those live in the SaaS)
- Trading execution / order management
This is just clean data fetchers. Bring your own analysis.
License & contributing
MIT. Contributions welcome — particularly fetchers for:
- ECB (Eurostat macro)
- BoJ (Japan macro)
- IMF (cross-country)
- World Bank (development indicators)
Open an issue or PR: github.com/TCS-PLATFORM-OFFICIAL/tcs-macro-pulse
If you find this useful, a ⭐ on GitHub helps a lot.
Cheers!
Top comments (0)