runstats
Compute statistics and regression in one pass
What it is and what it does
RunStats is a Python module for computing statistics and regression summaries in a single pass over data, designed for scenarios where storing all values in memory is infeasible or where data arrives as a stream (e.g., from generators). It provides three main classes: Statistics for computing mean, variance, standard deviation, skewness, kurtosis, and min/max; Regression for computing slope, intercept, and correlation; and ExponentialStatistics for weighted statistics that emphasize recent values over older ones using a configurable decay rate.
The module is pure Python with an optional Cython-optimized extension for performance. It handles sequences larger than available memory, supports combining multiple summary objects into aggregate summaries, and works with any iterable including generators. All calculations use Python's float type and are numerically stable.
Use it for:
- Monitor long-running system performance by computing latency or request-interval statistics from a continuous stream of measurements.
- Analyze data from generators or large files where loading all values into memory is impractical.
- Track exponential-weighted statistics to observe recent system behavior while gradually discounting historical data.
- Combine statistics from multiple independent data streams into a single aggregate summary.
- Compute linear regression on paired observations without storing all points, useful for trend analysis in time-series data.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Computes summary statistics (mean, variance, standard deviation, skewness, kurtosis, min, max) and linear regression (slope, intercept, correlation) in a single pass over data, without storing all values in memory.
Yes, if you need single-pass statistics on streaming or memory-constrained data and can accept an abandoned package. The code is stable (Production/Stable status, no known vulnerabilities), well-tested, and pure Python, but no maintenance since 2021 means no fixes for future Python incompatibilities. Suitable for established systems where you control the Python version; avoid if you need active support or compatibility with Python 3.10+.
Install
runstats on PyPI
pip
pip install runstatsuv
uv add runstatspoetry
poetry add runstatsInstalling runstats
Before you install
Medium install friction due to optional Cython extension wheels built for specific Python versions (3.6–3.8 on multiple platforms), though pure-Python fallback is available. Package is abandoned as of 2021 with no recent maintenance.
License in practice
Apache 2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install runstats
from runstats import Statistics, Regression
stats = Statistics()
for value in data:
stats.push(value)
print(stats.mean(), stats.variance())
regr = Regression()
for x, y in pairs:
regr.push(x, y)
print(regr.slope(), regr.correlation())
Requires Python 3.6 or later; optional Cython extension requires a C compiler but pure-Python version works without it.
Verify before relying
- Whether the optional Cython extension is automatically built and used, or requires manual compilation.
- Current compatibility with Python versions beyond 3.9 (package tested only through 3.9).
- Whether the abandoned status affects stability or introduces compatibility issues in modern environments.
Package facts
| License | Apache 2.0 (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,890 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 146,069/month — #11,109 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: runstats-2.0.0-cp36-cp36m-macosx_10_9_x86_64.whl; runstats-2.0.0-cp36-cp36m-manylinux1_i686.whl; runstats-2.0.0-cp36-cp36m-manylinux1_x86_64.whl; runstats-2.0.0-cp36-cp36m-manylinux2010_i686.whl; runstats-2.0.0-cp36-cp36m-manylinux2010_x86_64.whl; runstats-2.0.0-cp36-cp36m-win32.whl; runstats-2.0.0-cp36-cp36m-win_amd64.whl; runstats-2.0.0-cp37-cp37m-macosx_10_9_x86_64.whl; runstats-2.0.0-cp37-cp37m-manylinux1_i686.whl; runstats-2.0.0-cp37-cp37m-manylinux1_x86_64.whl; runstats-2.0.0-cp37-cp37m-manylinux2010_i686.whl; runstats-2.0.0-cp37-cp37m-manylinux2010_x86_64.whl; runstats-2.0.0-cp37-cp37m-win32.whl; runstats-2.0.0-cp37-cp37m-win_amd64.whl; runstats-2.0.0-cp38-cp38-macosx_10_9_x86_64.whl; runstats-2.0.0-cp38-cp38-manylinux1_i686.whl; runstats-2.0.0-cp38-cp38-manylinux1_x86_64.whl; runstats-2.0.0-cp38-cp38-manylinux2010_i686.whl; runstats-2.0.0-cp38-cp38-manylinux2010_x86_64.whl; runstats-2.0.0-cp38-cp38-win32.whl
Tags
More Mathematics packages
NetworkX provides data structures and…
permissive · top 1,000 on PyPI
kiwisolverkiwisolver is a Python binding to a fast C++…
permissive · top 1,000 on PyPI
sympySymPy is a Python library for symbolic…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
torchPyTorch provides GPU-accelerated tensor…
permissive · top 1,000 on PyPI
onnxruntimeonnxruntime loads and executes Open Neural…
permissive · top 1,000 on PyPI
statisticsProvides basic mathematical statistics…
permissive · top 15,000 on PyPI
rasterstatsRasterstats computes summary statistics (mean,…
permissive · top 15,000 on PyPI
statsmodelsstatsmodels provides statistical models,…
permissive · top 1,000 on PyPI
momentchi2Computes the cumulative distribution function…
permissive · top 15,000 on PyPI
stockstatsAdds technical analysis indicators and…
permissive · top 15,000 on PyPI
exactextractexactextract computes zonal statistics—fast…
permissive · top 15,000 on PyPI
percentifyPercentify provides one-call exploratory…
permissive · top 15,000 on PyPI
facets-overviewGenerates summary statistics for dataset…
permissive · top 15,000 on PyPI
polars-olsPolars OLS provides Rust-optimized linear…
unclear · top 15,000 on PyPI
xarray-einstatsProvides xarray-friendly wrappers around NumPy…
permissive · top 5,000 on PyPI