Skip to main content

A client for interacting with the IMF's JSON RESTful API with Python!

Project description

imfpy

A package for interacting with the IMF's JSON RESTful API with Python!! In this preliminary phase, the package is a tool for understanding, retrieving and exploring Direction of Trade Statistics (DoTS) data.

This API client is intended to be useful for economic policymakers, researchers, government officials and more. The package enables the efficient retrieval of trade statistics from any country or country group over the span for which the IMF has data. Functions are designed to be easy-to-understand and adaptive to multiple query types.

Moving forward, I will add more functionality to each module, so that users may retrieve and analyse data from other IMF databases.

Installation

!pip install imfpy

Depends on:

  • python 3.7 and above
  • pandas 1.1.3 and above
  • requests 2.19.0 and above
  • matplotlib 3.2.2. and above

Usage

The package contains three modules:

searches contains many helper functions that assist the user in searching through available IMF databases, dimensions, metadata and variables.

retrievals contains functions that retrieve data from important databases.

For example, retrievals.dots pulls data from the DoTS database including imports, exports, two-way trade and trade balances for IMF countries and country-groups. The function handles flexible queries and formats the returned data to the user's specifications.

#Example: retrieve Greece annual trade data
>>> from imfpy.retrievals import dots
>>> dots("GR", ["US", "AU", "DE"], 2000, 2005)

tools contains functions that conduct rudimentary analysis and visualization on the data returned by retrievals functions. For example, the dotsplot function transforms the result of dots() into time series plots.

#Example: plot Australia trade data
>>> from imfpy.tools import dotsplot
>>> d = dots('AU',['US','CN'], 2000, 2020, freq='A', form="long")
>>> dotsplot(d, subset=['Trade Balance', 'Twoway Trade'])

Links

Documentation

Distribution

Testing

Extras

Contributing

Interested in contributing? Want to use this package? Please get in touch! Check out the contributing guidelines.

Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

imfpy was created by Liam Tay Kearney. It is licensed under the terms of the MIT license.

Credits

imfpy was created with cookiecutter and the py-pkgs-cookiecutter template.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

imfpy-0.0.2.tar.gz (11.6 kB view hashes)

Uploaded Source

Built Distribution

imfpy-0.0.2-py3-none-any.whl (11.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page