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 the
dev
branch
Note that you will need to install the Poetry 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 with
poetry version patch/minor/major
- Update dependencies with
poetry update
- Run tests with
pytest tests
- Update documentation if needed
- Push to dev
- Open PR to main
To render and deploy documentation:
quarto render
quarto publish
The GitHub Actions workflow will handle code formatting, testing, and deployment to PyPI after merge.