imfp
imfp, by Christopher C. Smith, is a Python package for downloading data from the International Monetary Fund's RESTful JSON API.
Installation
pip install -q --upgrade imfp
Quick Start
imfp follows the econdataverse conventions, mirroring the R package imfapi. Fetching data takes four steps, one per function:
import imfp
# 1. Find a dataset
dataflows = imfp.imf_get_dataflows()
# 2. See how it can be filtered
dimensions = imfp.imf_get_datastructure("PCPS")
# 3. Find valid codes for those dimensions
codes = imfp.imf_get_codelists(["INDICATOR", "FREQUENCY"], "PCPS")
# 4. Fetch the data
df = imfp.imf_get(
"PCPS",
dimensions={
"INDICATOR": ["PCOAL"],
"DATA_TRANSFORMATION": ["INDEX"],
"FREQUENCY": ["A"],
},
)
Dimensions can also be passed as keyword arguments:
df = imfp.imf_get("PCPS", indicator="PCOAL", data_transformation="INDEX", frequency="A")
Upgrading from 1.x
Version 2.0.0 replaces the old four-function API. The old names still work but emit a DeprecationWarning, and will be removed in 3.0.0.
| imfp 1.x | imfp 2.0 |
|---|---|
imf_databases() |
imf_get_dataflows() |
imf_parameters(db) |
imf_get_codelists(dims, db) |
imf_parameter_defs(db) |
imf_get_datastructure(db) |
imf_dataset(db, ...) |
imf_get(db, ...) |
See the migration guide for argument-by-argument details.
Key Features
- Comprehensive access to IMF's extensive economic databases
- Dataset, dimension, and code discovery
- Tidy
pandasDataFrame output, with numeric observation values - Rate limit and bandwidth management
Contributing
We welcome contributions to improve imfp! Here's how you can help:
- If you find a bug, please open an issue
- To fix a bug:
- Fork and clone the repository and open a terminal in the repository directory
- Install uv with
curl -LsSf https://astral.sh/uv/install.sh | sh - Install the dependencies with
uv sync - Install a git hook to enforce conventional commits with
curl -o- https://raw.githubusercontent.com/chriscarrollsmith/conventional-commits-git-hook/master/scripts/install.sh | sh - Create a fix, commit it with an "Angular-style Conventional Commit" message, and push it to your fork
- Open a pull request to our
mainbranch
Note that if you want to change and preview the documentation, you will need to install the Quarto CLI tool and run uv run great-docs build (or uv run great-docs preview).
Version incrementing, package building, testing, changelog generation, documentation rendering, publishing to PyPI, and Github release creation is handled automatically by the GitHub Actions workflow based on the commit messages.
Release files for imfp 2.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| imfp-2.0.1.tar.gz | 48.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| imfp-2.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 82.6 kB
Release files / imfp-2.0.1.tar.gz
| Download URL | imfp-2.0.1.tar.gz |
|---|---|
| Size | 48.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d2eff2a29b669501c61a16168b070807a9466ce9aeb9f43e742be52162bc48d7
|
|
BLAKE2b-256 checksum How to use checksums |
5d74f4337668234c38ca7ea6742c42bf927829c398dcb312a27866d3d886eb7c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 24, 2026.
Transparency logRelease files / imfp-2.0.1-py3-none-any.whl
| Download URL | imfp-2.0.1-py3-none-any.whl |
|---|---|
| Size | 34.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f22dfa9ea00528ae7647f7a6f6761623834ddf3ecf3f424f0351a77a41705f31
|
|
BLAKE2b-256 checksum How to use checksums |
c14d4457dfcd6d68dd9871f27abfe9f763b857d60718be629001f90c3356c8d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 24, 2026.
Transparency log