Precise real-world-example news search and spaced-repetition study tools for IB Economics — offline-first, explainable, classic IR (BM25).
Project description
EconLens 🔎
Find precise, current real-world news examples for any IB Economics concept — ranked, explainable, and offline-first.
The hardest marks on IB Economics Paper 1 (b) — the 15-mark Evaluate / Discuss / Examine questions — reward real-world examples (RWE). EconLens turns any syllabus concept into a ranked list of current news stories you can cite, with the date, source, and a link back to the original article.
$ econlens news inflation
🔎 Inflation [macro/inflation]
1. [13.6] US inflation rose at fastest pace in three years as energy costs surge
2026-05-28 · The Guardian — Economics
https://www.theguardian.com/business/2026/may/28/...
2. [ 4.0] US PCE inflation rate hits three-year high …
...
see also: monetary_policy, interest_rates, deflation
Why it's different
- 🎯 Precise, not a keyword dump — each concept has a hand-tuned keyword set
(
must/boost/exclude), so "minimum wage" never returns "minimum balance". - 🔬 Explainable — classic Okapi BM25 ranking with title-field weighting.
Run with
--whyto see exactly which keywords every result matched. Fully deterministic: the same news yields the same ranking, every time. - 🆓 Offline-first & free — pulls from key-less sources (economics RSS feeds + the free GDELT news API). An optional NewsAPI key adds more coverage but is never required.
- 🧩 Data-driven — concepts live in a YAML ontology; contributors extend
coverage by editing data, not code. The schema reserves a
coursefield so other curricula (A-Level, AP) can be added later. - 🔒 Copyright-safe — only the headline, link, date, and source are stored; article bodies are never copied. Results always link to the original.
Quickstart
pip install econlens
Or from source:
git clone https://github.com/HarryXin0919/econlens.git
cd econlens
pip install -e . # add .[dev] for tests
# list the concepts (35 across micro / macro / global / development)
econlens concepts
econlens concepts --unit macro
# find real-world examples for a concept
econlens news minimum_wage
econlens news tariffs --why # show which keywords each result matched
econlens news inflation --no-gdelt # RSS only (faster; skips the slower GDELT API)
GDELT can take 10–20 s and feeds occasionally hiccup; EconLens times out and retries each source independently, so one slow source never sinks a search.
Concepts covered (v0.1)
35 core IB Economics concepts:
| Unit | Examples |
|---|---|
| Micro | PED/PES, market failure, externalities, carbon/sugar tax, subsidies, minimum wage, price floors, monopoly, oligopoly, competition policy, labour markets |
| Macro | inflation, deflation, interest rates, monetary & fiscal policy, government debt, unemployment, economic growth, supply-side policy |
| Global | free trade, protectionism, tariffs, exchange rates, balance of payments |
| Development | economic development, poverty & inequality, foreign aid |
Add more by editing econlens/data/ontology.yaml — see CONTRIBUTING.md.
Optional: more sources via NewsAPI
The free GDELT + RSS sources need no setup. To also query NewsAPI
(free tier: 100 requests/day, non-commercial), copy config.example.py to
config_local.py and add your key, or set the NEWSAPI_KEY environment variable.
config_local.py is git-ignored and never committed.
Roadmap
- Phase 1 — concept ontology + multi-source fetch + BM25 ranking (
econlens news) - Phase 2 — syllabus-organised practice questions (
econlens questions) - Phase 3 — spaced-repetition review (SM-2) (
econlens review) - Phase 4 — optional Streamlit web UI
Design & contributing
The ranking model, ontology design, and source handling are documented in
docs/DESIGN.md. To add concepts, keywords, or news sources, see
CONTRIBUTING.md.
License
MIT — see LICENSE.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file econlens-0.1.0.tar.gz.
File metadata
- Download URL: econlens-0.1.0.tar.gz
- Upload date:
- Size: 20.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3ceccd505de14cd128de0a62b6c78ccb54fa051ead3bc4408b2f554d8c9d505
|
|
| MD5 |
1b91de358d6b5559cccae3dad2cc7fd7
|
|
| BLAKE2b-256 |
19257cc36d6d3d93c5f19dd0e801c021deb439c905482f57efee08766bbbcc8e
|
Provenance
The following attestation bundles were made for econlens-0.1.0.tar.gz:
Publisher:
publish.yml on HarryXin0919/econlens
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
econlens-0.1.0.tar.gz -
Subject digest:
a3ceccd505de14cd128de0a62b6c78ccb54fa051ead3bc4408b2f554d8c9d505 - Sigstore transparency entry: 1693313716
- Sigstore integration time:
-
Permalink:
HarryXin0919/econlens@2a18a07538100096c8f62df78d3b7b131f9ac9c0 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/HarryXin0919
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2a18a07538100096c8f62df78d3b7b131f9ac9c0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file econlens-0.1.0-py3-none-any.whl.
File metadata
- Download URL: econlens-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd36f315a12e5528ab2bbbdb5753773e879708184abfda464f41c955708806e1
|
|
| MD5 |
15426dd299bb3c4661d8a6238e075caf
|
|
| BLAKE2b-256 |
f7ce37bd8d957d1f08e3583de14f4d883088ae4c6cb991b9f468a4d4e47ecb48
|
Provenance
The following attestation bundles were made for econlens-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on HarryXin0919/econlens
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
econlens-0.1.0-py3-none-any.whl -
Subject digest:
cd36f315a12e5528ab2bbbdb5753773e879708184abfda464f41c955708806e1 - Sigstore transparency entry: 1693313954
- Sigstore integration time:
-
Permalink:
HarryXin0919/econlens@2a18a07538100096c8f62df78d3b7b131f9ac9c0 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/HarryXin0919
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2a18a07538100096c8f62df78d3b7b131f9ac9c0 -
Trigger Event:
push
-
Statement type: