Skip to main content

imfp

Tests PyPI Version Code style: ruff

imfp, by Christopher C. Smith, is a Python package for downloading data from the International Monetary Fund's RESTful JSON API.

📚 Full Documentation

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 pandas DataFrame output, with numeric observation values
  • Rate limit and bandwidth management

Contributing

We welcome contributions to improve imfp! Here's how you can help:

  1. If you find a bug, please open an issue
  2. 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 main branch

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.

Metadata

Release files for imfp 2.1.1

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

Source distribution (sdist)

Source distribution for imfp 2.1.1
File Size Uploaded Provenance Actions
imfp-2.1.1.tar.gz 50.9 kB With provenance Details for imfp-2.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 87.1 kB

Release files / imfp-2.1.1.tar.gz

Download URL imfp-2.1.1.tar.gz
Size 50.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0e02bdd9f0a92ded57d7713146414810f6a0866091fce40930b197ce139456e3
BLAKE2b-256 checksum
How to use checksums
bb73238fc7fd8331e128476e56cb8733b7fdbff89a19a3209d22b2a846873803
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 Oct 22, 2026.

Transparency log

Release files / imfp-2.1.1-py3-none-any.whl

Download URL imfp-2.1.1-py3-none-any.whl
Size 36.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b0da3cf72c04e071b69778f40068cc181eaf35b34a71eb30d7daa919f31074e
BLAKE2b-256 checksum
How to use checksums
dd3f1246ce7db5a41a416969942b50656a3554ea8e168eaac9bf32cf64d055d5
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 Oct 22, 2026.

Transparency log

Security for imfp 2.1.1

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 imfp-2.1.1.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 Oct 22, 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

2.1.1 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