Skip to main content

geo4bolivia: spatial data science for Bolivia's subnational development data

geo4bolivia

Find, load, map and analyse Bolivia's subnational development data, in Python.

PyPI Python CI Docs Open In Colab License: MIT

geo4bolivia is the Python package of the GeoDevelopment Observatory of Bolivia. It gives you the observatory's data for 343 municipalities, 113 provinces and 9 departments, and the standard analyses of spatial data science, each in one call.

Documentation: https://quarcs-lab.github.io/geo4bolivia/

Install

!pip install -q geo4bolivia          # Google Colab, or any Python 3.11+ environment
import geo4bolivia as geo

Open in Colab

The default install covers loading, maps and the core analyses. Extras add the libraries of a few methods: geo4bolivia[dynamics] (Markov transitions), [mgwr] (multiscale GWR), [panel] (panel models), [raster] (zonal statistics), or [all].

At a glance

!pip install -q geo4bolivia
import geo4bolivia as geo

geo.search("poverty")                                  # find variables in every dataset
mpi = geo.load("sdg01", variables="sdg1_2_mpi", groups=["department"])   # a panel with names
geo.map(mpi, "sdg1_2_mpi", year=[2012, 2024], scheme="fisher_jenks")     # both periods, common classes

res = geo.lisa(mpi, "sdg1_2_mpi", year=2024)           # where are the clusters of poverty?
print(res.interpret())                                 # a reading of the numbers in words
res.fig                                                # Moran scatterplot and cluster map, side by side

Open in Colab

Every analysis function takes a dataset id or a table with a geo_id column, finds the boundaries, the spatial weights and the labels itself, and returns a result object with .fig (Plotly), .df, .gt (a formatted table where one helps), the numbers by name and .interpret().

What it does

You want to know Functions
What data are there, and what do they mean? datasets, search, info, dictionary, reference_years, cite
Load them, with names, boundaries and coarser scales load, units, boundaries, change, aggregate, combine
What does a variable look like? describe, distribution, extremes, correlation, scatter, trend
Is it clustered in space, and where? map, weights, connectivity, moran, lisa
Are the units that started lower catching up? beta_convergence, sigma_convergence, convergence_clubs
Who moved, and do neighbours matter? rank_mobility, lisa_transitions, transitions, spatial_transitions
How unequal are the units, between or within which groups? inequality, theil_decomposition
What goes with what, once space is accounted for? regression, panel_model, spatial_diagnostics, spatial_model
Does an association change from place to place? mgwr
Bring your own table or raster link, check, zonal, overlay, save

The articles take one question each and work it through on Bolivia's data; the function reference has an example for every function.

The data

The package reads the observatory's published files from quarcs-lab/gdo4bolivia; ref="v0.7.2" freezes them at a release.

Dataset What Units and years
sdg, sdg01 to sdg17 Atlas de los ODS en Bolivia 2026 (Andersen & Argandoña, SDSN Bolivia): the Sustainable Development Index, 15 goal indices and 81 indicators 343 municipalities, about 2012 and about 2024
pop Population (WorldPop) and density 333 municipalities, 2001 to 2020
ntl Night-time lights per capita (VIIRS) 333 municipalities, 2012 to 2020
emb, embpw Satellite embeddings, 64 dimensions 333 municipalities, 2017

geo.info(dataset) gives each dataset's sources and licenses and geo.cite(dataset) the citation and the credits they require. The boundaries are SDSN Bolivia's municipal map of 2025, used with its permission.

Without the package, the same files are plain CSV and Parquet:

import pandas as pd

BASE = "https://raw.githubusercontent.com/quarcs-lab/gdo4bolivia/main/"
pd.read_csv(BASE + "data/municipality/sdg.csv")

Open in Colab

Sister packages

geo4bolivia covers the fundamentals. For specialised methods, geo.for_expdpy() and geo.for_geometrics() hand any panel to its sister packages: expdpy (panel econometrics) and geometrics (regional convergence and spatial econometrics), from which geo4bolivia's analysis engine is ported.

Development

uv sync --all-extras                 # environment
uv run pytest -n 6 -p no:warnings    # tests (the data tests read a checkout of gdo4bolivia next to this repo, or GitHub)
uv run ruff check src tests          # lint
uv run python tools/build_docs.py    # documentation site, into docs/_site

CLAUDE.md describes the layout and conventions, RELEASING.md how to publish, and TEMPLATE.md what is generic and can be reused for another country.

Cite

Mendez, C. (2026). geo4bolivia: spatial data science for Bolivia's subnational development data (version 0.7.2). https://quarcs-lab.github.io/geo4bolivia/

Please also cite the sources of the datasets you use (geo.cite(dataset)).

License

Code: MIT. The data have their own licenses, documented per dataset in the data repository. Parts of the package are ported from geometrics and follow the design of expdpy, a Python port of ExPanDaR, all MIT.

Metadata

Release files for geo4bolivia 0.7.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for geo4bolivia 0.7.2
File Size Uploaded Provenance Actions
geo4bolivia-0.7.2.tar.gz 272.1 kB With provenance Details for geo4bolivia-0.7.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for geo4bolivia 0.7.2
File Interpreter ABI Platform Actions
geo4bolivia-0.7.2-py3-none-any.whl Python 3 none any Details for geo4bolivia-0.7.2-py3-none-any.whl

Total release size: 591.6 kB

Release files / geo4bolivia-0.7.2.tar.gz

Download URL geo4bolivia-0.7.2.tar.gz
Size 272.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2df21ed419942941df4af3c6c4165c1adf09436dcfe84e68ad7e3efa0b25a378
BLAKE2b-256 checksum
How to use checksums
a68df9446bf298a49b1ab14e35e205ef7d87a8a6b2b7ec20f068c0a5c22e4155
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / geo4bolivia-0.7.2-py3-none-any.whl

Download URL geo4bolivia-0.7.2-py3-none-any.whl
Size 319.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e5681c1866a7cf7c3f480c56d33bd03a72fd441ed1ac1051512d92b360bb0e21
BLAKE2b-256 checksum
How to use checksums
2821e5f5ddb6f57ac4861d695cc3f53b7a830ba637dc5c9db34eba5e09b55a43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Security for geo4bolivia 0.7.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for geo4bolivia-0.7.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page