# adityagupta-07/payslip-processor architecture

> Architecture diagram of the GitHub repository adityagupta-07/payslip-processor, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/adityagupta-07/payslip-processor
- Repository: https://github.com/adityagupta-07/payslip-processor

## Overview

Payslip Processor turns an Excel payroll workbook into employee-specific payslips and a combined master PDF, with individual PDFs password-protected using employee PANs. The user selects a workbook in the GUI; the pipeline loads it, identifies employee data, renders Word payslips, converts and combines PDFs, then protects the individual files. The graph follows calls visible in the sampled source and capabilities documented in the README. The password-protection implementation was not sampled, so its internal steps are not expanded.

Main entry points: [`src/pipeline.py`](https://github.com/adityagupta-07/payslip-processor/blob/master/src/pipeline.py) (Batch pipeline), [`src/docx_generator.py`](https://github.com/adityagupta-07/payslip-processor/blob/master/src/docx_generator.py) (Payslip renderer), [`src/pdf_converter.py`](https://github.com/adityagupta-07/payslip-processor/blob/master/src/pdf_converter.py) (PDF converter), [`src/excel_reader.py`](https://github.com/adityagupta-07/payslip-processor/blob/master/src/excel_reader.py) (Excel reader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_gui["GUI<br/>[gui.py]"]
end

subgraph group_processing["Payroll processing"]
  node_pipeline["Batch pipeline<br/>[pipeline.py]"]
  node_paths["Output paths<br/>[directories.py]"]
  node_excel["Excel reader<br/>[excel_reader.py]"]
  node_parser["Employee parser<br/>[employee_parser.py]"]
  node_employee["Employee data<br/>[config.py]"]
end

subgraph group_documents["Document generation"]
  node_docx["Payslip renderer<br/>[docx_generator.py]"]
  node_template_id["ID template<br/>[template_id.docx]"]
  node_template_no_id["No-ID template"]
end

subgraph group_delivery["PDF delivery"]
  node_converter["PDF converter<br/>[pdf_converter.py]"]
  node_protector["PDF protection"]
  node_output["Generated files"]
end

node_user(("User"))
node_workbook["Excel workbook"]
node_libreoffice["LibreOffice"]

node_user -->|"selects workbook"| node_gui
node_user -->|"provides"| node_workbook
node_gui -->|"starts processing"| node_pipeline
node_pipeline -->|"creates output directories"| node_paths
node_pipeline -->|"loads workbook"| node_excel
node_workbook -->|"read by"| node_excel
node_pipeline -->|"extracts employees"| node_parser
node_excel -->|"provides sheet"| node_parser
node_parser -->|"populates"| node_employee
node_pipeline -->|"renders payslips"| node_docx
node_employee -->|"provides values"| node_docx
node_docx -->|"uses when ID present"| node_template_id
node_docx -->|"uses when ID absent"| node_template_no_id
node_docx -->|"writes Word files"| node_output
node_pipeline -->|"converts and combines"| node_converter
node_converter -->|"converts DOCX"| node_libreoffice
node_converter -->|"writes PDFs"| node_output
node_pipeline -->|"protects individual PDFs"| node_protector
node_protector -->|"writes protected PDFs"| node_output

click node_gui "https://github.com/adityagupta-07/payslip-processor/blob/master/src/gui.py"
click node_pipeline "https://github.com/adityagupta-07/payslip-processor/blob/master/src/pipeline.py"
click node_paths "https://github.com/adityagupta-07/payslip-processor/blob/master/src/directories.py"
click node_excel "https://github.com/adityagupta-07/payslip-processor/blob/master/src/excel_reader.py"
click node_parser "https://github.com/adityagupta-07/payslip-processor/blob/master/src/employee_parser.py"
click node_employee "https://github.com/adityagupta-07/payslip-processor/blob/master/src/config.py"
click node_docx "https://github.com/adityagupta-07/payslip-processor/blob/master/src/docx_generator.py"
click node_template_id "https://github.com/adityagupta-07/payslip-processor/blob/master/src/templates/docx/template_id.docx"
click node_template_no_id "https://github.com/adityagupta-07/payslip-processor/blob/master/src/templates/docx/template_no_id.docx"
click node_converter "https://github.com/adityagupta-07/payslip-processor/blob/master/src/pdf_converter.py"
click node_protector "https://github.com/adityagupta-07/payslip-processor/blob/master/src/password_protect_pdf.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_gui,node_user toneBlue
class node_pipeline,node_paths,node_excel,node_parser,node_employee toneAmber
class node_docx,node_template_id,node_template_no_id toneMint
class node_converter,node_protector,node_output toneRose
class node_workbook,node_libreoffice toneIndigo
```

## Components

### User interface

- [GUI](https://github.com/adityagupta-07/payslip-processor/blob/master/src/gui.py): `src/gui.py`

### Payroll processing

- [Batch pipeline](https://github.com/adityagupta-07/payslip-processor/blob/master/src/pipeline.py): `src/pipeline.py`
- [Output paths](https://github.com/adityagupta-07/payslip-processor/blob/master/src/directories.py): `src/directories.py`
- [Excel reader](https://github.com/adityagupta-07/payslip-processor/blob/master/src/excel_reader.py): `src/excel_reader.py`
- [Employee parser](https://github.com/adityagupta-07/payslip-processor/blob/master/src/employee_parser.py): `src/employee_parser.py`
- [Employee data](https://github.com/adityagupta-07/payslip-processor/blob/master/src/config.py): `src/config.py`

### Document generation

- [Payslip renderer](https://github.com/adityagupta-07/payslip-processor/blob/master/src/docx_generator.py): `src/docx_generator.py`
- [ID template](https://github.com/adityagupta-07/payslip-processor/blob/master/src/templates/docx/template_id.docx): `src/templates/docx/template_id.docx`
- [No-ID template](https://github.com/adityagupta-07/payslip-processor/blob/master/src/templates/docx/template_no_id.docx): `src/templates/docx/template_no_id.docx`

### PDF delivery

- [PDF converter](https://github.com/adityagupta-07/payslip-processor/blob/master/src/pdf_converter.py): `src/pdf_converter.py`
- [PDF protection](https://github.com/adityagupta-07/payslip-processor/blob/master/src/password_protect_pdf.py): `src/password_protect_pdf.py`
- **Generated files**

### Other components

- **User**
- **Excel workbook**
- **LibreOffice**

## Connections

- User → GUI: selects workbook
- User → Excel workbook: provides
- GUI → Batch pipeline: starts processing
- Batch pipeline → Output paths: creates output directories
- Batch pipeline → Excel reader: loads workbook
- Excel workbook → Excel reader: read by
- Batch pipeline → Employee parser: extracts employees
- Excel reader → Employee parser: provides sheet
- Employee parser → Employee data: populates
- Batch pipeline → Payslip renderer: renders payslips
- Employee data → Payslip renderer: provides values
- Payslip renderer → ID template: uses when ID present
- Payslip renderer → No-ID template: uses when ID absent
- Payslip renderer → Generated files: writes Word files
- Batch pipeline → PDF converter: converts and combines
- PDF converter → LibreOffice: converts DOCX
- PDF converter → Generated files: writes PDFs
- Batch pipeline → PDF protection: protects individual PDFs
- PDF protection → Generated files: writes protected PDFs
