Skip to main content

A package to call UN Comtrade APIs

Project description

ComtradeAPICALL Package

This package simplifies calling APIs of UN Comtrade to extract and download data . New users can learn more about UN Comtrade at the wiki.

The main script is located at /src/comtradeapicall_package_3m/init.py. And the folder tests contains example script how to install and use the package.

The packaging instruction is located at Packaging Python Project.

##Available functions:

  • previewFinalData, previewTarifflineData (extract data to pandas data frame, max record 500, no subscription key)
  • getFinalData, getTarifflineData (extract data to pandas data frame, max record 250K, require free or premium subscription key)
  • bulkDownloadFinalFile, bulkDownloadTarifflineFile (download data files, require premium subscription key)

(See tests folder for examples)

###Downloaded file name The naming convention follows the following : "COMTRADE-<DATA>-<TYPE><FREQ><COUNTRY CODE><YEAR[ -MONTH]><CLASSIFICATION CODE>[<RELEASE DATE>]"

As examples:

  • Final merchandise trade data from Morocco (code 504) in March 2000 released on 3 Jan 2023 coded using H1 classification : COMTRADE -FINAL-CM504200003H1[2023-01-03]
  • Tariffline merchandise trade from Morocco (code 504) in March 2000 released on 3 Jan 2023 coded using H1 classification: COMTRADE -TARIFFLINE-CM504200003H1[2023-01-03]

See differences between final and tariffline data at the Wiki

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

comtradeapicall-1.0.1.tar.gz (4.3 kB view hashes)

Uploaded Source

Built Distribution

comtradeapicall-1.0.1-py3-none-any.whl (5.0 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