A Python client for downloading, caching, and exploring
Quality of Government (QoG) Institute datasets.
pyqog was developed as a teaching tool for classroom exercises in Data Science courses
taught by Professor Danny de Castro at IDP – Instituto Brasileiro de Ensino,
Desenvolvimento e Pesquisa (Brazil).
This package facilitates access to Quality of Government Institute data for educational and academic research purposes. For official data and authoritative information, please access the QoG Institute website directly:
🔗 https://www.gu.se/en/quality-government
Found a bug or have suggestions? Contact: danny.soares@idp.edu.br
The Quality of Government (QoG) Institute at the University of Gothenburg, Sweden, produces some of the most comprehensive comparative datasets in political science and public administration. Their data covers governance, corruption, social policy, environmental indicators, and much more for virtually every country in the world.
QoG datasets compile data from hundreds of sources (World Bank, UN, V-Dem, Transparency International, and many others) into easy-to-use, well-documented datasets. They are widely used by researchers, students, and policymakers around the world.
pyqog is a lightweight Python package that makes it easy to download, cache, and work with
QoG datasets directly from Python. It is inspired by the R package
rqog and provides a simple,
Pythonic interface for accessing the same data.
Download any QoG dataset with a single function call. CSV format only — clean and portable.
Automatic local caching so you download once and work offline. Force re-download when you need fresh data.
Returns pandas DataFrames ready for analysis. Filter, merge, plot — all with familiar tools.
pip install pyqog
import pyqog
# Download the basic time-series dataset (latest version)
df = pyqog.read_qog()
# Download standard cross-sectional data
df_std = pyqog.read_qog(which_data="standard", data_type="cross-sectional")
# Download an older version (2020)
df_old = pyqog.read_qog(which_data="basic", year=2020)
# List available datasets
pyqog.list_datasets()
# Search for variables containing "corrupt"
cols = pyqog.search_variables(df, "corrupt")
print(cols)
Check the Tutorial for detailed examples, the API Reference for full documentation, and the Datasets page for an overview of all available data.
When using QoG data, please cite:
Teorell, Jan, et al. 2026. The Quality of Government Standard Dataset, version Jan26. University of Gothenburg: The Quality of Government Institute, https://www.gu.se/en/quality-government