stats-transformer
Table of Contents
1. Features
stats-transformer is a Python library for data transformation, econometric modeling, and visualization. It automates feature engineering, model estimation, and reporting across time-series, panel, and cross-sectional datasets using a reproducible configuration workflow.
- Unified Empirical Workflow: Combines feature engineering, model estimation, diagnostic checks, and publication-ready charts in one pipeline.
- Declarative YAML Configuration: Controls data sources, frequency resampling, transformations, model specifications, and visual outputs via
params.yaml. - Broad Econometric Coverage: Provides unified APIs for cross-sectional (OLS, Robust OLS), panel (Fixed Effects), time-series (VAR, VECM, SVAR, Local Projections), instrumental-variables (2SLS, LP-IV), discrete-choice (Logit), and unsupervised methods (PCA, KMeans).
- Cross-Language Validation & Agent-Ready: Numerically verified against R (
stats,vars), Stata (regress,logit,pca), and MATLAB (mldivide), with an embedded architectural skill for AI agents. - Extensible Roadmap: Built for active expansion into high-frequency, non-linear, and structural macroeconomic extensions (see Roadmap).
2. Documentation
-
Core Guides (
docs/)- Overview: Documentation map, model domain summary, and quickstart links.
- Architecture & Design: Pipeline stages, object hierarchy, and repository file structure.
- Implemented Models: Complete catalog of all 32 implemented model classes and utilities.
- Data Guide: Data directory organization and packaged example datasets.
- Software Benchmarks: Cross-language R, Stata, and MATLAB verification matrix.
- Testing Suite: Automated unit, integration, and verification test guide.
- Academic Citations: Literature sources, paper datasets, and reference software.
- Future Roadmap: Planned model expansions and complexity triage.
-
Interactive Notebooks (
notebooks/)- Overall Pipeline: End-to-end data ingestion, transformation, and estimation.
- Regression & Panel: OLS, robust covariance, panel, and 2SLS examples.
- Time Series & Structural VAR: VAR, SVAR, local projection, and decomposition APIs.
- Modular Chart Components: Interactive visualization components and publication plotting.
3. Quickstart
3.1. Installation
To use it in your project via PyPI:
pip install stats-transformer
Or add it with uv:
uv add stats-transformer
To run the notebooks under notebooks/, install the notebooks extra:
pip install "stats-transformer[notebooks]"
For local development from this repository:
uv sync
3.2. Configuration (params.yaml)
Define your data sources, pipeline parameters, and model specifications in a params.yaml file:
data:
featurization:
entity_column: country
datasets:
- name: macro_data
path: data/raw/macro_indicators.csv
frequency: Q
model:
model_type: panel_ols
target_variable: gdp_growth
independent_variables:
- interest_rate
- inflation
reporting:
output_dir: reports/visualizations
3.3. Usage
Load a packaged example dataset:
from stats_transformer.data import list_examples, load_example
print(list_examples())
df = load_example("macrodb_gdp_inflation")
You can execute the pipeline via the command line using the Pipeline orchestrator:
# Run the full end-to-end pipeline
uv run python -m stats_transformer.pipeline --config params.yaml
Or you can interact with the API programmatically:
from stats_transformer import Pipeline
# Initialize the pipeline with your configuration
pipeline = Pipeline(params_path="params.yaml")
# Run specific stages sequentially
merged_data = pipeline.run(stage="resample")
transformed_data = pipeline.run(stage="features")
model_results = pipeline.run(stage="regression")
# Generate and save visualizations
pipeline.run(stage="reporting")
3.4. Testing
Verify the installation and library integrity by running the test suite:
uv run python -m pytest -q
For more details on test coverage, see the Testing Suite.
4. Agent Skill
Source checkouts of this repository include an optional stats-transformer-architecture agent skill for AI coding tools. It gives agents a compact map of the library architecture, pipeline stages, model contracts, and feature-engineering vocabulary.
The canonical skill source lives at .agents/skills/stats-transformer-architecture/. From the repository root, use the local terminal to run scripts/install-agent-skill.sh, which installs or refreshes tool-specific copies for Claude Code, OpenAI Codex, or Kilo Code:
./scripts/install-agent-skill.sh all
You can also target one tool at a time:
./scripts/install-agent-skill.sh claude
./scripts/install-agent-skill.sh codex
./scripts/install-agent-skill.sh kilo
Metadata
Release files for stats-transformer 1.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| stats_transformer-1.7.0.tar.gz | 6.5 MB | With provenance | Details for stats_transformer-1.7.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| stats_transformer-1.7.0-py3-none-any.whl | Python 3 | none | any | Details for stats_transformer-1.7.0-py3-none-any.whl |
Total release size: 13.1 MB
Release files / stats_transformer-1.7.0.tar.gz
| Download URL | stats_transformer-1.7.0.tar.gz |
|---|---|
| Size | 6.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
15621ecf57eca4eb4cb3252f84fb4eda3c273324d6871002f1e64ab005db9f92
|
|
BLAKE2b-256 checksum How to use checksums |
47d743d18bf6627184411f77aca004407c8bfb22ca37b1587becf1a126e1e508
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.
Transparency logRelease files / stats_transformer-1.7.0-py3-none-any.whl
| Download URL | stats_transformer-1.7.0-py3-none-any.whl |
|---|---|
| Size | 6.6 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fe134fcef81d902b7d49bf81cf5965b6b9d05b27e8ee86c3e51240c07d4c0ee1
|
|
BLAKE2b-256 checksum How to use checksums |
4dda0112891dadec56eba11b34cbe7bf52d2fbc16e8795a82ebf72ac6524a374
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.
Transparency logSecurity for stats-transformer 1.7.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for stats_transformer-1.7.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.