Skip to main content

PyPI version PyPI - Python Version Anaconda version Docs

imf-reader

Python access to IMF World Economic Outlook and Special Drawing Rights data.

imf-reader fetches two IMF datasets that are hard to reach programmatically, the World Economic Outlook (WEO) database and Special Drawing Rights (SDR) data, and returns them as tidy pandas DataFrames.

WEO data comes from the IMF's SDMX API for releases from April 2025 onward and from a discontinued bulk SDMX archive for everything before it, translated onto one vocabulary so columns and codes match across both sources. SDR daily valuation and weekly interest rates have no API, so imf-reader parses them from IMF web pages. SDR allocations and holdings do exist on the API at monthly frequency, but this package has not moved to it and still parses them from web pages too. Both sources make the package sensitive to changes in the IMF's site structure or file formats. Please report any issues you encounter.

Installation

pip install imf-reader

Or with uv:

uv add imf-reader

Or from conda-forge:

conda install imf-reader

Usage

Fetch WEO data and filter it, for example Nigeria's real GDP growth:

from imf_reader import weo

df = weo.fetch_data()
growth = df[
    (df.REF_AREA_CODE == "NGA")
    & (df.CONCEPT_CODE == "NGDP_RPCH")
    & (df.TIME_PERIOD.between(2020, 2024))
]
print(growth[["REF_AREA_LABEL", "TIME_PERIOD", "OBS_VALUE", "UNIT_LABEL"]].to_string(index=False))

Output:

REF_AREA_LABEL  TIME_PERIOD  OBS_VALUE UNIT_LABEL
       Nigeria         2020  -6.368898    Percent
       Nigeria         2021   1.109253    Percent
       Nigeria         2022   4.318829    Percent
       Nigeria         2023   3.315904    Percent
       Nigeria         2024   4.071067    Percent

Fetch SDR allocations and holdings:

from imf_reader import sdr

df = sdr.fetch_allocations_holdings()

This returns one row per entity per indicator, with entity, indicator (holdings or allocations), value, and date columns.

Versions, caching, and the full column reference for both datasets are covered in the documentation.

Documentation

Full documentation lives at docs.one.org/tools/imf-reader. Start with Why imf-reader for the motivation, Getting started for a first walkthrough, and the WEO and SDR guides for dataset-specific detail.

Contributing

Contributions are welcome. See CONTRIBUTING.md for guidelines. This project is released with a Code of Conduct. By contributing, you agree to abide by its terms.

License

imf-reader is licensed under the MIT license. It was created by Luca Picci and is maintained by the ONE Campaign.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

imf_reader-2.1.0.tar.gz (42.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

imf_reader-2.1.0-py3-none-any.whl (50.8 kB view details)

Uploaded Python 3

File details

Details for the file imf_reader-2.1.0.tar.gz.

File metadata

  • Download URL: imf_reader-2.1.0.tar.gz
  • Upload date:
  • Size: 42.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for imf_reader-2.1.0.tar.gz
Algorithm Hash digest
SHA256 f3f36647138f858590a84b08a371bf6c2937284bc378e41269756b9435d7bb34
MD5 020ff239ab88ce28a3bbe5c0ab999315
BLAKE2b-256 7beb3676a1c2d57f1631d3a37dd4a536c19dc7729a1ccce9d5e8cf6035ebda82

See more details on using hashes here.

Provenance

The following attestation bundles were made for imf_reader-2.1.0.tar.gz:

Publisher: release.yml on ONEcampaign/imf-reader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file imf_reader-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: imf_reader-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 50.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for imf_reader-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3db51a8fdaa36f4a87be0d1b1dd4be20f010eec6496c7357555289030cbaf6ac
MD5 675d5a1300fe85dbe2f21c178fe68f9d
BLAKE2b-256 0f3159c6ffa0c09cf7811274fc2137a97b1e6c544cecb535c7ec92bdc77690b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for imf_reader-2.1.0-py3-none-any.whl:

Publisher: release.yml on ONEcampaign/imf-reader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

2.2.0

2 files

This release

2.1.0 This release

2 files

2.0.1

2 files

2.0.0

2 files

1.5.0

2 files

1.4.1

2 files

1.4.0

2 files

1.3.1

2 files

1.3.0

2 files

1.2.0

2 files

1.1.0

2 files

1.0.0

2 files

0.0.2

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page