Skip to content

fccoelho/ghoclient

Repository files navigation

GHOclient

Sponsored by Kwar-AI

Sponsored by Kwar-AI - AI-powered epidemiological intelligence


PyPI version Python versions License Tests Publish Documentation

Introduction

The WHO Global Health Observatory is a large global health data repository that makes available an enormous collection of indicators which can be downloaded through their API. GHOclient is a Python client which helps data scientists search and access their data programmatically.

Installation

Using pip:

pip install ghoclient

Using uv:

uv pip install ghoclient

For development:

git clone https://github.com/fccoelho/ghoclient.git
cd ghoclient
uv sync --extra dev

Features

  • Search for indicators by keyword
  • Browse available datasets
  • List region and country codes
  • Get the data as pandas DataFrames

Example usage

Basic usage with the GHO class:

from ghoclient import GHO

gho = GHO()

# Get all available indicators
indicators = gho.get_indicators()

# Search for specific indicators
malaria_indicators = gho.search_indicators('malaria')

# Get data for a specific indicator
life_expectancy = gho.get_data('WHOSIS_000001', countries=['BRA', 'USA'])

Legacy usage with index search:

import ghoclient
ghoclient.index.search('smoking')

The above lines will fetch a DataFrame with all indicators containing the word smoking in their description.

API Reference

GHO Class

Main interface for accessing WHO GHO data.

  • get_indicators()

    Returns a DataFrame with all available indicators.

  • search_indicators(query)

    Search for indicators containing the query string.

    • query: Search term
    • Returns: DataFrame with matching indicators
  • get_data(code, countries=None, filter_query=None)

    Get data for a specific indicator.

    • code: Indicator code (e.g., 'WHOSIS_000001')
    • countries: Optional list of country codes to filter by
    • filter_query: Optional OData filter query string
    • Returns: DataFrame with the requested data

GHOSession Class

Low-level session class for direct API access.

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

About

WHO's Global Health observatory's Python client

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors