Registry / data / tradingeconomics

tradingeconomics

JSON →
library4.5.10pypypi✓ verified 87d ago

Python wrapper for the Trading Economics API, providing access to economic indicators, calendar events, commodities, currencies, bonds, and forecasts. Current version 4.5.9. Active development with irregular releases.

pip install tradingeconomics
INSTALL
IMPORT
SIG · TRADINGECONOMICS
T
tradingeconomics
datapythonv4.5.10
Install
8.1s avg
Import
1038ms
Disk
165MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v4.5.10 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 1.044s · 165.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 8.1s · import 1.032s · 158MB
165MB installed
● package 165MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

tradingeconomics
import tradingeconomics as te
te.login()
te.login('YOUR_KEY')
te.login('key')
Case-sensitive parameter name

Logs in with API key from env var and fetches GDP data for United States.

import tradingeconomics as te te.login(os.environ.get('TE_API_KEY', '')) data = te.getIndicatorData(country='United States', indicator='GDP') print(data)
Debug
Known issues
breakingVersion 4.x removed direct function access; all endpoints are now methods under the tradingeconomics module (e.g., te.getIndicatorData instead of standalone getIndicatorData). Rewrite imports and calls.
fix
Use module-level functions: import tradingeconomics as te then te.login() and te.getIndicatorData()
affects: 4.0+
gotchaThe login() function must be called before any data fetch. Missing leads to AuthenticationError.
fix
Always call te.login('YOUR_API_KEY') first.
affects: all
deprecatedgetCalendar() returns raw JSON; consider using getCalendarData() with filters for structured responses.
fix
Use getCalendarData() instead of getCalendar() for filtered results.
affects: 4.0 - 4.5.*
Errors
Common errors & fixes
tradingeconomics.exceptions.AuthenticationError: Authentication failed
Invalid API key or missing login call before data request.
fix
Ensure te.login('YOUR_API_KEY') is called and key is correct.
AttributeError: module 'tradingeconomics' has no attribute 'getIndicatorData'
Using version 3.x style direct function calls; version 4.x uses module-level functions.
fix
Update imports: use import tradingeconomics as te, then te.getIndicatorData().
TypeError: login() takes 0 positional arguments but 1 was given
Version 4.5.9 requires keyword argument: te.login(api_key='YOUR_KEY') or positional in older versions.
fix
Use te.login('YOUR_API_KEY') or te.login(api_key='YOUR_API_KEY') depending on version. Check docs.
Upgrade
Version history
4.5.10latest on PyPI · released May 12, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
OpenAI (training)
1
Resources
tradingeconomics — pip install tradingeconomics · libregistry