This package provides Python access to the Global Macro Database (GMD).
Install the latest published release from PyPI:
pip install global-macro-dataInstall the latest code directly from GitHub:
pip install git+https://github.com/KMueller-Lab/Global-Macro-Database-Python.gitInstall a specific Git ref from GitHub:
pip install git+https://github.com/KMueller-Lab/Global-Macro-Database-Python.git@<tag-or-commit>Upgrade an existing PyPI install:
pip install --upgrade global-macro-dataUpgrade an existing GitHub install:
pip install --upgrade --force-reinstall git+https://github.com/KMueller-Lab/Global-Macro-Database-Python.gitfrom global_macro_data import gmd
# Latest dataset
full_df = gmd()
# Specific vintage
df = gmd(version="2025_12")
# Filter countries and variables
subset = gmd(
version="2025_12",
country=["USA", "CHN"],
variables=["rGDP", "infl", "unemp"],
)
# Raw source-level data for one variable
raw_rgdp = gmd(variables="rGDP", raw=True, version="2025_12")
# Load helper tables
varlist_df = gmd(vars="load")
country_df = gmd(country="load")
source_df = gmd(sources="load")
bib_df = gmd(cite="load")
# Print citations
gmd(cite="GMD")
gmd(print_option="GMD")The gmd() function supports the following options:
| Parameter | Values | Description |
|---|---|---|
version |
"YYYY_MM", "current", "list" |
Select data vintage |
country |
ISO3 code(s), "load", "list" |
Filter by country |
variables |
Variable code(s) | Select specific variables |
raw |
True / False |
Load raw source-level data |
vars |
"load", "list" |
Load or display variable definitions |
sources |
Source name, "load", "list" |
Query specific data sources |
cite |
Source key, "load" |
Retrieve BibTeX citations |
print_option |
"GMD", "Stata" |
Print APA-style citations |
fast |
"yes" or True |
Cache data locally for faster reloading |
network |
"yes" |
Override network detection |
Helper functions are also available:
get_available_versions()-- list all data vintagesget_current_version()-- get the latest version stringlist_variables()-- print the variable tablelist_countries()-- print the country table
When using the Global Macro Database, please cite:
@techreport{mueller2025global,
title = {The Global Macro Database: A New International Macroeconomic Dataset},
author = {M{\"u}ller, Karsten and Xu, Chenzi and Lehbib, Mohamed and Chen, Ziliang},
year = {2025},
institution = {National Bureau of Economic Research},
type = {Working Paper},
number = {33714}
}