Skip to main content

pypi python codecov License: MIT

oda-data

oda-data gives you official development assistance (ODA) figures from the OECD's DAC tables by name, for any years and providers, in any currency, with a record of where each number came from.

    provider_name  year             basis     value
0          France  2024  grant_equivalent  15448.26
1         Germany  2024  grant_equivalent  32836.11
2  United Kingdom  2024  grant_equivalent  17991.79
3   United States  2024  grant_equivalent  65475.37
import oda_data as oda

df = oda.get("oecd.dac1.total_oda", years=2024, providers=["USA", "DEU", "GBR", "FRA"])
print(df[["provider_name", "year", "basis", "value"]])

Values are USD millions. The first call downloads the OECD's DAC1 table (about 10 MB) and keeps it on disk.

Install

pip install oda-data

oda-data needs Python 3.12 or later. pip install "oda-data[polars]" adds Query.to_polars().

What it does

Most ODA figures depend on reading a DAC table correctly: DAC1 for official totals, DAC2A for what recipients receive, the CRS for sectors and channels. Each table has its own codes, bases, aggregate rows, and lines that nest inside each other. oda-data holds those rules in more than 40 named indicators, such as oecd.dac1.total_oda, oecd.crs.bilateral_oda, and one.crs.imputed_multilateral_oda, so one call returns one tidy table.

import oda_data as oda

dac = oda.groups.dac_countries

# Each DAC country and the DAC total, in constant 2024 euros
oda.get(
    "oecd.dac1.total_oda",
    years=range(2015, 2025),
    providers=[dac, oda.total(dac)],
    unit=oda.constant("EUR", 2024),
)

# Bilateral ODA to Kenya by broad sector
oda.get("oecd.crs.bilateral_oda", years=2023, recipients="KEN", by=["broad_sector"])

Every result has the same columns, converts money provider by provider before any sum, and refuses a question its table cannot answer with an error that names the indicator that can. oda-reader downloads and caches the OECD tables, and pydeflate supplies deflators and exchange rates from the same DAC1 release.

oda-data is the wrong tool for a pipeline that needs the raw OECD tables. Read those with oda-reader.

Documentation

3.0 replaces the 2.x API. oda.search("DAC1.10.1010") returns the 3.0 call for any 2.x indicator code.

Questions and bug reports go to the issue tracker. CONTRIBUTING.md explains how to work on the package.

MIT licence. See LICENSE.

Metadata

Release files for oda_data 3.0.0

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

Source distribution (sdist)

Source distribution for oda_data 3.0.0
File Size Uploaded Provenance Actions
oda_data-3.0.0.tar.gz 239.2 kB Without provenance Details for oda_data-3.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 495.7 kB

Release files / oda_data-3.0.0.tar.gz

Download URL oda_data-3.0.0.tar.gz
Size 239.2 kB
Tags Source
SHA-256 checksum
How to use checksums
66686073af213ac464e1ca2e4461dbcd5febe798a10a6802d8507a01ba30caa2
BLAKE2b-256 checksum
How to use checksums
bd9d22ad19251a316fafeb581b977cc1457348d10972f768bba7dbacbec8b5a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / oda_data-3.0.0-py3-none-any.whl

Download URL oda_data-3.0.0-py3-none-any.whl
Size 256.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
277311551804b22f1c6e84baa340689f29a77686097d120b1799936e71c0e615
BLAKE2b-256 checksum
How to use checksums
39defad5a1b18d1fbdba0fa276cefc5871d31271d4a15cd6d810118a94b02b7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for oda_data 3.0.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

3.0.0 This release

2 release files No provenance

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