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.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 imfp 2.1.0
File Size Uploaded
imfp-2.1.0.tar.gz 50.9 kB Details

Built distribution (wheel)

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

Total release size: 87.1 kB

Release files / imfp-2.1.0.tar.gz

Download URL imfp-2.1.0.tar.gz
Size 50.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2d2c0d30738093fbd2ebb62c01dc1b65ea00f3afd2ea0e467881a8b919e8eada
BLAKE2b-256 checksum
How to use checksums
e4fe0aea61d42602ffcefd9cb0a6d0f7eaf991427bfa2299798caff5757e923a
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.1.0-py3-none-any.whl

Download URL imfp-2.1.0-py3-none-any.whl
Size 36.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0fccef6406349160d4426ec4272fa7f93f80e9268c626be5ac7f7ebd6cb931c0
BLAKE2b-256 checksum
How to use checksums
48d35d52ab30e56a002f998cd6a789863e75355b223ca8024311f0fb79d7baec
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.1.0 This release

2 release files

2.0.1

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