imfp
, by Christopher C. Smith, is a Python package for downloading data from the International Monetary Fund's RESTful JSON API.
pip install -q --upgrade imfp
import imfp
# Get list of available databases
databases = imfp.imf_databases()
# Get parameters for a specific database (e.g., PCPS - Primary Commodity Price System)
params = imfp.imf_parameters("PCPS")
# Fetch data with specific parameters
df = imfp.imf_dataset(
database_id="PCPS",
freq=["A"],
start_year=2000,
end_year=2015
)
- Comprehensive access to IMF's extensive economic databases
- Parameter discovery
- Rate limit and bandwidth management
- Returns data in pandas DataFrames
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 the repository
- Create a fix
- Open a pull request to our
main
branch
Note that you will need to install the uv package manager to install the dependencies and run the tests, and the Quarto CLI tool to render the documentation.
To deploy a new version:
- Increment version in
pyproject.toml
- Update dependencies with
uv lock --upgrade-package dependency_name
for each dependency - Run tests with
uv run pytest tests
- Update documentation if needed
- Push to issue branch
- Open PR to main
The GitHub Actions workflow will handle code formatting and testing, documentation rendering and publishing, and release to PyPI after the merge.