{"id":26244513,"url":"https://github.com/pradip-data/world-merchandise-trade","last_synced_at":"2026-05-18T03:35:52.634Z","repository":{"id":280168522,"uuid":"941162972","full_name":"pradip-data/World-Merchandise-Trade","owner":"pradip-data","description":"This project analyzes global merchandise trade trends from 1948 to 2023 using Google BigQuery and Python. It includes country-wise and product-wise trade performance, covering exports, imports, total trade, and trade deficit. The analysis features SQL queries for BigQuery, data visualizations, and detailed reports to uncover long-term trade pattern","archived":false,"fork":false,"pushed_at":"2025-03-04T09:54:19.000Z","size":31699,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-10T16:34:02.360Z","etag":null,"topics":["datawarehouse","google-biquery","google-cloud-platform","merchandise","python","python-visualization","sql","trade","trade-data-1948-2023"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pradip-data.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-01T16:34:43.000Z","updated_at":"2025-03-04T09:54:23.000Z","dependencies_parsed_at":"2025-08-10T16:26:24.547Z","dependency_job_id":null,"html_url":"https://github.com/pradip-data/World-Merchandise-Trade","commit_stats":null,"previous_names":["pradip-data/world-merchandise-trade"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pradip-data/World-Merchandise-Trade","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pradip-data%2FWorld-Merchandise-Trade","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pradip-data%2FWorld-Merchandise-Trade/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pradip-data%2FWorld-Merchandise-Trade/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pradip-data%2FWorld-Merchandise-Trade/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pradip-data","download_url":"https://codeload.github.com/pradip-data/World-Merchandise-Trade/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pradip-data%2FWorld-Merchandise-Trade/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33163781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"online","status_checked_at":"2026-05-18T02:00:06.436Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["datawarehouse","google-biquery","google-cloud-platform","merchandise","python","python-visualization","sql","trade","trade-data-1948-2023"],"created_at":"2025-03-13T11:27:51.951Z","updated_at":"2026-05-18T03:35:52.628Z","avatar_url":"https://github.com/pradip-data.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌍 Global Merchandise Trade (1947-2023) Analysis using ChatGPT AI, Google BigQuery \u0026 Python\n\n## 📌 Project Overview\nThis 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:\n\n\n### 🚀 Technologies \u0026 Methodologies Used:  \n✅ **Google BigQuery** – Efficient data extraction \u0026 querying 📊  \n✅ **Python** – Data processing, transformation \u0026 visualization 🐍  \n✅ **ChatGPT AI** – AI-driven insights \u0026 trend analysis 🤖  \n✅ **Automated PDF Reports** – Structured storytelling with key findings 📄  \n\n---\n\n## 🌍 Data Source  \n\n📌 The trade data used in this project is sourced from the **World Trade Organization (WTO)**.  \n🔗 **Official WTO Merchandise Trade Statistics:** [WTO Trade Data](https://www.wto.org/english/res_e/statis_e/merch_trade_stat_e.htm)  \n\n---\n\n## 📊 Key Objectives\n🔹 Analyze **India's exports, imports, total trade, and trade deficit** over time.  \n🔹 Compare **India's trade performance** against **global leaders**.  \n🔹 Identify **key trade trends, challenges, and opportunities** for improvement.  \n\n---\n\n## 📊 Key Questions Analyzed\n1️⃣ **How has global trade evolved from 1947 to 2023?**  \n2️⃣ **What is India’s trade performance in exports, imports, and total trade?**  \n3️⃣ **How has India’s trade deficit changed over time?**  \n4️⃣ **How does India compare with top exporting and importing nations?**  \n5️⃣ **What are the key challenges in India’s trade landscape?**  \n6️⃣ **What strategies can improve India’s trade competitiveness?**  \n\n---\n\n## 📊 Dataset Overview\n### 📂 Dataset Structure\n| Column Name        | Description                            |\n|--------------------|------------------------------------|\n| **IndicatorCode**   | Unique code for trade indicators   |\n| **Indicator**       | Type of trade (Exports/Imports)   |\n| **ReporterCountry** | Country reporting the trade       |\n| **Partner**        | Trade partner country             |\n| **ProductCode**    | Unique product identifier         |\n| **Product**        | Name of traded product           |\n| **Year**           | Trade year                         |\n| **Value_MillionUSD** | Trade value in million USD        |\n\n---\n\n## 📥 Installation\n### 🚀 Clone the Repository\n```bash\ngit clone https://github.com/yourusername/Global-Trade-Analysis.git\ncd Global-Trade-Analysis\n```\n### 📦 Install Dependencies\n```bash\npip install pandas matplotlib seaborn fpdf google-cloud-bigquery\n```\n### 🔑 Set Up Google BigQuery Credentials\n1️⃣ Create a **Google Cloud Project**.  \n2️⃣ Enable **BigQuery API**.  \n3️⃣ Download your **service account JSON key** and set it as an environment variable:  \n```bash\nexport GOOGLE_APPLICATION_CREDENTIALS=\"path/to/your-key.json\"\n```\n\n---\n\n## 📜 Analysis \u0026 Code Overview \n\n## 📌 Section A : Some BigQuery Code \u0026 Console Screenshots\n\n### 1️⃣ Yearly Growth of Trade Value (1948-2023)\n```sql\nWITH YearlyTrade AS (\n    SELECT \n        Year, \n        SUM(Value_MillionUSD) AS Trade_Value\n    FROM `my-project-1711648161671.World_Trade.Countries_Merchandise_Trade`\n    WHERE Product=\"Total merchandise\"\n    GROUP BY Year\n)\nSELECT \n    Year, \n    Trade_Value, \n    LAG(Trade_Value) OVER (ORDER BY Year) AS Prev_Year_Trade_Value,\n    ROUND(((Trade_Value - LAG(Trade_Value) OVER (ORDER BY Year)) / LAG(Trade_Value) OVER (ORDER BY Year)) * 100, 2) AS Growth_Percentage\nFROM YearlyTrade\nORDER BY Year;\n```\n\n### 2️⃣ India's Total Trade Value (Exports + Imports) (1948-2023)\n```sql\nSELECT \n    Year, \n    SUM(Value_MillionUSD) AS Total_Trade_Value\nFROM `my-project-1711648161671.World_Trade.Countries_Merchandise_Trade`\nWHERE ReporterCountry = 'India' AND Product =\"Total merchandise\"\nGROUP BY Year\nORDER BY Year;\n```\n\n### 3️⃣ India's Trade Deficit (1948-2023)\n```sql\nWITH IndiaTrade AS (\n    SELECT \n        Year,\n        SUM(CASE WHEN Indicator = 'exports' THEN Value_MillionUSD ELSE 0 END) AS India_Exports,\n        SUM(CASE WHEN Indicator = 'imports' THEN Value_MillionUSD ELSE 0 END) AS India_Imports\n    FROM `my-project-1711648161671.World_Trade.Countries_Merchandise_Trade`\n    WHERE ReporterCountry = 'India' AND Product =\"Total merchandise\"\n    GROUP BY Year\n)\nSELECT \n    Year,\n    India_Exports,\n    India_Imports,\n    (India_Imports - India_Exports) AS Trade_Deficit,\n    CASE \n        WHEN (India_Imports - India_Exports) \u003e 0 THEN 'Trade Deficit'\n        ELSE 'Trade Surplus'\n    END AS Trade_Status\nFROM IndiaTrade\nORDER BY Year;\n```\n\n## 📸 BigQuery Execution Screenshots  \n\n\u003cimg src=\"https://github.com/pradip-data/World-Merchandise-Trade/blob/866246cb9e2593a5b7c0960b7441ef9257ffa98e/Bigquery%20Google%20Cloud%20Console%20project%20images/BigQuery-Google%20Cloud%20Console%201.png\" alt=\"BigQuery Console 1\" width=\"700\"\u003e\n\n\u003cimg src=\"https://github.com/pradip-data/World-Merchandise-Trade/blob/3223d8a7157473066f1796867760e0286724330e/Bigquery%20Google%20Cloud%20Console%20project%20images/BigQuery-Google%20Cloud%20Console%202.png\" alt=\"BigQuery Console 2\" width=\"700\"\u003e\n\n---\n\n## 📌 Section B : Python Code \u0026 Visualizations\n### 📊 Python Code for Data Visualization\n```python\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom reportlab.lib.pagesizes import letter\nfrom reportlab.pdfgen import canvas\n\n# 📂 Load dataset\nfile_path = r\"C:\\Users\\chemi\\Downloads\\PROJECT -World Merchandise Trade  (Bigquery Project)\\BigQuery Output Result\\India's Global Trade Case Study (1948-2023).csv\"\ndf = pd.read_csv(file_path)\n\n# 🛠 Data Preprocessing\ndf['Year'] = pd.to_numeric(df['Year'], errors='coerce')\ndf[\"Trade Balance\"] = df[\"India_Exports\"] - df[\"India_Imports\"]\ndf[\"Total Trade\"] = df[\"India_Exports\"] + df[\"India_Imports\"]\n\n# 🔥 1. India's Exports \u0026 Imports Over Time\nplt.figure(figsize=(12, 6))\nsns.lineplot(x=\"Year\", y=\"India_Exports\", data=df, label=\"Exports\", marker=\"o\", color=\"blue\")\nsns.lineplot(x=\"Year\", y=\"India_Imports\", data=df, label=\"Imports\", marker=\"s\", color=\"red\")\nplt.title(\"India's Exports \u0026 Imports (1948-2023)\")\nplt.xlabel(\"Year\")\nplt.ylabel(\"USD Billion\")\nplt.legend()\nplt.grid(True)\nplt.show()\n\n\n```\n\n## 📸 Generated Visualizations\n\n### 1. Export \u0026 Import Growth Trend (2013-2023)\n\u003cimg src=\"https://github.com/pradip-data/World-Merchandise-Trade/blob/5703071258d0cde18e647cb57597d209c0c411ed/Python%20Visulization%20Images/Exports%20%20%26%20Imports%20Growth%20Trends%20(2013-23).png\" alt=\"Export \u0026 Import Growth Trend (2013-2023)\" width=\"700\"\u003e\n\n### 2. India's Imports \u0026 Exports Trend (1948-2023)\n\u003cimg src=\"https://github.com/pradip-data/World-Merchandise-Trade/blob/58fb7f7c181b34e5b378d24e4360c2145e1d0871/Python%20Visulization%20Images/India's%20Import%20%26%20%20Export%20Trend%20(1948-2023).png\" alt=\"India's Imports \u0026 Exports Trend (1948-2023)\" width=\"700\"\u003e\n\n### 3. India's Trade Breakdown 2023\n\u003cimg src=\"https://github.com/pradip-data/World-Merchandise-Trade/blob/c4ece9e5dc5ee4cb9005fa5a06d418e5ce1257f7/Python%20Visulization%20Images/India's%20Trade%20Breakdown%202023.png\" alt=\"India's Trade Breakdown 2023\" width=\"700\"\u003e\n\n### 4. India's Share in Global Trade over Time\n\u003cimg src=\"https://github.com/pradip-data/World-Merchandise-Trade/blob/3c9f7c3ba825869d09cbe7026b679f782c8f2ba7/Python%20Visulization%20Images/India's%20share%20in%20global%20Trade%20over%20time.png\" alt=\"India's Share in Global Trade over Time\" width=\"700\"\u003e\n\n### 5. Top 10 Countries with Highest Trade Deficit\n\u003cimg src=\"https://github.com/pradip-data/World-Merchandise-Trade/blob/44be331f8864320bb7f4659f69dbe951fc8a82a8/Python%20Visulization%20Images/Top%2010%20Countries%20with%20Heighest%20Trade%20Deficit%202023.png\" alt=\"Top 10 Countries with Highest Trade Deficit\" width=\"700\"\u003e\n\n### 6. India's Position in Trade 2023\n\u003cimg src=\"https://github.com/pradip-data/World-Merchandise-Trade/blob/2d6593da546c6988dbf643aa0d53e0d4423b7976/Python%20Visulization%20Images/indias%20position%20in%20Trade%202023.png\" alt=\"India's Position in Trade 2023\" width=\"700\"\u003e\n\n### 7. Trade Deficit Comparison between India and China (2023)\n\u003cimg src=\"https://github.com/pradip-data/World-Merchandise-Trade/blob/8b0ba5037c04b0e590c577f9310c67e6337c7584/Python%20Visulization%20Images/india%20vs%20china%20Trade%20Deficit%20Comparision%202023.png\" alt=\"Trade Deficit Comparison between India and China (2023)\" width=\"700\"\u003e\n\n\n\n\n---\n\n## 🔍 Section C : AI-Generated Reports\n\n### 📄 1. Detailed Insights, Observations, and Recommendations on India's Trade Performance (2023)\n📌 **Comprehensive analysis** covering key insights, trends, and expert recommendations for India's trade performance in 2023.  \n📂 **[View Report](https://github.com/pradip-data/World-Merchandise-Trade/blob/4ab61b1a611682941040f6f859c2f8a83a4d19aa/AI%20Generated%20Insights%20%26%20Recommendation/Detailed%20Insights%2C%20Observations%2C%20and%20Recommendations%20on%20India%E2%80%99s%20Trade%20Performance%20(2023).pdf)**  \n\n---\n\n### 📄 2. India's Product-wise Trade Performance (1948-2023)\n📌 **In-depth report** analyzing India's product-wise trade trends from 1948 to 2023, highlighting key patterns and growth opportunities.  \n📂 **[View Report](https://github.com/pradip-data/World-Merchandise-Trade/blob/8ba22ef6284438ed8727f88f5664873bc7a6b704/AI%20Generated%20Insights%20%26%20Recommendation/Insights-India's%20Product-wise%20Trade%20Performance%20(1948-2023)%20detailed.pdf)**  \n\n\n\n\n---\n\n\n# 🌍 India's Trade Performance Analysis (2023) 🚀\n\n## 📊 Insights: India's Trade Performance in 2023\n\n- **Exports:** 💰 $431,574 Million USD\n- **India's Export Percentage:** 🌎 1.81%\n- **Export Rank:** 📈 17\n- **Imports:** 💰 $672,231 Million USD\n- **India's Import Percentage:** 🌍 2.77%\n- **Import Rank:** 📉 8\n- **Total Trade:** 💰 $1,103,805 Million USD\n- **India's Total Trade Percentage:** 🌏 2.3%\n- **Trade Rank:** 📊 14\n- **Trade Deficit:** ❌ $240,657 Million USD\n\nIndia 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.\n\n---\n\n## 🌎 Top Exporting Countries \u0026 Rankings (2023)\n\n- 1️⃣ **China** - $3,379,255M\n- 2️⃣ **United States** - $2,020,606M\n- 3️⃣ **Germany** - $1,718,251M\n- 4️⃣ **Netherlands** - $936,392M\n- 5️⃣ **Japan** - $717,261M\n- 6️⃣ **Italy** - $676,993M\n- 7️⃣ **France** - $648,569M\n- 8️⃣ **South Korea** - $632,226M\n- 9️⃣ **Mexico** - $593,005M\n- 🔟 **Hong Kong** - $573,871M\n\n---\n\n## 🌍 Top Importing Countries \u0026 Rankings (2023)\n\n- 1️⃣ **United States** - $3,172,476M\n- 2️⃣ **China** - $2,556,565M\n- 3️⃣ **Germany** - $1,476,656M\n- 4️⃣ **Netherlands** - $842,331M\n- 5️⃣ **United Kingdom** - $791,523M\n- 6️⃣ **France** - $786,158M\n- 7️⃣ **Japan** - $785,796M\n- 8️⃣ **India** - $672,231M\n- 9️⃣ **Hong Kong** - $653,696M\n- 🔟 **South Korea** - $642,572M\n\n---\n\n## 💰 Countries with the Highest Trade Surpluses (2023)\n\n🔹 **China** - $822,690M\n🔹 **Germany** - $241,595M\n🔹 **Russia** - $120,925M\n🔹 **Saudi Arabia** - $113,078M\n🔹 **Netherlands** - $94,061M\n\n---\n\n## 🔴 Countries with the Highest Trade Deficits (2023)\n\n❌ **United States** - $1,151,870M\n❌ **United Kingdom** - $270,483M\n❌ **India** - $240,657M\n❌ **France** - $137,589M\n❌ **Türkiye** - $106,327M\n\n---\n\n## ⚠️ Key Challenges Identified\n\n- 1️⃣ **High Import Dependency** 🏭: India imports more than it exports in key categories like **fuels, machinery, and pharmaceuticals**, leading to a trade imbalance.\n- 2️⃣ **Weak Export Competitiveness** 📉: India's **export share (1.81%)** is much lower than its economic size, indicating **low global competitiveness**.\n- 3️⃣ **Sector-Specific Deficits** 🏥: Deficits in **pharmaceuticals and food sectors** suggest a **need for domestic production growth and export incentives**.\n- 4️⃣ **Limited Market Penetration** 🌎: India relies **heavily on traditional export markets**, limiting its trade reach.\n\n---\n\n## 🎯 Strategic Recommendations \u0026 Policy Suggestions\n\n### A. 🚀 Boosting Exports\n✅ **Expand High-Value Manufacturing** 🔧\n   - Encourage **semiconductor, AI, and high-tech industries**\n   - Invest in **automobile and electronics manufacturing**\n✅ **Strengthen Trade Agreements** 🤝\n   - Negotiate **preferential trade deals** with **Africa, Latin America, and Southeast Asia**\n✅ **Enhance Export Incentives** 📈\n   - Introduce **tax benefits for export-driven industries**\n\n### B. 📉 Reducing Import Dependence\n✅ **Increase Domestic Production in Deficit Sectors** 🏭\n   - Expand **pharmaceutical manufacturing** to reduce **$17.9B deficit**\n   - Boost **agriculture and textile production** to cut food \u0026 clothing imports\n✅ **Invest in Renewable Energy** ☀️\n   - Reduce **oil import dependency ($220.6B)** by investing in **solar, wind, and green hydrogen**\n\n### C. 🚢 Strengthening Trade Infrastructure\n✅ **Improve Logistics \u0026 Ports** ⚓\n   - Reduce **trade costs and shipment delays** to make exports more competitive\n✅ **Ease Business Regulations** 📜\n   - Simplify **tax laws and streamline customs processes** for exporters\n\n### D. 🌏 Diversifying Export Markets\n✅ **Expand Beyond Traditional Markets** 🌍\n   - Strengthen trade with **Africa, Middle East, and Latin America**\n   - Reduce **over-reliance on US and European markets**\n\n---\n\n## 🔮 Final Outlook\n\nIndia 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.\n\n### 🎯 Key Focus Areas for 2024 \u0026 Beyond\n- ✅ Strengthen **high-value manufacturing exports**\n- ✅ Reduce **fuel \u0026 machinery import dependency**\n- ✅ Improve **trade policies and agreements**\n- ✅ Expand **global market reach beyond traditional partners**\n- ✅ Invest in **logistics and supply chain efficiency** 🚢\n\n---\n\n### 📊 BigQuery Analysis \u0026 Python Visualizations\n\n📌 **BigQuery SQL Code \u0026 Execution Screenshots**\n📌 **Python Code for Trade Analysis \u0026 Data Visualization**\n📌 **ChatGPT AI Report Generation \u0026 Insights**\n\n\n## 🏆 Final Thoughts\nIndia has the potential to become a **major global trade powerhouse** but must address:\n\n📉 **Trade Deficit Challenges** – Reduce reliance on imports.  \n🚀 **Boost Export Competitiveness** – Focus on high-value industries.  \n🌎 **Expand Market Reach** – Diversify beyond traditional partners.  \n\nBy 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.  \n\n---\n\n🔗 Author \u0026 Contributions \n👤 Your Name - Mangroliya Pradip\n📩 For inquiries, reach out at: pradipias2023@gmail.com \n---\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpradip-data%2Fworld-merchandise-trade","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpradip-data%2Fworld-merchandise-trade","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpradip-data%2Fworld-merchandise-trade/lists"}