# mo-ramezanpour/merging-excel-files architecture

> Architecture diagram of the GitHub repository mo-ramezanpour/merging-excel-files, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mo-ramezanpour/merging-excel-files
- Repository: https://github.com/mo-ramezanpour/merging-excel-files

## Overview

##### Main Components
- Data Sources: Represented by the three input Excel files (Ireland.xlsx, Japan.xlsx, Norway.xlsx). These files are the raw data source.
- Data Ingestion/Processing Module: This is the core of the application - encapsulated in Sales.py. It reads data from the Excel files, converts them into pandas DataFrames, and performs operations such as adding new columns (month, year, percentage calculations, etc.), concatenating the data, and formatting.
- Transformation and Calculation: Within Sales.py, you have multiple transformation steps such as format conversion for sales numbers, calculation of totals and percentages, and adding additional columns (e.g., total monthly sales).
- Data Output Module: The final step in the process writes the combined and transformed DataFrame to a new Excel file (Total_Sales.xlsx).

##### Relationships and Interactions
- Internal Processes: Within Sales.py, break down the workflow to show sequential transformations – data reading, data transformation (column additions, conversions, calculations), and final output writing.
- Use components such as blocks for “Data Ingestion”, “Data Transformation”, and “Data Output” to clearly show the process.

##### Architectural Patterns
- Data Pipeline Pattern: The design mimics a data pipeline where each stage processes the data further until the output is produced.

##### Relevant Technologies
- Python as the programming language.
- pandas for data reading, manipulation, and writing.
- Excel files as the data source and output format.
- Additional dependencies or libraries if they are used (e.g., numpy), though pandas is the primary one mentioned in the README.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Input Files
    subgraph "Input Files"
        I["Ireland.xlsx"]:::input
        J["Japan.xlsx"]:::input
        N["Norway.xlsx"]:::input
    end

    %% External Library
    P["pandas Library"]:::library

    %% Sales.py Processing Module
    subgraph "Sales.py Processing Module"
        rd["Sales.py: Read Data"]:::process
        dt["Sales.py: Data Transformation\n(Add Columns, Format, Calculations)"]:::process
        wf["Sales.py: Write File"]:::process
    end

    %% Data Output
    tot["Total_Sales.xlsx"]:::output

    %% Data Flows
    I --> rd
    J --> rd
    N --> rd

    P --- rd

    rd --> dt
    dt --> wf
    wf --> tot

    %% Click Events
    click I "https://github.com/mo-ramezanpour/merging-excel-files/blob/main/Ireland.xlsx"
    click J "https://github.com/mo-ramezanpour/merging-excel-files/blob/main/Japan.xlsx"
    click N "https://github.com/mo-ramezanpour/merging-excel-files/blob/main/Norway.xlsx"
    click rd "https://github.com/mo-ramezanpour/merging-excel-files/blob/main/Sales.py"
    click dt "https://github.com/mo-ramezanpour/merging-excel-files/blob/main/Sales.py"
    click wf "https://github.com/mo-ramezanpour/merging-excel-files/blob/main/Sales.py"
    click tot "https://github.com/mo-ramezanpour/merging-excel-files/blob/main/Total_Sales.xlsx"

    %% Styles
    classDef input fill:#cce5ff,stroke:#003366,stroke-width:2px;
    classDef process fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef output fill:#f8d7da,stroke:#721c24,stroke-width:2px;
    classDef library fill:#fff3cd,stroke:#856404,stroke-width:2px;
```
