# lehcimhdz/registros_public_version architecture

> Architecture diagram of the GitHub repository lehcimhdz/registros_public_version, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lehcimhdz/registros_public_version
- Repository: https://github.com/lehcimhdz/registros_public_version

## Overview

##### Project Type & Purpose
- Type: A batch-oriented document-generation and processing tool written in Python (evidenced by código.ipynb).
- Purpose: Automate creation of registry documents (“acuerdos”, “oficios”) from CSV inputs to reduce manual work for victim assistance staff.

##### File Structure
- Top-level data sources:
- data_registro.csv, Oficios_Informe.csv
- Template directories:
- Word_Oficios/ (Word-format letter templates)
- Acuerdos_Víctimas_Python/ (Python-ready “acuerdo” templates? possibly scripts or ancillary files)
- PDF_Oficios/ and PDF_Acuerdos_Víctimas_Python/ (output or intermediate PDFs)
- Key management:
- Llaves/ (likely cryptographic keys or credentials for signing)
- Processing logic:
- código.ipynb (Jupyter notebook orchestrating the pipeline)

##### Main Components
a. Data Ingestion Layer
– Sources: CSV files (data_registro.csv, Oficios_Informe.csv)
b. Template Storage
– Word_Oficios (letter .docx templates)
– Acuerdos_Víctimas_Python (agreement templates or helper scripts)
c. Processing Engine
– código.ipynb (Python runtime)
– External libraries: python-docx, reportlab/PyPDF2 (for PDF generation), pandas
– Key Store: Llaves (used by the engine to sign/embed keys into PDFs)
d. Output Storage
– PDF_Oficios (generated official letters)
– PDF_Acuerdos_Víctimas_Python (generated agreements)
e. (Optional) Logging/Monitoring

##### Relationships & Data Flows
- CSV Data → Processing Engine
- Template Storage → Processing Engine
- Llaves (Key Store) → Processing Engine
- Processing Engine → Output Storage (two targets: PDF_Oficios, PDF_Acuerdos)
- (If relevant) Processing Engine → Logs

##### Architectural Patterns & Design Principles
- Batch pipeline: all inputs are processed in discrete runs.
- Separation of concerns:
- Data layer (CSV storage)
- Template layer (Word & agreement templates)
- Processing layer (notebook/script)
- Key management (cryptographic isolation)
- Output layer (PDF directories)
- Use of external libs for document manipulation and signing.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data Sources
    DR["data_registro.csv"]:::data
    OI["Oficios_Informe.csv"]:::data

    %% Template Stores
    WT["Word_Oficios/"]:::template
    AT["Acuerdos_Víctimas_Python/"]:::template

    %% Key Store
    KS["Llaves/"]:::keystore

    %% Processing Engine
    PE["código.ipynb<br/>+ python-docx, pandas, PyPDF2"]:::processing

    %% Output Stores
    PO["PDF_Oficios/"]:::output
    PA["PDF_Acuerdos_Víctimas_Python/"]:::output

    %% Data Flows
    DR -->|"reads CSV"| PE
    OI -->|"reads CSV"| PE
    WT -->|"applies template"| PE
    AT -->|"applies template"| PE
    KS -->|"uses key"| PE
    PE -->|"writes PDFs"| PO
    PE -->|"writes PDFs"| PA

    %% Click Events
    click DR "https://github.com/lehcimhdz/registros_public_version/blob/main/data_registro.csv"
    click OI "https://github.com/lehcimhdz/registros_public_version/blob/main/Oficios_Informe.csv"
    click WT "https://github.com/lehcimhdz/registros_public_version/tree/main/Word_Oficios/"
    click AT "https://github.com/lehcimhdz/registros_public_version/tree/main/Acuerdos_Víctimas_Python/"
    click KS "https://github.com/lehcimhdz/registros_public_version/tree/main/Llaves/"
    click PE "https://github.com/lehcimhdz/registros_public_version/blob/main/código.ipynb"
    click PO "https://github.com/lehcimhdz/registros_public_version/tree/main/PDF_Oficios/"
    click PA "https://github.com/lehcimhdz/registros_public_version/tree/main/PDF_Acuerdos_Víctimas_Python/"

    %% Styles
    classDef data fill:#bbdefb,stroke:#1976d2,stroke-width:1px
    classDef template fill:#c8e6c9,stroke:#388e3c,stroke-width:1px
    classDef processing fill:#ffcc80,stroke:#ef6c00,stroke-width:1px
    classDef keystore fill:#fff59d,stroke:#f9a825,stroke-width:1px
    classDef output fill:#e1bee7,stroke:#8e24aa,stroke-width:1px
```
