Skip to main content

Python client for Quality of Government (QoG) Institute data

Project description

pyqog

PyPI version Python 3.9+ License: MIT


PT-BR: Desenvolvido como ferramenta didática para exercícios em sala de aula das disciplinas de Data Science do Professor Danny de Castro no IDP – Instituto Brasileiro de Ensino, Desenvolvimento e Pesquisa. Para dados oficiais: https://www.gu.se/en/quality-government | Contato: danny.soares@idp.edu.br

EN: Developed as a teaching tool for classroom exercises in Data Science courses by Professor Danny de Castro at IDP – Instituto Brasileiro de Ensino, Desenvolvimento e Pesquisa (Brazil). For official data: https://www.gu.se/en/quality-government | Contact: danny.soares@idp.edu.br


PT-BR

O que é o pyqog?

O pyqog é um pacote Python que facilita o download, cache e uso dos datasets do Quality of Government Institute (Universidade de Gotemburgo). Inspirado no pacote R rqog, este pacote permite acessar dados de governança, corrupção, democracia e outros indicadores políticos diretamente no Python.

Instalação

pip install pyqog

Uso rápido

import pyqog

# Baixar dados básicos (time-series, versão mais recente)
df = pyqog.read_qog()

# Baixar dados standard cross-sectional
df = pyqog.read_qog(which_data="standard", data_type="cross-sectional")

# Baixar versão antiga (2020)
df = pyqog.read_qog(which_data="basic", year=2020)

# Listar datasets disponíveis
pyqog.list_datasets()

# Ver versões disponíveis
pyqog.list_versions("standard")

# URL do codebook
url = pyqog.get_codebook_url("standard", 2026)

# Buscar variáveis com "corruption" no nome
cols = pyqog.search_variables(df, "corrupt")

# Info do dataset
info = pyqog.describe_dataset("basic")

Datasets disponíveis

Dataset Prefixo Descrição
basic bas Versão menor com indicadores-chave de governança
standard std O dataset QoG mais abrangente
oecd oecd Dados apenas para países membros da OCDE
environmental ei Indicadores de governança ambiental
social_policy soc Indicadores de política social

Documentação completa

Acesse: https://prof-danny-idp.github.io/pyqog/


EN

What is pyqog?

pyqog is a Python package that makes it easy to download, cache, and use datasets from the Quality of Government Institute (University of Gothenburg). Inspired by the R package rqog, this package lets you access governance, corruption, democracy, and other political indicators directly in Python.

Installation

pip install pyqog

Quick start

import pyqog

# Download basic time-series data (latest version)
df = pyqog.read_qog()

# Download standard cross-sectional data
df = pyqog.read_qog(which_data="standard", data_type="cross-sectional")

# Download an older version (2020)
df = pyqog.read_qog(which_data="basic", year=2020)

# List available datasets
pyqog.list_datasets()

# List available versions
pyqog.list_versions("standard")

# Get codebook URL
url = pyqog.get_codebook_url("standard", 2026)

# Search for variables with "corruption" in the name
cols = pyqog.search_variables(df, "corrupt")

# Get dataset info
info = pyqog.describe_dataset("basic")

Available datasets

Dataset Prefix Description
basic bas Smaller version with key governance indicators
standard std The most comprehensive QoG dataset
oecd oecd Data for OECD member countries only
environmental ei Environmental governance indicators
social_policy soc Social policy indicators

Full documentation

Visit: https://prof-danny-idp.github.io/pyqog/


Citation / Citação

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

License / Licença

MIT License. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyqog-0.1.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyqog-0.1.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file pyqog-0.1.0.tar.gz.

File metadata

  • Download URL: pyqog-0.1.0.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyqog-0.1.0.tar.gz
Algorithm Hash digest
SHA256 829d2c1dfac733f7458c4197ccb231dae8624514768fd214f56605a734c360f0
MD5 717d98fc66adb7809e2d6fa227c32b9f
BLAKE2b-256 ed5679993498c23a1462da2fa7f3944a559c5f4fcae144801810610b4d8e81b2

See more details on using hashes here.

File details

Details for the file pyqog-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyqog-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyqog-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5a477d16eb0d998bd1001bfc6752665b174bd15f59965d9d39da1108ba388bd4
MD5 d663cd53d8f6dc9d11005ea893d1a465
BLAKE2b-256 f4b4e16fd71a8f3e0b062e6a75bbda1350fc4edb6067c4cefd20d1d47ac3816f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page