datarust-profile
One-call data profiling and data-quality reports for the datarust ecosystem.
datarust-profile takes a numeric [Matrix], a categorical [StrMatrix], or a
mixed table of both, and produces a [DatasetProfile] describing shape, memory
footprint, duplicate rows, per-column descriptive statistics (mean, std,
five-number summary, cardinality, top value) and a list of data-quality
findings. Profiles can be rendered to JSON (via the serde feature) or to a
self-contained HTML report with no extra dependencies.
It is the Rust-native, dependency-free counterpart of tools like ydata-profiling / fg-data-profiling: instead of a Python package wrapping pandas, it is a small crate built on datarust's statistics primitives and designed to be embedded in CLIs, services, notebooks, and CI pipelines.
Install
[]
= "0.1"
For JSON output, enable the serde feature (this also pulls in
datarust/serde):
[]
= { = "0.1", = ["serde"] }
The default build has zero external dependencies beyond datarust itself.
Quick start
use Matrix;
use ;
let m = from_rows.unwrap;
let profile = profile_matrix.unwrap;
println!;
for col in &profile.columns
// Self-contained HTML report (no extra deps):
write.unwrap;
What it computes
For each column, depending on its inferred type:
| Numeric | Categorical |
|---|---|
count, missing_count, missing_fraction |
count, missing_count, missing_fraction |
mean, std (sample, ddof = 1) |
unique (cardinality) |
| five-number summary: min/Q1/median/Q3/max | top (most frequent value) |
freq (count of top) |
Dataset-wide: n_rows, n_columns, estimated memory_bytes, exact
duplicate_rows and duplicate_fraction.
Data-quality findings
quality::run_checks scans the profile against configurable
[Thresholds] and emits [QualityIssue]s:
- HighMissing — missing fraction at/above threshold.
- ConstantColumn — numeric column with near-zero variance.
- NearUnique — categorical column whose cardinality ≈ row count (likely an identifier, not a feature).
- DuplicateRows — exact-duplicate rows present.
Each finding carries a [Severity] (Info / Warning / Critical) and an
optional column name. The HTML and JSON renderers include findings by default.
Output formats
| Format | Feature | Notes |
|---|---|---|
| HTML | — | Single self-contained .html, inline CSS, no JS. |
| JSON | serde |
Pretty-printed; schema mirrors the in-memory types. |
Relationship to datarust
datarust-profile is a sibling crate in the datarust workspace. It
reuses datarust's Matrix / StrMatrix containers and its stats module
(mean, std, quantile, median_sorted) rather than reimplementing them, so
profiling stays consistent with the rest of the ecosystem. Column-type
inference, missing-value handling, cardinality counting, and the report
renderers live in this crate.
License
MIT.