Skip to main content

debt-atlas

Sovereign debt, deficits, government spending and who-owes-whom data for every country — in one line of Python.

debt-atlas is the Python library of the open-source Global Debt & Fiscal Atlas. It gives you 37 indicators from the World Bank and IMF, government spending in US dollars, national debt profiles and bilateral lending between countries as tidy pandas DataFrames — every value with its source, series code and year.

pip install debt-atlas

Quick start

import debt_atlas as da

da.latest("gov_debt_gdp", countries=["Japan", "Italy", "USA"])   # government debt, % of GDP
da.rank("military_usd", n=10)                                     # biggest military spenders, US$
da.spending("United States")                                      # where the money goes, in US$
da.who_owes("Kenya")                                              # Kenya's lenders and how much
da.owed_by("China")                                               # who owes China
da.series("inflation", "Argentina", start=2010)                   # history, one row per source
da.compare(["Egypt", "Pakistan", "Kenya"], ["gov_debt_gdp", "interest_gdp", "health_gov_gdp"])
da.profile("Syria")                                               # 3-tier national debt profile

Countries can be given as names ("Kenya"), ISO2 ("KE") or ISO3 ("KEN").

What is inside

Function Returns
indicators(category=None) Every indicator: id, name, unit, description, upstream series
latest(indicator, countries=None) Latest value per country, with year, estimate flag and source
rank(indicator, n=10, lowest=False) Top or bottom countries
series(indicator, countries, start, end, provider) Full history, one row per upstream series
wide(indicator, countries) Year × country table
compare(countries, indicators) Several indicators for several countries side by side
spending(country=None, item=None) Military, health, education, social transfers, wages, interest, R&D, total — US$, per person, % of GDP
who_owes(country) / owed_by(country) Bilateral lenders / borrowers with amounts and shares (World Bank IDS)
bilateral(debtor, creditor, year) The full who-owes-whom table
profile(country) National debt profile with source tier
sources(topic=None) Where to find newer or more detailed data
countries() ISO codes, names, coordinates
live(series_code) Any series straight from the World Bank or IMF API
download_all(folder) Every file plus a Frictionless datapackage.json

Categories: debt, spending, revenue, economy, flows, people.

Command line

debt-atlas rank military_usd -n 10
debt-atlas latest gov_debt_gdp --countries Japan Italy
debt-atlas who-owes Pakistan
debt-atlas spending "United States" --csv > usa.csv
debt-atlas download ./atlas-data

Where the data comes from

The project rebuilds its data every week from the World Bank (World Development Indicators, International Debt Statistics) and IMF (World Economic Outlook, Global Debt Database, Public Finances in Modern History) APIs, validates it against published reference figures, and publishes it as CSV. The library downloads those files (cached for 24 hours in ~/.cache/debt_atlas) — fast, no API keys, and identical to what the web app shows.

  • IMF values for the current year are staff estimates and are flagged is_estimate; projections are never included.
  • Missing values are absent, never zero.
  • Use another source with da.Atlas("path/or/url"), or set DEBT_ATLAS_SOURCE.

Citing

Please cite the original data providers named in each row's source column, and this project (see CITATION.cff).

Code: MIT licence. Data: each provider's terms (World Bank CC BY 4.0, IMF, SIPRI, WHO, UNESCO).

Metadata

Release files for debt-atlas 0.1.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 debt-atlas 0.1.0
File Size Uploaded Provenance Actions
debt_atlas-0.1.0.tar.gz 44.4 kB With provenance Details for debt_atlas-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for debt-atlas 0.1.0
File Interpreter ABI Platform Actions
debt_atlas-0.1.0-py3-none-any.whl Python 3 none any Details for debt_atlas-0.1.0-py3-none-any.whl

Total release size: 58.2 kB

Release files / debt_atlas-0.1.0.tar.gz

Download URL debt_atlas-0.1.0.tar.gz
Size 44.4 kB
Tags Source
SHA-256 checksum
How to use checksums
be4d71ed917232c51b62f2b7c45fc4921d6cee2e05c90a1f1245a059ad4fb72a
BLAKE2b-256 checksum
How to use checksums
d9276ad2fcdeb6ca0df253b9ad17b3c163b13d112d2af1a0ebb162dc94196d12
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 3, 2026.

Transparency log

Release files / debt_atlas-0.1.0-py3-none-any.whl

Download URL debt_atlas-0.1.0-py3-none-any.whl
Size 13.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d6d74ab5fb5795a34f5631aa2fe8356b51baef95f51f1af26ca1f8a3b761ee24
BLAKE2b-256 checksum
How to use checksums
ec189f3176830d2584fd2fb0aa4502ea5036b6fe3e4b05da645205ba484e4f68
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 3, 2026.

Transparency log

Security for debt-atlas 0.1.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.

Full provenance

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

Select from 2 files

Attestation for debt_atlas-0.1.0.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 3, 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full 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