This project analyzes global merchandise trade trends from 1947 to 2023, with a primary focus on India's trade performance. The dataset is sourced from Google BigQuery and consists of key indicators such as exports, imports, total trade, and trade deficit for different countries. The analysis leverages:
โ
Google BigQuery โ Efficient data extraction & querying ๐
โ
Python โ Data processing, transformation & visualization ๐
โ
ChatGPT AI โ AI-driven insights & trend analysis ๐ค
โ
Automated PDF Reports โ Structured storytelling with key findings ๐
๐ The trade data used in this project is sourced from the World Trade Organization (WTO).
๐ Official WTO Merchandise Trade Statistics: WTO Trade Data
๐น Analyze India's exports, imports, total trade, and trade deficit over time.
๐น Compare India's trade performance against global leaders.
๐น Identify key trade trends, challenges, and opportunities for improvement.
1๏ธโฃ How has global trade evolved from 1947 to 2023?
2๏ธโฃ What is Indiaโs trade performance in exports, imports, and total trade?
3๏ธโฃ How has Indiaโs trade deficit changed over time?
4๏ธโฃ How does India compare with top exporting and importing nations?
5๏ธโฃ What are the key challenges in Indiaโs trade landscape?
6๏ธโฃ What strategies can improve Indiaโs trade competitiveness?
| Column Name | Description |
|---|---|
| IndicatorCode | Unique code for trade indicators |
| Indicator | Type of trade (Exports/Imports) |
| ReporterCountry | Country reporting the trade |
| Partner | Trade partner country |
| ProductCode | Unique product identifier |
| Product | Name of traded product |
| Year | Trade year |
| Value_MillionUSD | Trade value in million USD |
git clone https://github.com/yourusername/Global-Trade-Analysis.git
cd Global-Trade-Analysispip install pandas matplotlib seaborn fpdf google-cloud-bigquery1๏ธโฃ Create a Google Cloud Project.
2๏ธโฃ Enable BigQuery API.
3๏ธโฃ Download your service account JSON key and set it as an environment variable:
export GOOGLE_APPLICATION_CREDENTIALS="path/to/your-key.json"WITH YearlyTrade AS (
SELECT
Year,
SUM(Value_MillionUSD) AS Trade_Value
FROM `my-project-1711648161671.World_Trade.Countries_Merchandise_Trade`
WHERE Product="Total merchandise"
GROUP BY Year
)
SELECT
Year,
Trade_Value,
LAG(Trade_Value) OVER (ORDER BY Year) AS Prev_Year_Trade_Value,
ROUND(((Trade_Value - LAG(Trade_Value) OVER (ORDER BY Year)) / LAG(Trade_Value) OVER (ORDER BY Year)) * 100, 2) AS Growth_Percentage
FROM YearlyTrade
ORDER BY Year;SELECT
Year,
SUM(Value_MillionUSD) AS Total_Trade_Value
FROM `my-project-1711648161671.World_Trade.Countries_Merchandise_Trade`
WHERE ReporterCountry = 'India' AND Product ="Total merchandise"
GROUP BY Year
ORDER BY Year;WITH IndiaTrade AS (
SELECT
Year,
SUM(CASE WHEN Indicator = 'exports' THEN Value_MillionUSD ELSE 0 END) AS India_Exports,
SUM(CASE WHEN Indicator = 'imports' THEN Value_MillionUSD ELSE 0 END) AS India_Imports
FROM `my-project-1711648161671.World_Trade.Countries_Merchandise_Trade`
WHERE ReporterCountry = 'India' AND Product ="Total merchandise"
GROUP BY Year
)
SELECT
Year,
India_Exports,
India_Imports,
(India_Imports - India_Exports) AS Trade_Deficit,
CASE
WHEN (India_Imports - India_Exports) > 0 THEN 'Trade Deficit'
ELSE 'Trade Surplus'
END AS Trade_Status
FROM IndiaTrade
ORDER BY Year;import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from reportlab.lib.pagesizes import letter
from reportlab.pdfgen import canvas
# ๐ Load dataset
file_path = r"C:\Users\chemi\Downloads\PROJECT -World Merchandise Trade (Bigquery Project)\BigQuery Output Result\India's Global Trade Case Study (1948-2023).csv"
df = pd.read_csv(file_path)
# ๐ Data Preprocessing
df['Year'] = pd.to_numeric(df['Year'], errors='coerce')
df["Trade Balance"] = df["India_Exports"] - df["India_Imports"]
df["Total Trade"] = df["India_Exports"] + df["India_Imports"]
# ๐ฅ 1. India's Exports & Imports Over Time
plt.figure(figsize=(12, 6))
sns.lineplot(x="Year", y="India_Exports", data=df, label="Exports", marker="o", color="blue")
sns.lineplot(x="Year", y="India_Imports", data=df, label="Imports", marker="s", color="red")
plt.title("India's Exports & Imports (1948-2023)")
plt.xlabel("Year")
plt.ylabel("USD Billion")
plt.legend()
plt.grid(True)
plt.show()
๐ Comprehensive analysis covering key insights, trends, and expert recommendations for India's trade performance in 2023.
๐ View Report
๐ In-depth report analyzing India's product-wise trade trends from 1948 to 2023, highlighting key patterns and growth opportunities.
๐ View Report
- Exports: ๐ฐ $431,574 Million USD
- India's Export Percentage: ๐ 1.81%
- Export Rank: ๐ 17
- Imports: ๐ฐ $672,231 Million USD
- India's Import Percentage: ๐ 2.77%
- Import Rank: ๐ 8
- Total Trade: ๐ฐ $1,103,805 Million USD
- India's Total Trade Percentage: ๐ 2.3%
- Trade Rank: ๐ 14
- Trade Deficit: โ $240,657 Million USD
India remains one of the largest players in global trade. In 2023, India's exports crossed $431,574 million, placing it among the top exporters worldwide. However, its imports outpaced exports, leading to a significant trade deficit. India continues to be a major importer of crude oil, gold, and electronic components, while its key export sectors include pharmaceuticals, IT services, and textiles. The trade balance has been influenced by global economic conditions, currency fluctuations, and demand shifts in international markets.
- 1๏ธโฃ China - $3,379,255M
- 2๏ธโฃ United States - $2,020,606M
- 3๏ธโฃ Germany - $1,718,251M
- 4๏ธโฃ Netherlands - $936,392M
- 5๏ธโฃ Japan - $717,261M
- 6๏ธโฃ Italy - $676,993M
- 7๏ธโฃ France - $648,569M
- 8๏ธโฃ South Korea - $632,226M
- 9๏ธโฃ Mexico - $593,005M
- ๐ Hong Kong - $573,871M
- 1๏ธโฃ United States - $3,172,476M
- 2๏ธโฃ China - $2,556,565M
- 3๏ธโฃ Germany - $1,476,656M
- 4๏ธโฃ Netherlands - $842,331M
- 5๏ธโฃ United Kingdom - $791,523M
- 6๏ธโฃ France - $786,158M
- 7๏ธโฃ Japan - $785,796M
- 8๏ธโฃ India - $672,231M
- 9๏ธโฃ Hong Kong - $653,696M
- ๐ South Korea - $642,572M
๐น China - $822,690M ๐น Germany - $241,595M ๐น Russia - $120,925M ๐น Saudi Arabia - $113,078M ๐น Netherlands - $94,061M
โ United States - $1,151,870M โ United Kingdom - $270,483M โ India - $240,657M โ France - $137,589M โ Tรผrkiye - $106,327M
- 1๏ธโฃ High Import Dependency ๐ญ: India imports more than it exports in key categories like fuels, machinery, and pharmaceuticals, leading to a trade imbalance.
- 2๏ธโฃ Weak Export Competitiveness ๐: India's export share (1.81%) is much lower than its economic size, indicating low global competitiveness.
- 3๏ธโฃ Sector-Specific Deficits ๐ฅ: Deficits in pharmaceuticals and food sectors suggest a need for domestic production growth and export incentives.
- 4๏ธโฃ Limited Market Penetration ๐: India relies heavily on traditional export markets, limiting its trade reach.
โ Expand High-Value Manufacturing ๐ง
- Encourage semiconductor, AI, and high-tech industries
- Invest in automobile and electronics manufacturing โ Strengthen Trade Agreements ๐ค
- Negotiate preferential trade deals with Africa, Latin America, and Southeast Asia โ Enhance Export Incentives ๐
- Introduce tax benefits for export-driven industries
โ Increase Domestic Production in Deficit Sectors ๐ญ
- Expand pharmaceutical manufacturing to reduce $17.9B deficit
- Boost agriculture and textile production to cut food & clothing imports โ Invest in Renewable Energy โ๏ธ
- Reduce oil import dependency ($220.6B) by investing in solar, wind, and green hydrogen
โ Improve Logistics & Ports โ
- Reduce trade costs and shipment delays to make exports more competitive โ Ease Business Regulations ๐
- Simplify tax laws and streamline customs processes for exporters
โ Expand Beyond Traditional Markets ๐
- Strengthen trade with Africa, Middle East, and Latin America
- Reduce over-reliance on US and European markets
India has the potential to become a major global trade powerhouse but must address its trade deficit, boost exports, and reduce import dependence. By implementing strategic manufacturing policies, improving infrastructure, and diversifying export markets, India can move up in global trade rankings and achieve a more balanced trade profile in the coming years.
- โ Strengthen high-value manufacturing exports
- โ Reduce fuel & machinery import dependency
- โ Improve trade policies and agreements
- โ Expand global market reach beyond traditional partners
- โ Invest in logistics and supply chain efficiency ๐ข
๐ BigQuery SQL Code & Execution Screenshots ๐ Python Code for Trade Analysis & Data Visualization ๐ ChatGPT AI Report Generation & Insights
India has the potential to become a major global trade powerhouse but must address:
๐ Trade Deficit Challenges โ Reduce reliance on imports.
๐ Boost Export Competitiveness โ Focus on high-value industries.
๐ Expand Market Reach โ Diversify beyond traditional partners.
By implementing strategic policies, investing in infrastructure, and expanding global trade agreements, India can significantly improve its trade rankings and achieve a balanced trade profile in the coming years.


.png)
.png)




