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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file imfpy-0.0.2.tar.gz.

File metadata

  • Download URL: imfpy-0.0.2.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.10 CPython/3.9.0 Windows/10

File hashes

Hashes for imfpy-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c164bbf5e77e1370ec6512c890661881d75af5be8b59f57ed2d37a613abc31dc
MD5 ae46ae5208e1c18b8d797a4e932b094b
BLAKE2b-256 9504f2256b615c8ab7a73515a465ab7c4e90de5374e28a366ca4dbceae0212a4

See more details on using hashes here.

File details

Details for the file imfpy-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: imfpy-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.10 CPython/3.9.0 Windows/10

File hashes

Hashes for imfpy-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1d6e3f75c42a45108288a4ef90d3a29b1eca5addb7a74dfc4641a7b55b4a1684
MD5 2dc5b02aad8b5f8dad0ce18450bd29a9
BLAKE2b-256 6bc4f50aa1abb8080d4f4748daa9de14dbc9f928d723f6481e57b97ebddecb80

See more details on using hashes here.

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