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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file imfp-2.0.0.tar.gz.
File metadata
- Download URL: imfp-2.0.0.tar.gz
- Upload date:
- Size: 48.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8604c8822b28b2f56700d1eb1e7e365cb3ac33be08176945aca1dfc14192af2
|
|
| MD5 |
b52e37b0a0a7903b74554786bc64622d
|
|
| BLAKE2b-256 |
c0bd33d1c85177c4e9e05270ef09235d29c37a59b152c2251f121e5fb5d0ea6a
|
Provenance
The following attestation bundles were made for imfp-2.0.0.tar.gz:
Publisher:
release.yml on Promptly-Technologies-LLC/imfp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
imfp-2.0.0.tar.gz -
Subject digest:
e8604c8822b28b2f56700d1eb1e7e365cb3ac33be08176945aca1dfc14192af2 - Sigstore transparency entry: 2372575341
- Sigstore integration time:
-
Permalink:
Promptly-Technologies-LLC/imfp@f64efb667b203e649e0f4efff6691dbe5f00a0f7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Promptly-Technologies-LLC
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f64efb667b203e649e0f4efff6691dbe5f00a0f7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file imfp-2.0.0-py3-none-any.whl.
File metadata
- Download URL: imfp-2.0.0-py3-none-any.whl
- Upload date:
- Size: 34.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
161d329bee5dfdc55c4faf5b80c614a56f48b9d77e721e88c50dc0bde01c52ed
|
|
| MD5 |
1473fa28bcd1982580d129bb767d143e
|
|
| BLAKE2b-256 |
0395e76b0f6b4bdfbd0560a55c662625ed0011a381f900a146e88c3592a2d492
|
Provenance
The following attestation bundles were made for imfp-2.0.0-py3-none-any.whl:
Publisher:
release.yml on Promptly-Technologies-LLC/imfp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
imfp-2.0.0-py3-none-any.whl -
Subject digest:
161d329bee5dfdc55c4faf5b80c614a56f48b9d77e721e88c50dc0bde01c52ed - Sigstore transparency entry: 2372575355
- Sigstore integration time:
-
Permalink:
Promptly-Technologies-LLC/imfp@f64efb667b203e649e0f4efff6691dbe5f00a0f7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Promptly-Technologies-LLC
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f64efb667b203e649e0f4efff6691dbe5f00a0f7 -
Trigger Event:
push
-
Statement type: