# ahmetcolak16/izkod architecture

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

- Interactive diagram: https://gitdiagram.com/ahmetcolak16/izkod
- Repository: https://github.com/ahmetcolak16/izkod

## Overview

IzKod is a lossless CSV compression library and command-line comparison tool. Its user workflow is to provide CSV bytes or a file, choose among six archive levels, and receive a compressed archive; decoding restores the original bytes. The CLI also measures encode/decode size and time, checks round-trip equality, and compares reference codecs. The graph preserves the levels’ distinct strategies and the shared block-selection layer. Evidence is limited to the README title, source index references, and the excerpts shown; unsampled modules are represented only where their paths and connections are supported.

Main entry points: [`algorithms/compare_codecs.py`](https://github.com/ahmetcolak16/izkod/blob/main/algorithms/compare_codecs.py) (Comparison CLI), [`algorithms/izkod/api.py`](https://github.com/ahmetcolak16/izkod/blob/main/algorithms/izkod/api.py) (Compression API), [`algorithms/compression_levels/level_2.py`](https://github.com/ahmetcolak16/izkod/blob/main/algorithms/compression_levels/level_2.py) (Level 2), [`algorithms/compression_levels/level_3.py`](https://github.com/ahmetcolak16/izkod/blob/main/algorithms/compression_levels/level_3.py) (Level 3)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry points"]
  node_cli["Comparison CLI<br/>[compare_codecs.py]"]
  node_api["Compression API<br/>[api.py]"]
end

subgraph group_levels["Archive levels"]
  node_level1["Level 1<br/>[level_1.py]"]
  node_level2["Level 2<br/>[level_2.py]"]
  node_level3["Level 3<br/>[level_3.py]"]
  node_level4["Level 4 Greedy<br/>[level_4.py]"]
  node_level5["Level 5 DP<br/>[level_5.py]"]
  node_level6["Level 6 Dictionary<br/>[level_6.py]"]
end

subgraph group_blocks["Block strategies"]
  node_adaptive["Adaptive Boundaries<br/>[adaptive_blocks.py]"]
  node_fixed["Fixed Blocks<br/>[fixed_blocks.py]"]
end

subgraph group_codecs["Codecs"]
  node_rle["RLE Codec<br/>[rle.py]"]
  node_huffman["Huffman Codec<br/>[huffman.py]"]
end

node_user(("CLI User"))
node_client(("Library Client"))
node_csv["CSV Bytes"]
node_archive["IZK Archive"]

node_user -->|"runs comparison"| node_cli
node_csv -->|"provides file"| node_cli
node_cli -->|"measures"| node_level1
node_cli -->|"measures"| node_level2
node_cli -->|"measures"| node_level3
node_cli -->|"measures"| node_level4
node_cli -->|"measures"| node_level5
node_cli -->|"measures"| node_level6
node_cli -->|"measures reference"| node_rle
node_cli -->|"measures reference"| node_huffman
node_cli -->|"measures reference"| node_fixed
node_cli -->|"prepares candidates"| node_adaptive
node_client -->|"calls"| node_api
node_api -->|"dispatches"| node_level1
node_api -->|"dispatches"| node_level2
node_api -->|"dispatches"| node_level3
node_api -->|"dispatches"| node_level4
node_api -->|"dispatches"| node_level5
node_api -->|"dispatches"| node_level6
node_api -->|"compresses bytes"| node_csv
node_api -->|"returns archive"| node_archive
node_level2 -->|"falls back"| node_level1
node_level2 -->|"encodes with"| node_huffman
node_level3 -->|"falls back"| node_level2
node_level3 -->|"encodes blocks"| node_fixed
node_level4 -->|"uses fallback"| node_level3
node_level4 -->|"selects boundaries"| node_adaptive
node_level5 -->|"uses fallback"| node_level3
node_level5 -->|"optimizes boundaries"| node_adaptive
node_level6 -->|"uses fallback"| node_level5
node_level6 -->|"encodes dictionary"| node_level2
node_level6 -->|"uses header"| node_level1
node_adaptive -->|"measures blocks"| node_fixed
node_fixed -->|"encodes with"| node_rle
node_fixed -->|"encodes with"| node_huffman
node_level1 -->|"encodes with"| node_rle

click node_cli "https://github.com/ahmetcolak16/izkod/blob/main/algorithms/compare_codecs.py"
click node_api "https://github.com/ahmetcolak16/izkod/blob/main/algorithms/izkod/api.py"
click node_level1 "https://github.com/ahmetcolak16/izkod/blob/main/algorithms/compression_levels/level_1.py"
click node_level2 "https://github.com/ahmetcolak16/izkod/blob/main/algorithms/compression_levels/level_2.py"
click node_level3 "https://github.com/ahmetcolak16/izkod/blob/main/algorithms/compression_levels/level_3.py"
click node_level4 "https://github.com/ahmetcolak16/izkod/blob/main/algorithms/compression_levels/level_4.py"
click node_level5 "https://github.com/ahmetcolak16/izkod/blob/main/algorithms/compression_levels/level_5.py"
click node_level6 "https://github.com/ahmetcolak16/izkod/blob/main/algorithms/compression_levels/level_6.py"
click node_adaptive "https://github.com/ahmetcolak16/izkod/blob/main/algorithms/izkod/adaptive_blocks.py"
click node_fixed "https://github.com/ahmetcolak16/izkod/blob/main/algorithms/izkod/fixed_blocks.py"
click node_rle "https://github.com/ahmetcolak16/izkod/blob/main/algorithms/codecs/rle/rle.py"
click node_huffman "https://github.com/ahmetcolak16/izkod/blob/main/algorithms/codecs/huffman/huffman.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_cli,node_api,node_user,node_client toneBlue
class node_level1,node_level2,node_level3,node_level4,node_level5,node_level6 toneAmber
class node_adaptive,node_fixed toneMint
class node_rle,node_huffman toneRose
class node_csv,node_archive toneIndigo
```

## Components

### Entry points

- [Comparison CLI](https://github.com/ahmetcolak16/izkod/blob/main/algorithms/compare_codecs.py): `algorithms/compare_codecs.py`
- [Compression API](https://github.com/ahmetcolak16/izkod/blob/main/algorithms/izkod/api.py): `algorithms/izkod/api.py`

### Archive levels

- [Level 1](https://github.com/ahmetcolak16/izkod/blob/main/algorithms/compression_levels/level_1.py): `algorithms/compression_levels/level_1.py`
- [Level 2](https://github.com/ahmetcolak16/izkod/blob/main/algorithms/compression_levels/level_2.py): `algorithms/compression_levels/level_2.py`
- [Level 3](https://github.com/ahmetcolak16/izkod/blob/main/algorithms/compression_levels/level_3.py): `algorithms/compression_levels/level_3.py`
- [Level 4 Greedy](https://github.com/ahmetcolak16/izkod/blob/main/algorithms/compression_levels/level_4.py): `algorithms/compression_levels/level_4.py`
- [Level 5 DP](https://github.com/ahmetcolak16/izkod/blob/main/algorithms/compression_levels/level_5.py): `algorithms/compression_levels/level_5.py`
- [Level 6 Dictionary](https://github.com/ahmetcolak16/izkod/blob/main/algorithms/compression_levels/level_6.py): `algorithms/compression_levels/level_6.py`

### Block strategies

- [Adaptive Boundaries](https://github.com/ahmetcolak16/izkod/blob/main/algorithms/izkod/adaptive_blocks.py): `algorithms/izkod/adaptive_blocks.py`
- [Fixed Blocks](https://github.com/ahmetcolak16/izkod/blob/main/algorithms/izkod/fixed_blocks.py): `algorithms/izkod/fixed_blocks.py`

### Codecs

- [RLE Codec](https://github.com/ahmetcolak16/izkod/blob/main/algorithms/codecs/rle/rle.py): `algorithms/codecs/rle/rle.py`
- [Huffman Codec](https://github.com/ahmetcolak16/izkod/blob/main/algorithms/codecs/huffman/huffman.py): `algorithms/codecs/huffman/huffman.py`

### Other components

- **CLI User**
- **Library Client**
- **CSV Bytes**
- **IZK Archive**

## Connections

- CLI User → Comparison CLI: runs comparison (evidence: `algorithms/compare_codecs.py`)
- CSV Bytes → Comparison CLI: provides file (evidence: `algorithms/compare_codecs.py`)
- Comparison CLI → Level 1: measures (evidence: `algorithms/compare_codecs.py`)
- Comparison CLI → Level 2: measures (evidence: `algorithms/compare_codecs.py`)
- Comparison CLI → Level 3: measures (evidence: `algorithms/compare_codecs.py`)
- Comparison CLI → Level 4 Greedy: measures (evidence: `algorithms/compare_codecs.py`)
- Comparison CLI → Level 5 DP: measures (evidence: `algorithms/compare_codecs.py`)
- Comparison CLI → Level 6 Dictionary: measures (evidence: `algorithms/compare_codecs.py`)
- Comparison CLI → RLE Codec: measures reference (evidence: `algorithms/compare_codecs.py`)
- Comparison CLI → Huffman Codec: measures reference (evidence: `algorithms/compare_codecs.py`)
- Comparison CLI → Fixed Blocks: measures reference (evidence: `algorithms/compare_codecs.py`)
- Comparison CLI → Adaptive Boundaries: prepares candidates (evidence: `algorithms/compare_codecs.py`)
- Library Client → Compression API: calls (evidence: `algorithms/izkod/api.py`)
- Compression API → Level 1: dispatches (evidence: `algorithms/izkod/api.py`)
- Compression API → Level 2: dispatches (evidence: `algorithms/izkod/api.py`)
- Compression API → Level 3: dispatches (evidence: `algorithms/izkod/api.py`)
- Compression API → Level 4 Greedy: dispatches (evidence: `algorithms/izkod/api.py`)
- Compression API → Level 5 DP: dispatches (evidence: `algorithms/izkod/api.py`)
- Compression API → Level 6 Dictionary: dispatches (evidence: `algorithms/izkod/api.py`)
- Compression API → CSV Bytes: compresses bytes (evidence: `algorithms/izkod/api.py`)
- Compression API → IZK Archive: returns archive (evidence: `algorithms/izkod/api.py`)
- Level 2 → Level 1: falls back (evidence: `algorithms/compression_levels/level_2.py`)
- Level 2 → Huffman Codec: encodes with (evidence: `algorithms/compression_levels/level_2.py`)
- Level 3 → Level 2: falls back (evidence: `algorithms/compression_levels/level_3.py`)
- Level 3 → Fixed Blocks: encodes blocks (evidence: `algorithms/compression_levels/level_3.py`)
- Level 4 Greedy → Level 3: uses fallback (evidence: `algorithms/compression_levels/level_4.py`)
- Level 4 Greedy → Adaptive Boundaries: selects boundaries (evidence: `algorithms/compression_levels/level_4.py`)
- Level 5 DP → Level 3: uses fallback (evidence: `algorithms/compression_levels/level_5.py`)
- Level 5 DP → Adaptive Boundaries: optimizes boundaries (evidence: `algorithms/compression_levels/level_5.py`)
- Level 6 Dictionary → Level 5 DP: uses fallback (evidence: `algorithms/compression_levels/level_6.py`)
- Level 6 Dictionary → Level 2: encodes dictionary (evidence: `algorithms/compression_levels/level_6.py`)
- Level 6 Dictionary → Level 1: uses header (evidence: `algorithms/compression_levels/level_6.py`)
- Adaptive Boundaries → Fixed Blocks: measures blocks (evidence: `algorithms/izkod/adaptive_blocks.py`)
- Fixed Blocks → RLE Codec: encodes with (evidence: `algorithms/izkod/fixed_blocks.py`)
- Fixed Blocks → Huffman Codec: encodes with (evidence: `algorithms/izkod/fixed_blocks.py`)
- Level 1 → RLE Codec: encodes with (evidence: `algorithms/compression_levels/level_1.py`)
