crabbymetrics is a compact Rust-backed econometrics library exposed to Python through pyo3 and packaged with maturin. The public API is intentionally small: estimator classes, transformer classes, an Optimizers helper namespace, numpy arrays as the only runtime dependency, and a scikit-adjacent fit / predict / summary pattern.
The class pages remain the canonical API reference, but this overview now does two extra jobs:
it shows the live constructor and method surface from the installed module;
it groups the growing class list into a navigable left-TOC landing page instead of relying on an oversized navbar dropdown.
Show code
import inspectfrom html import escapeimport numpy as npimport crabbymetrics as cmfrom IPython.display import HTML, displaydef html_table(headers, rows, table_attrs=""): parts = [f"<table {table_attrs}>".strip(),"<thead>","<tr>",*[f"<th>{escape(str(header))}</th>"for header in headers],"</tr>","</thead>","<tbody>", ]for row in rows: parts.append("<tr>")for cell in row: parts.append(f"<td>{cell}</td>") parts.append("</tr>") parts.extend(["</tbody>", "</table>"])return"".join(parts)def class_rows(classes): rows = []for cls in classes: methods = []for method_name insorted(name for name indir(cls) ifnot name.startswith("_")): method =getattr(cls, method_name)ifnotcallable(method):continue methods.append(f"<code>{escape(method_name)}{escape(str(inspect.signature(method)))}</code>" ) rows.append( [f"<code>{escape(cls.__name__)}{escape(str(inspect.signature(cls)))}</code>","<br>".join(methods), ] )return rows
2 Sitrep
src/lib.rs registers the Python classes, while estimator implementations are split by family under src/estimators/.
Shared linear algebra, covariance, bootstrap, and NumPy conversion helpers live in src/utils.rs.
Packaging is lean. The Python package declares only numpy at runtime, while native builds are handled by maturin.
Release automation already exists in .github/workflows/wheels.yml for Linux and macOS wheels across Python 3.10 to 3.14.
Coverage is broad for a small codebase: linear estimators, GLMs/classifiers, survival models, panel estimators, semiparametric treatment-effect estimators, callback-driven GMM / MEstimator, and matrix/design transforms.
The main maturity gaps are still documentation depth and some remaining API asymmetries across older estimators.
The recent MLE overhaul standardizes the layered prediction contract more explicitly: predict_lin(...) for the latent linear index, predict(...) for mean-scale predictions, and predict_label(...) only where labels are conceptually distinct from probabilities.
Survival models now follow the same spirit: parametric PH models expose hazard, cumulative-hazard, and survival surfaces, while Cox-style models default to relative-risk predictions because the baseline hazard is not yet estimated.
Older example and ablation pages remain in the site because they are useful worked examples. The class pages above are the canonical API docs, and the API overview page is now the intended navigation hub. If the navbar stays slim, this page is where the full surface should grow.