# itsmeshruti1/stegnoz architecture

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

- Interactive diagram: https://gitdiagram.com/itsmeshruti1/stegnoz
- Repository: https://github.com/itsmeshruti1/stegnoz

## Overview

StegnoZ is an offline multilingual healthcare privacy firewall. Its main workflow accepts a directory of records, parses supported formats, extracts identity and clinical attributes, resolves patients across files, applies privacy transformations, rewrites records, and verifies outputs before producing sanitized data and reports. The graph also preserves the lexicon, detection patterns, transliteration, key management, and policy configuration that support those stages. Relationships follow the README and shown pipeline/import references; unsampled implementation details are not assumed.

Main entry points: [`stegnoz/pipeline.py`](https://github.com/itsmeshruti1/stegnoz/blob/main/stegnoz/pipeline.py) (Pipeline), [`stegnoz/sanitize.py`](https://github.com/itsmeshruti1/stegnoz/blob/main/stegnoz/sanitize.py) (Record rewriting), [`stegnoz/extract.py`](https://github.com/itsmeshruti1/stegnoz/blob/main/stegnoz/extract.py) (Schema extraction), [`main.py`](https://github.com/itsmeshruti1/stegnoz/blob/main/main.py) (Command line)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_run["Run orchestration"]
  node_cli["Command line<br/>[main.py]"]
  node_pipeline["Pipeline<br/>[pipeline.py]"]
  node_ingest["Ingestion<br/>[ingest.py]"]
  node_outputs["Sanitized release"]
end

subgraph group_identity["Detection and identity"]
  node_extract["Schema extraction<br/>[extract.py]"]
  node_lexicon["Multilingual lexicon<br/>[lexicon.py]"]
  node_patterns["Detection patterns<br/>[patterns.py]"]
  node_translit["Name transliteration<br/>[translit.py]"]
  node_link["Patient linkage<br/>[link.py]"]
end

subgraph group_privacy["Privacy and rewriting"]
  node_privacy["Privacy engine<br/>[privacy.py]"]
  node_sanitize["Record rewriting<br/>[sanitize.py]"]
  node_verify["Residual verification<br/>[pipeline.py]"]
end

subgraph group_support["Configuration and security"]
  node_policy["Privacy policy<br/>[policy.yaml]"]
  node_keys["Keys and logging<br/>[util.py]"]
end

node_user(("Operator"))

node_user -->|"runs"| node_cli
node_cli -->|"starts"| node_pipeline
node_cli -->|"reads secret"| node_keys
node_cli -->|"loads policy"| node_policy
node_pipeline -->|"parses inputs"| node_ingest
node_pipeline -->|"extracts fields"| node_extract
node_pipeline -->|"resolves patients"| node_link
node_pipeline -->|"applies policy"| node_privacy
node_pipeline -->|"rewrites records"| node_sanitize
node_pipeline -->|"rescans outputs"| node_verify
node_pipeline -->|"creates pseudonyms"| node_keys
node_extract -->|"classifies fields"| node_lexicon
node_extract -->|"detects identifiers"| node_patterns
node_extract -->|"normalizes names"| node_translit
node_link -->|"compares names"| node_translit
node_sanitize -->|"uses vocabularies"| node_lexicon
node_sanitize -->|"matches sensitive data"| node_patterns
node_sanitize -->|"applies generalization"| node_privacy
node_sanitize -->|"uses identifier rules"| node_extract
node_sanitize -->|"normalizes names"| node_translit
node_privacy -->|"uses risk targets"| node_policy
node_pipeline -->|"writes release and reports"| node_outputs

click node_cli "https://github.com/itsmeshruti1/stegnoz/blob/main/main.py"
click node_pipeline "https://github.com/itsmeshruti1/stegnoz/blob/main/stegnoz/pipeline.py"
click node_ingest "https://github.com/itsmeshruti1/stegnoz/blob/main/stegnoz/ingest.py"
click node_extract "https://github.com/itsmeshruti1/stegnoz/blob/main/stegnoz/extract.py"
click node_lexicon "https://github.com/itsmeshruti1/stegnoz/blob/main/stegnoz/lexicon.py"
click node_patterns "https://github.com/itsmeshruti1/stegnoz/blob/main/stegnoz/patterns.py"
click node_translit "https://github.com/itsmeshruti1/stegnoz/blob/main/stegnoz/translit.py"
click node_link "https://github.com/itsmeshruti1/stegnoz/blob/main/stegnoz/link.py"
click node_privacy "https://github.com/itsmeshruti1/stegnoz/blob/main/stegnoz/privacy.py"
click node_sanitize "https://github.com/itsmeshruti1/stegnoz/blob/main/stegnoz/sanitize.py"
click node_verify "https://github.com/itsmeshruti1/stegnoz/blob/main/stegnoz/pipeline.py"
click node_policy "https://github.com/itsmeshruti1/stegnoz/blob/main/config/policy.yaml"
click node_keys "https://github.com/itsmeshruti1/stegnoz/blob/main/stegnoz/util.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_pipeline,node_ingest,node_outputs toneBlue
class node_extract,node_lexicon,node_patterns,node_translit,node_link toneAmber
class node_privacy,node_sanitize,node_verify toneMint
class node_policy,node_keys toneRose
class node_user toneIndigo
```

## Components

### Run orchestration

- [Command line](https://github.com/itsmeshruti1/stegnoz/blob/main/main.py): `main.py`
- [Pipeline](https://github.com/itsmeshruti1/stegnoz/blob/main/stegnoz/pipeline.py): `stegnoz/pipeline.py`
- [Ingestion](https://github.com/itsmeshruti1/stegnoz/blob/main/stegnoz/ingest.py): `stegnoz/ingest.py`
- **Sanitized release**

### Detection and identity

- [Schema extraction](https://github.com/itsmeshruti1/stegnoz/blob/main/stegnoz/extract.py): `stegnoz/extract.py`
- [Multilingual lexicon](https://github.com/itsmeshruti1/stegnoz/blob/main/stegnoz/lexicon.py): `stegnoz/lexicon.py`
- [Detection patterns](https://github.com/itsmeshruti1/stegnoz/blob/main/stegnoz/patterns.py): `stegnoz/patterns.py`
- [Name transliteration](https://github.com/itsmeshruti1/stegnoz/blob/main/stegnoz/translit.py): `stegnoz/translit.py`
- [Patient linkage](https://github.com/itsmeshruti1/stegnoz/blob/main/stegnoz/link.py): `stegnoz/link.py`

### Privacy and rewriting

- [Privacy engine](https://github.com/itsmeshruti1/stegnoz/blob/main/stegnoz/privacy.py): `stegnoz/privacy.py`
- [Record rewriting](https://github.com/itsmeshruti1/stegnoz/blob/main/stegnoz/sanitize.py): `stegnoz/sanitize.py`
- [Residual verification](https://github.com/itsmeshruti1/stegnoz/blob/main/stegnoz/pipeline.py): `stegnoz/pipeline.py`

### Configuration and security

- [Privacy policy](https://github.com/itsmeshruti1/stegnoz/blob/main/config/policy.yaml): `config/policy.yaml`
- [Keys and logging](https://github.com/itsmeshruti1/stegnoz/blob/main/stegnoz/util.py): `stegnoz/util.py`

### Other components

- **Operator**

## Connections

- Operator → Command line: runs (evidence: `README.md`)
- Command line → Pipeline: starts (evidence: `main.py`)
- Command line → Keys and logging: reads secret (evidence: `main.py`)
- Command line → Privacy policy: loads policy (evidence: `main.py`)
- Pipeline → Ingestion: parses inputs (evidence: `README.md`)
- Pipeline → Schema extraction: extracts fields (evidence: `README.md`)
- Pipeline → Patient linkage: resolves patients (evidence: `stegnoz/pipeline.py`)
- Pipeline → Privacy engine: applies policy (evidence: `README.md`)
- Pipeline → Record rewriting: rewrites records (evidence: `README.md`)
- Pipeline → Residual verification: rescans outputs (evidence: `README.md`)
- Pipeline → Keys and logging: creates pseudonyms (evidence: `stegnoz/pipeline.py`)
- Schema extraction → Multilingual lexicon: classifies fields (evidence: `stegnoz/extract.py`)
- Schema extraction → Detection patterns: detects identifiers (evidence: `stegnoz/extract.py`)
- Schema extraction → Name transliteration: normalizes names (evidence: `stegnoz/extract.py`)
- Patient linkage → Name transliteration: compares names (evidence: `stegnoz/link.py`)
- Record rewriting → Multilingual lexicon: uses vocabularies (evidence: `stegnoz/sanitize.py`)
- Record rewriting → Detection patterns: matches sensitive data (evidence: `stegnoz/sanitize.py`)
- Record rewriting → Privacy engine: applies generalization (evidence: `stegnoz/sanitize.py`)
- Record rewriting → Schema extraction: uses identifier rules (evidence: `stegnoz/sanitize.py`)
- Record rewriting → Name transliteration: normalizes names (evidence: `stegnoz/sanitize.py`)
- Privacy engine → Privacy policy: uses risk targets (evidence: `README.md`)
- Pipeline → Sanitized release: writes release and reports (evidence: `README.md`)
