Skip to content

Bodysbobb/trade-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

Author Last Updated License

Trade Analysis Automation

A Python-based automation tool for downloading, merging, and summarizing international trade and macroeconomic data using official APIs from UN Comtrade, World Bank, and CEPII.

🔗 Full documentation and tutorial: Pattawee - Trade Research API


🌍 Overview

This repository provides the complete source code, mapping files, and data templates used in the automated trade analysis workflow described on my website.
It includes:

  • Python scripts to fetch and merge data from UN Comtrade, World Bank, and CEPII.
  • A pre-formatted Excel mapping file for indicator and ISO code alignment.
  • Prepared CEPII gravity dataset in symmetric format.
  • Example outputs (.csv, .xlsx) ready for econometric or gravity model research.

Use this repo to replicate or extend the workflow discussed in my tutorial post.

Main data sources:


⚙️ Key Features

  • Unified configuration for multi-source data collection
  • Supports batch “all countries” downloads without exceeding API limits
  • Automatically merges trade, macroeconomic, and gravity data
  • Generates summary Excel reports with coverage stats and missing data analysis
  • Consistent ISO3 country definitions across datasets

🙌 Acknowledgment

This project integrates open data from:

  • UN Comtrade API (comtradeapicall)
  • World Bank API (WDI)
  • CEPII Gravity Dataset

For additional explanations, setup details, and visual walkthroughs:
👉 pattawee-pp.com/blog/2025/trade-research-api


👨‍💻 Author

Pattawee Puangchit
Ph.D. Candidate in Agricultural Economics, Purdue University
Graduate Research Assistant at GTAP
Research focus: Trade policy, tariffs, NTMs, and CGE modeling

🌐 Personal Website
📦 GitHub Profile

About

A Python-based automation tool to download and merge trade and macroeconomic data from UN Comtrade and the World Bank.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages