# rektpunk/ppalgannal architecture

> Architecture diagram of the GitHub repository rektpunk/ppalgannal, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rektpunk/ppalgannal
- Repository: https://github.com/rektpunk/ppalgannal

## Overview

ppalgannal is a zero-dependency Python library for South Korean public and substitute holidays. A caller uses the exported API to list a year’s holidays or check a date; the calculator builds the calendar from solar, lunar, and special-date definitions, converts lunar dates, applies substitute rules, then returns sorted holiday records or a boolean. The graph includes the constants and conversion layer supporting that workflow. Relationships are based on the shown imports and calls or README usage; no external services or persistent storage are documented.

Main entry points: [`src/ppalgannal/holidays/calc.py`](https://github.com/rektpunk/ppalgannal/blob/main/src/ppalgannal/holidays/calc.py) (Calendar Calculator), [`src/ppalgannal/__init__.py`](https://github.com/rektpunk/ppalgannal/blob/main/src/ppalgannal/__init__.py) (Holiday API), [`src/ppalgannal/holidays/substitute.py`](https://github.com/rektpunk/ppalgannal/blob/main/src/ppalgannal/holidays/substitute.py) (Substitute Rules), [`src/ppalgannal/lunar/convert.py`](https://github.com/rektpunk/ppalgannal/blob/main/src/ppalgannal/lunar/convert.py) (Lunar Converter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Public API"]
  node_public_api["Holiday API<br/>[__init__.py]"]
end

subgraph group_calendar["Holiday Calendar"]
  node_calculator["Calendar Calculator<br/>[calc.py]"]
  node_holiday_definitions["Holiday Definitions<br/>[constant.py]"]
  node_substitute_rules["Substitute Rules<br/>[substitute.py]"]
end

subgraph group_lunar["Lunar Conversion"]
  node_lunar_converter["Lunar Converter<br/>[convert.py]"]
  node_lunar_data["Lunar Data<br/>[constant.py]"]
end

node_caller(("Python Caller"))

node_caller -->|"requests holidays"| node_public_api
node_public_api -->|"exports functions"| node_calculator
node_calculator -->|"reads definitions"| node_holiday_definitions
node_calculator -->|"adds substitutes"| node_substitute_rules
node_calculator -->|"converts dates"| node_lunar_converter
node_lunar_converter -->|"reads data"| node_lunar_data
node_substitute_rules -->|"uses rule types"| node_holiday_definitions

click node_public_api "https://github.com/rektpunk/ppalgannal/blob/main/src/ppalgannal/__init__.py"
click node_calculator "https://github.com/rektpunk/ppalgannal/blob/main/src/ppalgannal/holidays/calc.py"
click node_holiday_definitions "https://github.com/rektpunk/ppalgannal/blob/main/src/ppalgannal/holidays/constant.py"
click node_substitute_rules "https://github.com/rektpunk/ppalgannal/blob/main/src/ppalgannal/holidays/substitute.py"
click node_lunar_converter "https://github.com/rektpunk/ppalgannal/blob/main/src/ppalgannal/lunar/convert.py"
click node_lunar_data "https://github.com/rektpunk/ppalgannal/blob/main/src/ppalgannal/lunar/constant.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_public_api toneBlue
class node_calculator,node_holiday_definitions,node_substitute_rules toneAmber
class node_lunar_converter,node_lunar_data toneMint
class node_caller toneIndigo
```

## Components

### Public API

- [Holiday API](https://github.com/rektpunk/ppalgannal/blob/main/src/ppalgannal/__init__.py): `src/ppalgannal/__init__.py`

### Holiday Calendar

- [Calendar Calculator](https://github.com/rektpunk/ppalgannal/blob/main/src/ppalgannal/holidays/calc.py): `src/ppalgannal/holidays/calc.py`
- [Holiday Definitions](https://github.com/rektpunk/ppalgannal/blob/main/src/ppalgannal/holidays/constant.py): `src/ppalgannal/holidays/constant.py`
- [Substitute Rules](https://github.com/rektpunk/ppalgannal/blob/main/src/ppalgannal/holidays/substitute.py): `src/ppalgannal/holidays/substitute.py`

### Lunar Conversion

- [Lunar Converter](https://github.com/rektpunk/ppalgannal/blob/main/src/ppalgannal/lunar/convert.py): `src/ppalgannal/lunar/convert.py`
- [Lunar Data](https://github.com/rektpunk/ppalgannal/blob/main/src/ppalgannal/lunar/constant.py): `src/ppalgannal/lunar/constant.py`

### Other components

- **Python Caller**

## Connections

- Python Caller → Holiday API: requests holidays (evidence: `README.md`)
- Holiday API → Calendar Calculator: exports functions (evidence: `src/ppalgannal/__init__.py`)
- Calendar Calculator → Holiday Definitions: reads definitions (evidence: `src/ppalgannal/holidays/calc.py`)
- Calendar Calculator → Substitute Rules: adds substitutes (evidence: `src/ppalgannal/holidays/calc.py`)
- Calendar Calculator → Lunar Converter: converts dates (evidence: `src/ppalgannal/holidays/calc.py`)
- Lunar Converter → Lunar Data: reads data (evidence: `src/ppalgannal/lunar/convert.py`)
- Substitute Rules → Holiday Definitions: uses rule types (evidence: `src/ppalgannal/holidays/substitute.py`)
