macro-indicators


Namemacro-indicators JSON
Version 0.0.3 PyPI version JSON
download
home_pageNone
SummaryPython client for the Macroeconomy Indicators API
upload_time2025-08-17 01:42:58
maintainerNone
docs_urlNone
authorPantarbengt
requires_python>=3.9
licenseMIT
keywords api economics macro
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # macro-indicators

Python client for the **Macroeconomy Indicators API** (World Bank data).  

- **No dependencies** beyond `requests`
- **Function-based API**
- **Annual data** (2000–present)
- **10 key macroeconomic indicators** (GDP, inflation, unemployment, M2, debt-to-GDP, etc.)
- **Country coverage**: ~180 countries with available World Bank data
- **Data source**: [World Bank Open Data](https://data.worldbank.org/)
- **Updates**: monthly snapshots

---

## Installation

```bash
pip install macro-indicators
```

---

## Quick usage

```python
from macro_indicators import root, get_country_codes, get_country_data

print(root())
# {"message": "Welcome to the Macroeconomy Indicators API"}

codes = get_country_codes()
print("Sample:", codes[:5])

data = get_country_data("SWE", "M2_LCU", 2010, 2015)
print("Years:", data["years"])
print("Values:", data["values"])
```

---

## Error handling

This client raises typed exceptions and forwards the server’s detail messages:

- `BadRequest (400)`: invalid parameter bounds (e.g. years out of range)
- `NotFound (404)`: missing country or indicator
- `MacroAPIError`: other HTTP/network errors

---

## API reference

- `root() -> dict`
- `get_country_codes() -> list[str]`
- `get_countries_with_names() -> dict[str, str]`
- `get_indicators() -> list[dict]`
- `get_country_data(country_code: str, indicator: str, start_year: int, end_year: int) -> dict`

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "macro-indicators",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "api, economics, macro",
    "author": "Pantarbengt",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/72/35/47483aa760089e16cf0a79d2d507a1d6f7824ea9c670da10220ce5074b61/macro_indicators-0.0.3.tar.gz",
    "platform": null,
    "description": "# macro-indicators\n\nPython client for the **Macroeconomy Indicators API** (World Bank data).  \n\n- **No dependencies** beyond `requests`\n- **Function-based API**\n- **Annual data** (2000\u2013present)\n- **10 key macroeconomic indicators** (GDP, inflation, unemployment, M2, debt-to-GDP, etc.)\n- **Country coverage**: ~180 countries with available World Bank data\n- **Data source**: [World Bank Open Data](https://data.worldbank.org/)\n- **Updates**: monthly snapshots\n\n---\n\n## Installation\n\n```bash\npip install macro-indicators\n```\n\n---\n\n## Quick usage\n\n```python\nfrom macro_indicators import root, get_country_codes, get_country_data\n\nprint(root())\n# {\"message\": \"Welcome to the Macroeconomy Indicators API\"}\n\ncodes = get_country_codes()\nprint(\"Sample:\", codes[:5])\n\ndata = get_country_data(\"SWE\", \"M2_LCU\", 2010, 2015)\nprint(\"Years:\", data[\"years\"])\nprint(\"Values:\", data[\"values\"])\n```\n\n---\n\n## Error handling\n\nThis client raises typed exceptions and forwards the server\u2019s detail messages:\n\n- `BadRequest (400)`: invalid parameter bounds (e.g. years out of range)\n- `NotFound (404)`: missing country or indicator\n- `MacroAPIError`: other HTTP/network errors\n\n---\n\n## API reference\n\n- `root() -> dict`\n- `get_country_codes() -> list[str]`\n- `get_countries_with_names() -> dict[str, str]`\n- `get_indicators() -> list[dict]`\n- `get_country_data(country_code: str, indicator: str, start_year: int, end_year: int) -> dict`\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python client for the Macroeconomy Indicators API",
    "version": "0.0.3",
    "project_urls": {
        "Homepage": "https://github.com/Pantarbengt/macro-indicators",
        "Issues": "https://github.com/Pantarbengt/macro-indicators/issues",
        "Source": "https://github.com/Pantarbengt/macro-indicators"
    },
    "split_keywords": [
        "api",
        " economics",
        " macro"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "552fbad35ad8372d5264a9e5372589215f9e21549be766f2f34d55b02659625f",
                "md5": "387f91043eebc45149c5b333ec9fc65b",
                "sha256": "7704291cb89b88291eff6340829473dcbd88ec93af9e9ce51c14185031c31262"
            },
            "downloads": -1,
            "filename": "macro_indicators-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "387f91043eebc45149c5b333ec9fc65b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 4927,
            "upload_time": "2025-08-17T01:42:56",
            "upload_time_iso_8601": "2025-08-17T01:42:56.779165Z",
            "url": "https://files.pythonhosted.org/packages/55/2f/bad35ad8372d5264a9e5372589215f9e21549be766f2f34d55b02659625f/macro_indicators-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "723547483aa760089e16cf0a79d2d507a1d6f7824ea9c670da10220ce5074b61",
                "md5": "c06e72dd723e646010e5176feff5c6ed",
                "sha256": "8eb8c06b7a1abd5e97c3f3802bdf5a3384ff25417b9d69d5dc6544efd76bb66f"
            },
            "downloads": -1,
            "filename": "macro_indicators-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "c06e72dd723e646010e5176feff5c6ed",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 4947,
            "upload_time": "2025-08-17T01:42:58",
            "upload_time_iso_8601": "2025-08-17T01:42:58.217626Z",
            "url": "https://files.pythonhosted.org/packages/72/35/47483aa760089e16cf0a79d2d507a1d6f7824ea9c670da10220ce5074b61/macro_indicators-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-17 01:42:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Pantarbengt",
    "github_project": "macro-indicators",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "macro-indicators"
}
        
Elapsed time: 1.74246s