econdash 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,11 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .venv/
4
+ dist/
5
+ build/
6
+ *.egg-info/
7
+ .pytest_cache/
8
+ .mypy_cache/
9
+ .ruff_cache/
10
+ .ipynb_checkpoints/
11
+ .env
@@ -0,0 +1,17 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. The project follows
4
+ [Semantic Versioning](https://semver.org/).
5
+
6
+ ## [0.1.0] - 2026-10-11
7
+
8
+ ### Added
9
+ - `EconDash` (sync) and `AsyncEconDash` (async) clients on httpx.
10
+ - `search_indicators`, `list_indicators`, `get_indicator`, `get_series`, `list_countries`,
11
+ `top_countries`, `cite`.
12
+ - Pydantic v2 models: `Indicator`, `Series`, `Point`, `Country`, `TopCountries`, `TopCountry`,
13
+ `Citation`.
14
+ - Exceptions: `EconDashAuthError`, `EconDashNotFound`, `EconDashRateLimitError` (`retry_after`),
15
+ `EconDashPaymentRequired` (decoded x402 challenge).
16
+ - Optional x402 pay-per-call (`econdash[x402]`), off by default and capped by `max_usd_per_call`.
17
+ - Free trial works without an API key; `ECONDASH_API_KEY` or `api_key=` for full access.
@@ -0,0 +1,19 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use this software or EconDash data, please cite it as below. Also cite the original data source shown for each indicator."
3
+ type: software
4
+ title: "econdash: Python client for the EconDash macroeconomic data API"
5
+ abstract: "Python client for EconDash (econdash.org): 750+ macroeconomic indicators for 290+ countries with source, licence and freshness metadata."
6
+ authors:
7
+ - name: EconDash
8
+ website: "https://econdash.org"
9
+ version: 0.1.0
10
+ date-released: "2026-10-11"
11
+ license: MIT
12
+ url: "https://econdash.org"
13
+ repository-code: "https://github.com/econdash/econdash-python"
14
+ keywords:
15
+ - economics
16
+ - macroeconomics
17
+ - time series
18
+ - open data
19
+ - api client
econdash-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 EconDash
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,162 @@
1
+ Metadata-Version: 2.5
2
+ Name: econdash
3
+ Version: 0.1.0
4
+ Summary: Python client for the EconDash macroeconomic data API: 750+ indicators, 290+ countries, sources and licences.
5
+ Project-URL: Homepage, https://econdash.org
6
+ Project-URL: Documentation, https://econdash.org/docs/python
7
+ Project-URL: Repository, https://github.com/econdash/econdash-python
8
+ Project-URL: Issues, https://github.com/econdash/econdash-python/issues
9
+ Project-URL: Changelog, https://github.com/econdash/econdash-python/blob/main/CHANGELOG.md
10
+ Author-email: EconDash <noderguru@gmail.com>
11
+ License-Expression: MIT
12
+ License-File: LICENSE
13
+ Keywords: api,economics,gdp,imf,inflation,macroeconomics,time-series,world-bank,x402
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Topic :: Office/Business :: Financial
24
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
25
+ Classifier: Typing :: Typed
26
+ Requires-Python: >=3.10
27
+ Requires-Dist: httpx>=0.27
28
+ Requires-Dist: pydantic>=2.5
29
+ Provides-Extra: x402
30
+ Requires-Dist: x402[evm]<3,>=2.25; extra == 'x402'
31
+ Description-Content-Type: text/markdown
32
+
33
+ # econdash
34
+
35
+ [![PyPI](https://img.shields.io/pypi/v/econdash)](https://pypi.org/project/econdash/)
36
+ [![CI](https://github.com/econdash/econdash-python/actions/workflows/ci.yml/badge.svg)](https://github.com/econdash/econdash-python/actions/workflows/ci.yml)
37
+ [![Python](https://img.shields.io/pypi/pyversions/econdash)](https://pypi.org/project/econdash/)
38
+
39
+ Python client for the [EconDash](https://econdash.org) macroeconomic data API: 750+ indicators
40
+ (GDP, inflation, debt, trade, labour, money supply, …) for 290+ countries and regions, with
41
+ source, licence and freshness metadata for every series.
42
+
43
+ ```bash
44
+ pip install econdash
45
+ ```
46
+
47
+ ```python
48
+ from econdash import EconDash
49
+
50
+ ed = EconDash() # free trial, no key needed
51
+
52
+ ed.search_indicators("inflation")[:3] # -> list[Indicator]
53
+ ed.get_indicator("gdp-nominal") # metadata, source, licence, freshness
54
+ s = ed.get_series("gdp-nominal", "USA", start=2000)
55
+ s.data[-1] # Point(date=2025-01-01, value=3.07e13, ...)
56
+ ed.list_countries() # -> list[Country]
57
+ ed.top_countries("gdp-nominal", year=2024, limit=10)
58
+ ed.cite(
59
+ "gdp-nominal", "USA"
60
+ ).citation.text # 'United States GDP nominal was $30.77 tn in 2025 (World Bank, ...)'
61
+ ```
62
+
63
+ Indicators can be addressed by slug (`gdp-nominal`, as in
64
+ `econdash.org/chart/gdp-nominal/USA`) or by code (`world_bank__gdp_nominal`).
65
+ `start`/`end` accept `2000`, `"2000-06"`, `"2000-06-30"` or a `date`.
66
+
67
+ ## Free trial vs API key
68
+
69
+ Without a key the client works on the **free trial**:
70
+
71
+ | Limit | Trial |
72
+ |---|---|
73
+ | Requests | 300 per day, 30 per minute (per IP) |
74
+ | Countries | 10: USA, CHN, DEU, JPN, GBR, FRA, IND, BRA, RUS, KOR |
75
+ | Indicators | 50 core series (GDP, CPI, money supply, debt, trade, …) |
76
+
77
+ Outside the trial the API answers `403` and the client raises `EconDashAuthError`
78
+ ("Country ZWE not available in trial"). That is the trial limit, not a bug.
79
+
80
+ For full access create a key at [econdash.org/dashboard/api-keys](https://econdash.org/dashboard/api-keys)
81
+ ([plans](https://econdash.org/api-access)) and pass it:
82
+
83
+ ```python
84
+ ed = EconDash(api_key="ed_...") # or set ECONDASH_API_KEY
85
+ ```
86
+
87
+ ## Async
88
+
89
+ ```python
90
+ from econdash import AsyncEconDash
91
+
92
+ async with AsyncEconDash() as ed:
93
+ series = await ed.get_series("cpi-inflation-rate-percent", "DEU", start=2010)
94
+ ```
95
+
96
+ ## Errors
97
+
98
+ | Exception | When |
99
+ |---|---|
100
+ | `EconDashAuthError` | 401/403: bad key, inactive subscription, data outside the trial |
101
+ | `EconDashNotFound` | 404: unknown indicator or country |
102
+ | `EconDashRateLimitError` | 429, `retry_after` in seconds |
103
+ | `EconDashPaymentRequired` | 402, `challenge` holds the x402 payment requirements |
104
+ | `EconDashError` | base class, anything else |
105
+
106
+ ## Pay per call with x402 (for AI agents)
107
+
108
+ Agents without an account can pay each call in USDC on Base via
109
+ [x402](https://www.x402.org) ($0.02 per call at the time of writing). It is **off by
110
+ default**: the client never spends money unless you turn it on and set a cap.
111
+
112
+ ```bash
113
+ pip install "econdash[x402]"
114
+ ```
115
+
116
+ ```python
117
+ import os
118
+
119
+ from eth_account import Account
120
+ from econdash import EconDash
121
+
122
+ ed = EconDash(
123
+ pay_with_x402=True,
124
+ x402_signer=Account.from_key(os.environ["AGENT_PRIVATE_KEY"]),
125
+ max_usd_per_call=0.05, # x402 refuses to sign anything more expensive
126
+ )
127
+ ed.get_series("gdp-nominal", "ZWE")
128
+ ```
129
+
130
+ If the price is above `max_usd_per_call`, nothing is signed and `EconDashPaymentRequired`
131
+ is raised. Keep agent wallets funded with small amounts only.
132
+
133
+ ## Examples
134
+
135
+ Notebooks in [`examples/`](examples/): search → series → pandas chart, comparing countries,
136
+ a LangChain agent, an agent paying with x402.
137
+
138
+ ## Data and licences
139
+
140
+ Every `Indicator` carries `source`, `source_url`, `license_name`, `license_url` and
141
+ `attribution_text`. Source licences differ (World Bank CC BY 4.0, IMF, OECD, FRED, …);
142
+ see [econdash.org/data-license](https://econdash.org/data-license). Please keep the
143
+ attribution when you publish charts or numbers.
144
+
145
+ ## Links
146
+
147
+ - Website: <https://econdash.org>
148
+ - API docs: <https://econdash.org/docs>, OpenAPI: <https://econdash.org/openapi.json>
149
+ - Python docs: <https://econdash.org/docs/python>
150
+
151
+ ## Development
152
+
153
+ ```bash
154
+ uv sync --all-extras
155
+ uv run pytest # offline tests on recorded API answers
156
+ uv run pytest -m live # contract tests against the real API
157
+ uv run ruff check . && uv run mypy
158
+ ```
159
+
160
+ Releases are published to PyPI from GitHub Actions on a GitHub Release (trusted publishing).
161
+
162
+ MIT licence. The data itself is licensed by its original sources.
@@ -0,0 +1,130 @@
1
+ # econdash
2
+
3
+ [![PyPI](https://img.shields.io/pypi/v/econdash)](https://pypi.org/project/econdash/)
4
+ [![CI](https://github.com/econdash/econdash-python/actions/workflows/ci.yml/badge.svg)](https://github.com/econdash/econdash-python/actions/workflows/ci.yml)
5
+ [![Python](https://img.shields.io/pypi/pyversions/econdash)](https://pypi.org/project/econdash/)
6
+
7
+ Python client for the [EconDash](https://econdash.org) macroeconomic data API: 750+ indicators
8
+ (GDP, inflation, debt, trade, labour, money supply, …) for 290+ countries and regions, with
9
+ source, licence and freshness metadata for every series.
10
+
11
+ ```bash
12
+ pip install econdash
13
+ ```
14
+
15
+ ```python
16
+ from econdash import EconDash
17
+
18
+ ed = EconDash() # free trial, no key needed
19
+
20
+ ed.search_indicators("inflation")[:3] # -> list[Indicator]
21
+ ed.get_indicator("gdp-nominal") # metadata, source, licence, freshness
22
+ s = ed.get_series("gdp-nominal", "USA", start=2000)
23
+ s.data[-1] # Point(date=2025-01-01, value=3.07e13, ...)
24
+ ed.list_countries() # -> list[Country]
25
+ ed.top_countries("gdp-nominal", year=2024, limit=10)
26
+ ed.cite(
27
+ "gdp-nominal", "USA"
28
+ ).citation.text # 'United States GDP nominal was $30.77 tn in 2025 (World Bank, ...)'
29
+ ```
30
+
31
+ Indicators can be addressed by slug (`gdp-nominal`, as in
32
+ `econdash.org/chart/gdp-nominal/USA`) or by code (`world_bank__gdp_nominal`).
33
+ `start`/`end` accept `2000`, `"2000-06"`, `"2000-06-30"` or a `date`.
34
+
35
+ ## Free trial vs API key
36
+
37
+ Without a key the client works on the **free trial**:
38
+
39
+ | Limit | Trial |
40
+ |---|---|
41
+ | Requests | 300 per day, 30 per minute (per IP) |
42
+ | Countries | 10: USA, CHN, DEU, JPN, GBR, FRA, IND, BRA, RUS, KOR |
43
+ | Indicators | 50 core series (GDP, CPI, money supply, debt, trade, …) |
44
+
45
+ Outside the trial the API answers `403` and the client raises `EconDashAuthError`
46
+ ("Country ZWE not available in trial"). That is the trial limit, not a bug.
47
+
48
+ For full access create a key at [econdash.org/dashboard/api-keys](https://econdash.org/dashboard/api-keys)
49
+ ([plans](https://econdash.org/api-access)) and pass it:
50
+
51
+ ```python
52
+ ed = EconDash(api_key="ed_...") # or set ECONDASH_API_KEY
53
+ ```
54
+
55
+ ## Async
56
+
57
+ ```python
58
+ from econdash import AsyncEconDash
59
+
60
+ async with AsyncEconDash() as ed:
61
+ series = await ed.get_series("cpi-inflation-rate-percent", "DEU", start=2010)
62
+ ```
63
+
64
+ ## Errors
65
+
66
+ | Exception | When |
67
+ |---|---|
68
+ | `EconDashAuthError` | 401/403: bad key, inactive subscription, data outside the trial |
69
+ | `EconDashNotFound` | 404: unknown indicator or country |
70
+ | `EconDashRateLimitError` | 429, `retry_after` in seconds |
71
+ | `EconDashPaymentRequired` | 402, `challenge` holds the x402 payment requirements |
72
+ | `EconDashError` | base class, anything else |
73
+
74
+ ## Pay per call with x402 (for AI agents)
75
+
76
+ Agents without an account can pay each call in USDC on Base via
77
+ [x402](https://www.x402.org) ($0.02 per call at the time of writing). It is **off by
78
+ default**: the client never spends money unless you turn it on and set a cap.
79
+
80
+ ```bash
81
+ pip install "econdash[x402]"
82
+ ```
83
+
84
+ ```python
85
+ import os
86
+
87
+ from eth_account import Account
88
+ from econdash import EconDash
89
+
90
+ ed = EconDash(
91
+ pay_with_x402=True,
92
+ x402_signer=Account.from_key(os.environ["AGENT_PRIVATE_KEY"]),
93
+ max_usd_per_call=0.05, # x402 refuses to sign anything more expensive
94
+ )
95
+ ed.get_series("gdp-nominal", "ZWE")
96
+ ```
97
+
98
+ If the price is above `max_usd_per_call`, nothing is signed and `EconDashPaymentRequired`
99
+ is raised. Keep agent wallets funded with small amounts only.
100
+
101
+ ## Examples
102
+
103
+ Notebooks in [`examples/`](examples/): search → series → pandas chart, comparing countries,
104
+ a LangChain agent, an agent paying with x402.
105
+
106
+ ## Data and licences
107
+
108
+ Every `Indicator` carries `source`, `source_url`, `license_name`, `license_url` and
109
+ `attribution_text`. Source licences differ (World Bank CC BY 4.0, IMF, OECD, FRED, …);
110
+ see [econdash.org/data-license](https://econdash.org/data-license). Please keep the
111
+ attribution when you publish charts or numbers.
112
+
113
+ ## Links
114
+
115
+ - Website: <https://econdash.org>
116
+ - API docs: <https://econdash.org/docs>, OpenAPI: <https://econdash.org/openapi.json>
117
+ - Python docs: <https://econdash.org/docs/python>
118
+
119
+ ## Development
120
+
121
+ ```bash
122
+ uv sync --all-extras
123
+ uv run pytest # offline tests on recorded API answers
124
+ uv run pytest -m live # contract tests against the real API
125
+ uv run ruff check . && uv run mypy
126
+ ```
127
+
128
+ Releases are published to PyPI from GitHub Actions on a GitHub Release (trusted publishing).
129
+
130
+ MIT licence. The data itself is licensed by its original sources.
@@ -0,0 +1,78 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "econdash"
7
+ dynamic = ["version"]
8
+ description = "Python client for the EconDash macroeconomic data API: 750+ indicators, 290+ countries, sources and licences."
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ license-files = ["LICENSE"]
12
+ requires-python = ">=3.10"
13
+ authors = [{ name = "EconDash", email = "noderguru@gmail.com" }]
14
+ keywords = ["economics", "macroeconomics", "gdp", "inflation", "time-series", "api", "x402", "world-bank", "imf"]
15
+ classifiers = [
16
+ "Development Status :: 4 - Beta",
17
+ "Intended Audience :: Developers",
18
+ "Intended Audience :: Science/Research",
19
+ "Operating System :: OS Independent",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.10",
22
+ "Programming Language :: Python :: 3.11",
23
+ "Programming Language :: Python :: 3.12",
24
+ "Programming Language :: Python :: 3.13",
25
+ "Topic :: Scientific/Engineering :: Information Analysis",
26
+ "Topic :: Office/Business :: Financial",
27
+ "Typing :: Typed",
28
+ ]
29
+ dependencies = [
30
+ "httpx>=0.27",
31
+ "pydantic>=2.5",
32
+ ]
33
+
34
+ [project.optional-dependencies]
35
+ x402 = ["x402[evm]>=2.25,<3"]
36
+
37
+ [project.urls]
38
+ Homepage = "https://econdash.org"
39
+ Documentation = "https://econdash.org/docs/python"
40
+ Repository = "https://github.com/econdash/econdash-python"
41
+ Issues = "https://github.com/econdash/econdash-python/issues"
42
+ Changelog = "https://github.com/econdash/econdash-python/blob/main/CHANGELOG.md"
43
+
44
+ [dependency-groups]
45
+ dev = [
46
+ "pytest>=8",
47
+ "pytest-asyncio>=0.23",
48
+ "respx>=0.21",
49
+ "ruff>=0.6",
50
+ "mypy>=1.10",
51
+ ]
52
+
53
+ [tool.hatch.version]
54
+ path = "src/econdash/__init__.py"
55
+
56
+ [tool.hatch.build.targets.sdist]
57
+ include = ["src", "tests", "README.md", "CHANGELOG.md", "LICENSE", "CITATION.cff"]
58
+
59
+ [tool.pytest.ini_options]
60
+ testpaths = ["tests"]
61
+ asyncio_mode = "auto"
62
+ markers = ["live: hits the real EconDash API (run with -m live)"]
63
+ addopts = "-m 'not live'"
64
+
65
+ [tool.ruff]
66
+ line-length = 100
67
+ target-version = "py310"
68
+
69
+ [tool.ruff.lint]
70
+ select = ["E", "F", "W", "I", "UP", "B"]
71
+
72
+ [tool.mypy]
73
+ strict = true
74
+ packages = ["econdash"]
75
+
76
+ [[tool.mypy.overrides]]
77
+ module = ["x402", "x402.*"]
78
+ ignore_missing_imports = true
@@ -0,0 +1,40 @@
1
+ """Python client for the EconDash macroeconomic data API (https://econdash.org)."""
2
+
3
+ __version__ = "0.1.0"
4
+
5
+ from ._client import DEFAULT_BASE_URL, AsyncEconDash, EconDash # noqa: E402
6
+ from .errors import ( # noqa: E402
7
+ EconDashAuthError,
8
+ EconDashError,
9
+ EconDashNotFound,
10
+ EconDashPaymentRequired,
11
+ EconDashRateLimitError,
12
+ )
13
+ from .models import ( # noqa: E402
14
+ Citation,
15
+ Country,
16
+ Indicator,
17
+ Point,
18
+ Series,
19
+ TopCountries,
20
+ TopCountry,
21
+ )
22
+
23
+ __all__ = [
24
+ "DEFAULT_BASE_URL",
25
+ "AsyncEconDash",
26
+ "Citation",
27
+ "Country",
28
+ "EconDash",
29
+ "EconDashAuthError",
30
+ "EconDashError",
31
+ "EconDashNotFound",
32
+ "EconDashPaymentRequired",
33
+ "EconDashRateLimitError",
34
+ "Indicator",
35
+ "Point",
36
+ "Series",
37
+ "TopCountries",
38
+ "TopCountry",
39
+ "__version__",
40
+ ]