Skip to main content

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.

Release files for imfpy 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for imfpy 0.0.2
File Size Uploaded
imfpy-0.0.2.tar.gz 11.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for imfpy 0.0.2
File Interpreter ABI Platform
imfpy-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size:22.8 kB

Release files / imfpy-0.0.2.tar.gz

Download URL imfpy-0.0.2.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c164bbf5e77e1370ec6512c890661881d75af5be8b59f57ed2d37a613abc31dc
BLAKE2b-256 checksum
How to use checksums
9504f2256b615c8ab7a73515a465ab7c4e90de5374e28a366ca4dbceae0212a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.10 CPython/3.9.0 Windows/10

Release files / imfpy-0.0.2-py3-none-any.whl

Download URL imfpy-0.0.2-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d6e3f75c42a45108288a4ef90d3a29b1eca5addb7a74dfc4641a7b55b4a1684
BLAKE2b-256 checksum
How to use checksums
6bc4f50aa1abb8080d4f4748daa9de14dbc9f928d723f6481e57b97ebddecb80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.10 CPython/3.9.0 Windows/10

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page