# izidorome/hpy12c architecture

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

- Interactive diagram: https://gitdiagram.com/izidorome/hpy12c
- Repository: https://github.com/izidorome/hpy12c

## Overview

##### Project Type Analysis
This is a specialized mathematical/financial library that:
- Is dependency-free (pure Python)
- Provides financial calculations
- Is designed to be lightweight and portable
- Serves as an alternative to NumPy financial functions

##### Main Components

Core Components:
a) Financial Function Module (hpy12c.py)
- Contains all financial calculation implementations

b) Function Categories (group the functions into logical clusters):
- Time Value of Money (PV, FV, PMT)
- Interest Rate Functions (RATE, IRR)
- Payment Analysis (IPMT, PPMT)
- Period Calculations (NPER)
- Investment Analysis (NPV)

**[Core Module: hpy12c.py]**

- ┬─────────────────┬─────────────────┐

**[Time Value Funcs]  [Interest Funcs]  [Payment Funcs]  [Analysis Funcs]**
- PV               - RATE             - IPMT            - NPV
- FV               - IRR              - PPMT            - NPER
- PMT

##### Important Details to Highlight

a) Pure Python Implementation:
- A note emphasizing no external dependencies
- Standalone nature of the implementation

b) Testing Coverage:
- A testing layer showing comprehensive test coverage
- Link each function to its corresponding test file

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Legend
        L1[Function Module]
        L2[Function Category]
        L3[Individual Function]
        L4[Test File]
        
        classDef module fill:#3498db,stroke:#2980b9,color:white
        classDef category fill:#2ecc71,stroke:#27ae60,color:white
        classDef function fill:#95a5a6,stroke:#7f8c8d,color:white
        classDef test fill:#e74c3c,stroke:#c0392b,color:white
        
        class L1 module
        class L2 category
        class L3 function
        class L4 test
    end

    Core[HPy12C Core]:::module
    click Core "https://github.com/izidorome/hpy12c/blob/master/hpy12c.py"

    subgraph Time Value Functions
        TVF[Time Value Calculations]:::category
        PV[Present Value]:::function
        FV[Future Value]:::function
        PMT[Payment]:::function
        
        TVF --> PV & FV & PMT
        
        click PV "https://github.com/izidorome/hpy12c/blob/master/tests/test_pv.py"
        click FV "https://github.com/izidorome/hpy12c/blob/master/tests/test_fv.py"
        click PMT "https://github.com/izidorome/hpy12c/blob/master/tests/test_pmt.py"
    end

    subgraph Interest Functions
        IF[Interest Calculations]:::category
        RATE[Rate]:::function
        IRR[Internal Rate of Return]:::function
        
        IF --> RATE & IRR
        
        click RATE "https://github.com/izidorome/hpy12c/blob/master/tests/test_rate.py"
        click IRR "https://github.com/izidorome/hpy12c/blob/master/tests/test_irr.py"
    end

    subgraph Payment Analysis
        PA[Payment Analysis]:::category
        IPMT[Interest Payment]:::function
        PPMT[Principal Payment]:::function
        
        PA --> IPMT & PPMT
        
        click IPMT "https://github.com/izidorome/hpy12c/blob/master/tests/test_ipmt.py"
        click PPMT "https://github.com/izidorome/hpy12c/blob/master/tests/test_ppmt.py"
    end

    subgraph Investment Analysis
        IA[Investment Analysis]:::category
        NPV[Net Present Value]:::function
        NPER[Number of Periods]:::function
        
        IA --> NPV & NPER
        
        click NPV "https://github.com/izidorome/hpy12c/blob/master/tests/test_npv.py"
        click NPER "https://github.com/izidorome/hpy12c/blob/master/tests/test_nper.py"
    end

    Core --> TVF & IF & PA & IA

    subgraph Testing Framework
        TF[Test Configuration]:::test
        click TF "https://github.com/izidorome/hpy12c/blob/master/tests/conftest.py"
    end

    TVF & IF & PA & IA --> TF

    classDef module fill:#3498db,stroke:#2980b9,color:white
    classDef category fill:#2ecc71,stroke:#27ae60,color:white
    classDef function fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef test fill:#e74c3c,stroke:#c0392b,color:white
```
