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.

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)

Source distribution for imfp 2.0.1
File Size Uploaded
imfp-2.0.1.tar.gz 48.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for imfp 2.0.1
File Interpreter ABI Platform
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 log

Release 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

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files

2.0.0

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.10

2 release files

1.1.9

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

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