How julianchisco93/supply-chain-shipment-summary-tool works
1. Project type and runtime
This is a small, local Python analytics application, not a service. Its core runtime is a script-based workflow driven by main.py, with Jupyter notebooks used for module-level validation and demos.
2. Primary data boundary
The system centers on one source dataset in data/supply_delivery_history.csv. That raw file is treated as the input boundary; a cleaned derivative, data/supply_delivery_history_clean.csv, is the analysis-ready output boundary.
3. Ingestion and loading layer
src/data_loader.py is the entry point for reading the shipment CSV into memory, likely into a pandas DataFrame. This module isolates file access from downstream analysis so the rest of the code can operate on a consistent in-memory dataset.
4. Cleaning pipeline
src/cleaning.py prepares the raw shipment records for analysis. Based on the README, it handles inconsistent dates, numeric coercion, missing values, and categorical normalization, then writes the cleaned CSV back to data/. This is the main transformation boundary between raw data and reliable analytics.
5. Shared shipment summary layer
src/shipment_summary.py provides cross-cutting metrics about shipment activity, such as shipment mode, fulfillment type, delivery year, shipment volume, shipment value, freight cost, and delivery delay. It is the general-purpose operational summary module used to create a broad supply-chain overview.
6. Country-focused analytics
src/country_analysis.py groups shipments by destination country and produces measures like quantity, value, count, and top countries by revenue. This module represents a location-based aggregation boundary, separate from product and vendor concerns.
7. Product-focused analytics
src/product_analysis.py analyzes shipment behavior by product group, subclassification, and product description. Its role is to convert line-item shipment records into product portfolio insights, such as top products by quantity and category distribution.
8. Vendor-focused analytics
src/vendor_analysis.py evaluates supplier performance using shipment record counts, total quantity, total value, and ranking outputs for top and bottom vendors. This module is the vendor-domain boundary and likely feeds the vendor charts and summary tables described in the README.
9. Integration and orchestration
main.py is the orchestration layer. It ties together loading, cleaning, saving the cleaned dataset, and then running shipment, country, product, and vendor analyses in one workflow. Conceptually, it is the only place where the full end-to-end execution path is assembled.
10. Exploration, validation, and outputs
The notebooks/ folder contains demo notebooks for individual subsystems, so they function as a testing and exploration layer rather than production code. Output artifacts include printed tables, charts, and screenshots under reports/screenshots/, which suggests the application is primarily a local reporting tool rather than an API or database-backed system.
11. Dependencies and technology choices
The architecture is built around pandas/numpy for data manipulation and matplotlib/seaborn for visualization, with Jupyter for validation. These libraries shape the design: file-based ETL, DataFrame-centric transformations, and chart generation, all without an external database or web framework.
12. Repository structure as modular boundaries
The code is intentionally split by concern: loader, cleaner, shipment summary, country, product, and vendor. That separation makes the architecture easy to diagram as a pipeline: raw CSV in, cleaning in the middle, multiple independent analytical branches out, with main.py coordinating the full run.
Main entry points: main.py Main · notebooks Notebooks · supply_delivery_history_clean.csv Clean CSV · data_loader.py Loader
Components 11
Data boundary
Raw input and cleaned analysis-ready output
Core workflow
Script-driven load, clean, and orchestration path
Analytics modules
Domain-specific shipment, country, product, and vendor analysis
- Shipment summary · Cross-cutting shipment activity metrics and operational summaries
src/shipment_summary.py - Country analysis · Aggregates shipments by destination country and revenue
src/country_analysis.py - Product analysis · Analyzes shipment behavior by product group and description
src/product_analysis.py - Vendor analysis · Evaluates supplier performance and vendor rankings
src/vendor_analysis.py
Connections 23
- Raw CSV → Loader: read · Load raw shipment data into memory
- Loader → Cleaning: dataframe · Pass loaded records into the cleaning stage
- Cleaning → Clean CSV: write · Persist cleaned shipment dataset
- Clean CSV → Shipment summary: analyze · Use cleaned data for shared shipment metrics
- Clean CSV → Country analysis: analyze · Use cleaned data for country aggregation
- Clean CSV → Product analysis: analyze · Use cleaned data for product analysis
- Clean CSV → Vendor analysis: analyze · Use cleaned data for vendor analysis
- Main → Loader: runs · Main script invokes the loading step
- Main → Cleaning: runs · Main script invokes the cleaning step
- Main → Shipment summary: runs · Main script executes shipment summary analysis
- Main → Country analysis: runs · Main script executes country analysis
- Main → Product analysis: runs · Main script executes product analysis
- Main → Vendor analysis: runs · Main script executes vendor analysis
- Notebooks → Loader: validate · Notebook demos exercise the loader module
- Notebooks → Cleaning: validate · Notebook demos exercise cleaning behavior
- Notebooks → Shipment summary: validate · Notebook demos validate shared shipment metrics
- Notebooks → Country analysis: validate · Notebook demos validate country analytics
- Notebooks → Product analysis: validate · Notebook demos validate product analytics
- Notebooks → Vendor analysis: validate · Notebook demos validate vendor analytics
- Shipment summary → Reports: visualize · Metrics and charts are captured as report artifacts
- Country analysis → Reports: visualize · Country results feed report outputs
- Product analysis → Reports: visualize · Product results feed report outputs
- Vendor analysis → Reports: visualize · Vendor results feed report outputs