# pytoned/polars-profiling architecture

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

- Interactive diagram: https://gitdiagram.com/pytoned/polars-profiling
- Repository: https://github.com/pytoned/polars-profiling

## Overview

Polars Profiling turns a Polars DataFrame into an interactive exploratory-analysis report, with an optional raw-statistics result or comparison of reports. The main path is input through ProfileReport and the summary engine, then report structure and presentation rendering. README capabilities include type inference, column statistics, correlations, missingness, interactions, duplicates, samples, and quality alerts. Several model and rendering internals were not excerpted; those links are shown only where the README or SOURCE INDEX supports them.

Main entry points: [`src/polars_profiling/profile_report.py`](https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/profile_report.py) (ProfileReport), [`src/polars_profiling/report/structure/report.py`](https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/report/structure/report.py) (Report structure), [`src/polars_profiling/report/structure/variables`](https://github.com/pytoned/polars-profiling/tree/main/src/polars_profiling/report/structure/variables) (Variable sections), [`src/polars_profiling/controller/polars_decorator.py`](https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/controller/polars_decorator.py) (DataFrame accessor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and configuration"]
  node_profile["ProfileReport<br/>[profile_report.py]"]
  node_config["Settings<br/>[config.py]"]
  node_accessor["DataFrame accessor"]
end

subgraph group_analysis["Profiling analysis"]
  node_summary["Summary engine<br/>[summarizer.py]"]
  node_types["Type inference<br/>[typeset.py]"]
  node_polars["Polars statistics"]
  node_description["Description model<br/>[description.py]"]
  node_correlations["Correlations<br/>[correlations.py]"]
end

subgraph group_quality["Diagnostics and comparison"]
  node_alerts["Quality alerts<br/>[alerts.py]"]
  node_missing["Missing diagnostics<br/>[missing_polars.py]"]
  node_duplicates["Duplicate detection"]
  node_samples["Data samples<br/>[sample_polars.py]"]
  node_comparison["Report comparison<br/>[compare_reports.py]"]
end

subgraph group_report["Report assembly"]
  node_structure["Report structure<br/>[report.py]"]
  node_overview["Overview section<br/>[overview.py]"]
  node_variable["Variable sections"]
  node_plot["Visualizations<br/>[plot.py]"]
end

subgraph group_presentation["Presentation and output"]
  node_renderable["Renderable interface<br/>[renderable.py]"]
  node_container["Presentation container<br/>[container.py]"]
  node_html["HTML templates<br/>[templates.py]"]
  node_formatters["Value formatters<br/>[formatters.py]"]
  node_frequency["Frequency tables"]
end

node_user(("Analyst"))
node_dataframe[("Polars DataFrame")]
node_output["HTML or notebook report"]

node_user -->|"creates report"| node_profile
node_dataframe -->|"provides data"| node_profile
node_user -->|"uses accessor"| node_accessor
node_accessor -->|"creates report"| node_profile
node_profile -->|"configures analysis"| node_config
node_profile -->|"infers types"| node_types
node_profile -->|"requests summary"| node_summary
node_summary -->|"computes statistics"| node_polars
node_polars -.->|"produces statistics"| node_description
node_profile -->|"exposes description"| node_description
node_profile -->|"includes analysis"| node_correlations
node_profile -->|"computes missingness"| node_missing
node_profile -->|"detects duplicates"| node_duplicates
node_profile -->|"collects samples"| node_samples
node_profile -->|"generates alerts"| node_alerts
node_profile -->|"assembles report"| node_structure
node_structure -->|"builds overview"| node_overview
node_structure -->|"builds variable sections"| node_variable
node_overview -->|"requests plots"| node_plot
node_variable -->|"requests plots"| node_plot
node_structure -.->|"builds presentation"| node_container
node_container -->|"uses interface"| node_renderable
node_profile -->|"renders HTML"| node_html
node_html -->|"formats values"| node_formatters
node_variable -->|"builds frequency tables"| node_frequency
node_profile -->|"compares reports"| node_comparison
node_profile -->|"exports report"| node_output
node_comparison -->|"exports comparison"| node_output

click node_profile "https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/profile_report.py"
click node_config "https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/config.py"
click node_accessor "https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/controller/polars_decorator.py"
click node_summary "https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/model/summarizer.py"
click node_types "https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/model/typeset.py"
click node_polars "https://github.com/pytoned/polars-profiling/tree/main/src/polars_profiling/model/polars"
click node_description "https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/model/description.py"
click node_correlations "https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/model/correlations.py"
click node_alerts "https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/model/alerts.py"
click node_missing "https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/model/polars/missing_polars.py"
click node_duplicates "https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/model/polars/duplicates_polars.py"
click node_samples "https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/model/polars/sample_polars.py"
click node_comparison "https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/compare_reports.py"
click node_structure "https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/report/structure/report.py"
click node_overview "https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/report/structure/overview.py"
click node_variable "https://github.com/pytoned/polars-profiling/tree/main/src/polars_profiling/report/structure/variables"
click node_plot "https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/visualisation/plot.py"
click node_renderable "https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/report/presentation/core/renderable.py"
click node_container "https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/report/presentation/core/container.py"
click node_html "https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/report/presentation/flavours/html/templates.py"
click node_formatters "https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/report/formatters.py"
click node_frequency "https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/report/presentation/frequency_table_utils.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_profile,node_config,node_accessor toneBlue
class node_summary,node_types,node_polars,node_description,node_correlations,node_dataframe toneAmber
class node_alerts,node_missing,node_duplicates,node_samples,node_comparison toneMint
class node_structure,node_overview,node_variable,node_plot toneRose
class node_renderable,node_container,node_html,node_formatters,node_frequency,node_user,node_output toneIndigo
```

## Components

### Entry and configuration

- [ProfileReport](https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/profile_report.py): `src/polars_profiling/profile_report.py`
- [Settings](https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/config.py): `src/polars_profiling/config.py`
- [DataFrame accessor](https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/controller/polars_decorator.py): `src/polars_profiling/controller/polars_decorator.py`

### Profiling analysis

- [Summary engine](https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/model/summarizer.py): `src/polars_profiling/model/summarizer.py`
- [Type inference](https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/model/typeset.py): `src/polars_profiling/model/typeset.py`
- [Polars statistics](https://github.com/pytoned/polars-profiling/tree/main/src/polars_profiling/model/polars): `src/polars_profiling/model/polars`
- [Description model](https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/model/description.py): `src/polars_profiling/model/description.py`
- [Correlations](https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/model/correlations.py): `src/polars_profiling/model/correlations.py`

### Diagnostics and comparison

- [Quality alerts](https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/model/alerts.py): `src/polars_profiling/model/alerts.py`
- [Missing diagnostics](https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/model/polars/missing_polars.py): `src/polars_profiling/model/polars/missing_polars.py`
- [Duplicate detection](https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/model/polars/duplicates_polars.py): `src/polars_profiling/model/polars/duplicates_polars.py`
- [Data samples](https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/model/polars/sample_polars.py): `src/polars_profiling/model/polars/sample_polars.py`
- [Report comparison](https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/compare_reports.py): `src/polars_profiling/compare_reports.py`

### Report assembly

- [Report structure](https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/report/structure/report.py): `src/polars_profiling/report/structure/report.py`
- [Overview section](https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/report/structure/overview.py): `src/polars_profiling/report/structure/overview.py`
- [Variable sections](https://github.com/pytoned/polars-profiling/tree/main/src/polars_profiling/report/structure/variables): `src/polars_profiling/report/structure/variables`
- [Visualizations](https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/visualisation/plot.py): `src/polars_profiling/visualisation/plot.py`

### Presentation and output

- [Renderable interface](https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/report/presentation/core/renderable.py): `src/polars_profiling/report/presentation/core/renderable.py`
- [Presentation container](https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/report/presentation/core/container.py): `src/polars_profiling/report/presentation/core/container.py`
- [HTML templates](https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/report/presentation/flavours/html/templates.py): `src/polars_profiling/report/presentation/flavours/html/templates.py`
- [Value formatters](https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/report/formatters.py): `src/polars_profiling/report/formatters.py`
- [Frequency tables](https://github.com/pytoned/polars-profiling/blob/main/src/polars_profiling/report/presentation/frequency_table_utils.py): `src/polars_profiling/report/presentation/frequency_table_utils.py`

### Other components

- **Analyst**
- **Polars DataFrame**
- **HTML or notebook report**

## Connections

- Analyst → ProfileReport: creates report
- Polars DataFrame → ProfileReport: provides data
- Analyst → DataFrame accessor: uses accessor
- DataFrame accessor → ProfileReport: creates report (evidence: `src/polars_profiling/controller/polars_decorator.py`)
- ProfileReport → Settings: configures analysis (evidence: `src/polars_profiling/profile_report.py`)
- ProfileReport → Type inference: infers types (evidence: `src/polars_profiling/profile_report.py`)
- ProfileReport → Summary engine: requests summary (evidence: `src/polars_profiling/profile_report.py`)
- Summary engine → Polars statistics: computes statistics
- Polars statistics → Description model: produces statistics
- ProfileReport → Description model: exposes description (evidence: `src/polars_profiling/profile_report.py`)
- ProfileReport → Correlations: includes analysis
- ProfileReport → Missing diagnostics: computes missingness
- ProfileReport → Duplicate detection: detects duplicates
- ProfileReport → Data samples: collects samples
- ProfileReport → Quality alerts: generates alerts (evidence: `src/polars_profiling/profile_report.py`)
- ProfileReport → Report structure: assembles report (evidence: `src/polars_profiling/profile_report.py`)
- Report structure → Overview section: builds overview (evidence: `src/polars_profiling/report/structure/report.py`)
- Report structure → Variable sections: builds variable sections (evidence: `src/polars_profiling/report/structure/report.py`)
- Overview section → Visualizations: requests plots (evidence: `src/polars_profiling/report/structure/overview.py`)
- Variable sections → Visualizations: requests plots (evidence: `src/polars_profiling/report/structure/variables/render_categorical.py`)
- Report structure → Presentation container: builds presentation
- Presentation container → Renderable interface: uses interface (evidence: `src/polars_profiling/report/presentation/core/container.py`)
- ProfileReport → HTML templates: renders HTML (evidence: `src/polars_profiling/profile_report.py`)
- HTML templates → Value formatters: formats values (evidence: `src/polars_profiling/report/presentation/flavours/html/templates.py`)
- Variable sections → Frequency tables: builds frequency tables (evidence: `src/polars_profiling/report/structure/variables/render_categorical.py`)
- ProfileReport → Report comparison: compares reports (evidence: `src/polars_profiling/profile_report.py`)
- ProfileReport → HTML or notebook report: exports report
- Report comparison → HTML or notebook report: exports comparison
