OWID Grapher Python¶
Create interactive Our World in Data charts in Jupyter notebooks.
This library provides a Python API for building charts using OWID's Grapher visualization library. It's useful for exploring datasets with interactive visualizations, creating publication-ready charts for research and education, and documenting data analysis in reproducible notebooks. The package integrates seamlessly with pandas DataFrames and renders directly in Jupyter environments.
Installation¶
Quick Example¶
import pandas as pd
from owid.grapher import Chart
df = pd.DataFrame({
'year': [2020, 2021, 2022],
'country': ['USA', 'USA', 'USA'],
'population': [331, 332, 333]
})
Chart(df).mark_line().encode(x='year', y='population')
Learn from more examples!
- Check out our Jupyter notebook!
- Check our examples on GitHub
Community & Support¶
- GitHub: owid/owid-grapher-py
- Issues: Report bugs or request features
- PyPI: owid-grapher-py
You can learn more about our data and engineering work here.
License¶
MIT License - see the LICENSE file for details.