Skip to content

API Reference

Everything listed in mypackage.__all__ is importable from the top level:

import mypackage as mp

mp.summarize(...)  # same object as mypackage.stats.summarize

The submodules below are an implementation detail you are welcome to reach into, but never have to. The capability index lists every public name on one page, with a one-line summary each.

Modules

Module Contents
Statistics summarize, Summary, quantile, zscores, RunningStats
Smoothing moving_average, exponential_moving_average, median_filter, Padding
Transforms Standardize, MinMaxScale, Clip, MovingAverage, Pipeline, chain
Utilities as_floats, require_non_empty, require_positive, Window, timer
Protocols Series, Transform, Fittable
Exceptions MypackageError, ValidationError, EmptySeriesError, NotFittedError
CLI main, build_parser

Package overview

Descriptive statistics, smoothing filters, and composable transforms.

mypackage is the worked example that ships with this project template. It is deliberately dependency-free — everything here is built on the standard library — so the template stays domain-neutral while still giving every piece of tooling something real to work on: mkdocstrings renders these docstrings, ty checks these annotations, pytest exercises these code paths, and the doctests below are verified on every test run.

The three layers

Layer Module What it gives you
Statistics mypackage.stats summarize, quantile, RunningStats
Smoothing mypackage.smoothing moving_average, median_filter
Transforms mypackage.transforms Standardize, Clip, Pipeline

Quickstart

import mypackage as mp

series = [2.0, 4.0, 4.0, 4.0, 5.0, 5.0, 7.0, 9.0]

summary = mp.summarize(series)
smoothed = mp.moving_average(series, window=3)
scaled = mp.chain(mp.Standardize(), mp.Clip(-2.0, 2.0)).fit_apply(
    series
)

Everything listed in __all__ is importable straight from the top-level package; the submodules are an implementation detail you are free to reach into, but never have to.