Ferrum is a statistical visualization library for Python: a grammar-first charting system that unifies exploratory plots, statistical graphics, interactive views, and model diagnostics, backed by a Rust engine.
Project description
Ferrum
Grammar-of-graphics statistical visualization for Python, with a Rust core.
Ferrum builds every chart — scatter plot, faceted histogram, ROC curve, SHAP beeswarm — from the same grammar of data, encodings, marks, scales, and statistical transforms. The declaration layer is Python; the computation engine is Rust compiled via PyO3.
Install
pip install ferrum-viz
Install with all optional extras (scikit-learn, SHAP, Jupyter interactive rendering):
pip install ferrum-viz[all]
Quickstart
import ferrum as fm
import polars as pl
df = pl.DataFrame({"x": [1, 2, 3, 4], "y": [2, 4, 3, 5], "group": ["a", "a", "b", "b"]})
chart = fm.Chart(df).mark_point().encode(x="x", y="y", color="group:N")
chart.save("scatter.svg")
chart.show_png() # raster output, no display server needed
Key features
- One chart model — scatter plots, statistical graphics, and ML diagnostics share the same grammar and compose with
+,|,&. - Stat transforms in the pipeline — KDE, LOESS, bootstrap CIs, binning, and aggregations are declared in the chart spec and computed in Rust.
- Model diagnostics as charts —
fm.roc_chart(model, X, y),fm.confusion_matrix_chart(...),fm.shap_chart(...)return regularChartobjects. - Zero system dependencies — no Cairo, no X11, no display server. Renders anywhere
pip installworks. - DataFrame pluralism — polars, pandas, modin, cuDF, dask, ibis, and pyarrow all work through
Chart(data). - Interactive rendering —
chart.interactive()switches to a GPU-backed WASM renderer with selections, zoom/pan, linked views, and tooltips. Backed byanywidgetfor Jupyter. - 12 built-in themes — from Paper Ink (warm cream default) to dark, publication, and editorial styles.
Examples
# Layer a LOESS trend on a scatter plot
points = fm.Chart(df).mark_point(opacity=0.6).encode(x="x", y="y", color="group:N")
trend = fm.Chart(df).mark_smooth(method="loess").encode(x="x", y="y", color="group:N")
chart = points + trend
# Compose diagnostics into a model report
source = fm.ModelSource(model, X_test, y_test)
report = (fm.roc_chart(source) | fm.confusion_matrix_chart(source)) & fm.importance_chart(source)
report.save("model_report.svg")
# Figure-level helpers
fm.displot(df, x="value", hue="group", kind="kde")
fm.catplot(df, x="species", y="measurement", kind="violin")
fm.pairplot(df, vars=["a", "b", "c"], hue="label")
Architecture
| Layer | Role |
|---|---|
src/ferrum/ |
Python declaration API — Chart, encodings, marks, themes, plots |
crates/ferrum-core/ |
Rust computation engine — transforms, scales, rendering |
| Arrow CDI | Zero-copy data transport between Python and Rust via pyo3-arrow |
Development
Requires Python 3.10+, Rust toolchain, and maturin.
uv sync
unset CONDA_PREFIX && uv run --no-sync maturin develop # build Rust extension
uv run pytest # run tests
How this was built
Ferrum was designed and implemented in 10 days by one human and an agentic Claude framework — 975 commits, ~103k lines of source, 3,829 tests. The project uses a six-layer automation architecture with 13 agents and 16 skills, including language-specific coding agents, commit-level review gates, structural audits, and repeatable quality campaigns. See design-docs/development-meta-analysis.md for the full retrospective.
Documentation
Full docs at ferrumviz.com.
License
See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ferrum_viz-0.9.1.tar.gz.
File metadata
- Download URL: ferrum_viz-0.9.1.tar.gz
- Upload date:
- Size: 4.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0237906e9b2505814774c775b894896f0513264aafaeea457ef08ef627ae889b
|
|
| MD5 |
db1ffc38361bb63134fa37f701cee576
|
|
| BLAKE2b-256 |
170921c290011a1acbab4ca7e49d5b42483078a1f4cbf7ac78a42148995eb8db
|
Provenance
The following attestation bundles were made for ferrum_viz-0.9.1.tar.gz:
Publisher:
publish.yaml on chris-santiago/ferrum
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ferrum_viz-0.9.1.tar.gz -
Subject digest:
0237906e9b2505814774c775b894896f0513264aafaeea457ef08ef627ae889b - Sigstore transparency entry: 1570374157
- Sigstore integration time:
-
Permalink:
chris-santiago/ferrum@80aa075640370cd22232be4a1daa2e24988b4e5d -
Branch / Tag:
refs/tags/v0.9.1 - Owner: https://github.com/chris-santiago
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@80aa075640370cd22232be4a1daa2e24988b4e5d -
Trigger Event:
release
-
Statement type:
File details
Details for the file ferrum_viz-0.9.1-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: ferrum_viz-0.9.1-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 8.3 MB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dad4599e4fee36140fbed1e655186d2bab1afb3608abfe9b1e9ee588d2619a9a
|
|
| MD5 |
9e63436d6fbd8cb7a4bac8480349ef40
|
|
| BLAKE2b-256 |
ff133387ff24de3eadc03bdd09fc20bda45b02abe7d02b69169ddc46eaee20e0
|
Provenance
The following attestation bundles were made for ferrum_viz-0.9.1-cp310-abi3-win_amd64.whl:
Publisher:
publish.yaml on chris-santiago/ferrum
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ferrum_viz-0.9.1-cp310-abi3-win_amd64.whl -
Subject digest:
dad4599e4fee36140fbed1e655186d2bab1afb3608abfe9b1e9ee588d2619a9a - Sigstore transparency entry: 1570374311
- Sigstore integration time:
-
Permalink:
chris-santiago/ferrum@80aa075640370cd22232be4a1daa2e24988b4e5d -
Branch / Tag:
refs/tags/v0.9.1 - Owner: https://github.com/chris-santiago
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@80aa075640370cd22232be4a1daa2e24988b4e5d -
Trigger Event:
release
-
Statement type:
File details
Details for the file ferrum_viz-0.9.1-cp310-abi3-manylinux_2_39_x86_64.whl.
File metadata
- Download URL: ferrum_viz-0.9.1-cp310-abi3-manylinux_2_39_x86_64.whl
- Upload date:
- Size: 8.1 MB
- Tags: CPython 3.10+, manylinux: glibc 2.39+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
390add2c8e60ef28db40e727837a12e9ea71ae22637e2b823c8eeabbf58a7719
|
|
| MD5 |
6a3f2acfe41769480cc4669cca7897ce
|
|
| BLAKE2b-256 |
118c54f675ae3a4f8486442354eb8962ccebb3331166e00bf3928ffc24decf8f
|
Provenance
The following attestation bundles were made for ferrum_viz-0.9.1-cp310-abi3-manylinux_2_39_x86_64.whl:
Publisher:
publish.yaml on chris-santiago/ferrum
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ferrum_viz-0.9.1-cp310-abi3-manylinux_2_39_x86_64.whl -
Subject digest:
390add2c8e60ef28db40e727837a12e9ea71ae22637e2b823c8eeabbf58a7719 - Sigstore transparency entry: 1570374832
- Sigstore integration time:
-
Permalink:
chris-santiago/ferrum@80aa075640370cd22232be4a1daa2e24988b4e5d -
Branch / Tag:
refs/tags/v0.9.1 - Owner: https://github.com/chris-santiago
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@80aa075640370cd22232be4a1daa2e24988b4e5d -
Trigger Event:
release
-
Statement type:
File details
Details for the file ferrum_viz-0.9.1-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: ferrum_viz-0.9.1-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 7.0 MB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff2b0d1a83a4c9faf5f9a388f7ebf84526d81eadc139be4e24006a4238513e9f
|
|
| MD5 |
7422d564031e48729582155f2ac6ca78
|
|
| BLAKE2b-256 |
5a1ea9f25be964bc4042846b8cd00a1c5cb59b20fb0ccaa06c94924dbcb5a9e6
|
Provenance
The following attestation bundles were made for ferrum_viz-0.9.1-cp310-abi3-macosx_11_0_arm64.whl:
Publisher:
publish.yaml on chris-santiago/ferrum
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ferrum_viz-0.9.1-cp310-abi3-macosx_11_0_arm64.whl -
Subject digest:
ff2b0d1a83a4c9faf5f9a388f7ebf84526d81eadc139be4e24006a4238513e9f - Sigstore transparency entry: 1570375654
- Sigstore integration time:
-
Permalink:
chris-santiago/ferrum@80aa075640370cd22232be4a1daa2e24988b4e5d -
Branch / Tag:
refs/tags/v0.9.1 - Owner: https://github.com/chris-santiago
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@80aa075640370cd22232be4a1daa2e24988b4e5d -
Trigger Event:
release
-
Statement type: