Registry / analytics / pyextremes

pyextremes

JSON →
library2.5.0pypypi✓ verified 86d ago

A Python library for Extreme Value Analysis (EVA) of time series data. It implements methods for block maxima (BM) and peak-over-threshold (POT) approaches, including fitting, diagnostic plots, and return value estimation. Current stable version is 2.5.0; release cadence is irregular with occasional major/minor updates.

pip install pyextremes
INSTALL
IMPORT
SIG · PYEXTREMES
P
pyextremes
analyticspythonv2.5.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

get_extremes
from pyextremes import get_extremes
from pyextremes.extremes import get_extremes
get_extremes is a top-level function in v2.x; was previously in a submodule.
fit_extreme
from pyextremes import fit_extreme
from pyextremes.models import fit_extreme
fit_extreme is now top-level; submodule path removed in v2.1.0.
plot
from pyextremes import plot

Basic extreme value analysis using block maxima on random Gumbel data.

import numpy as np from pyextremes import get_extremes, fit_extreme, plot # Generate sample data np.random.seed(42) data = np.random.gumbel(loc=10, scale=2, size=1000) # Extract extremes using block maxima data_block_maxima = get_extremes(data, method='BM', block_size=100) # Fit model results = fit_extreme(data_block_maxima, method='BM', distribution='gumbel') # Diagnostic plot plot(results, plot_type='return_value', return_period=[10, 50, 100])
Debug
Known issues
breakingIn v2.0.0, the API was redesigned: get_extremes and fit_extreme moved to top-level. Old imports from submodules will break.
fix
Update imports to top-level: from pyextremes import get_extremes, fit_extreme.
affects: <2.0.0
breakingIn v2.4.0, the 'pot' method argument in get_extremes changed name from 'threshold' to 'r' for return values. This may cause silent failure if using keyword arguments.
fix
Use named parameter 'r' instead of 'threshold' when calling get_extremes with method='POT'.
affects: >=2.4.0
gotchaThe default method for get_extremes is 'BM' (block maxima) with block_size=365. Users expecting 'POT' (peak-over-threshold) must specify method='POT' and provide a threshold/r value, otherwise results may be misleading.
fix
Explicitly set method and required parameters: get_extremes(data, method='POT', r=threshold_value).
affects: all
Errors
Common errors & fixes
ImportError: cannot import name 'get_extremes' from 'pyextremes'
Older installed version of pyextremes (<2.0.0) does not have get_extremes as top-level function.
fix
Upgrade pyextremes to latest version: pip install --upgrade pyextremes.
TypeError: get_extremes() got an unexpected keyword argument 'threshold'
In pyextremes >=2.4.0, the parameter for POT method is 'r', not 'threshold'.
fix
Replace keyword 'threshold' with 'r' in get_extremes call.
Upgrade
Version history
2.5.0latest on PyPI · released Feb 19, 2026
Audit
Dependencies
numpyrequiredCore dependency for numerical operations
scipyrequiredUsed for optimization and statistical distributions
matplotlibrequiredFor plotting diagnostic plots
Agent activity
25 hits · last 30 days
node
22
OpenAI (training)
1
Resources

No resource links recorded.

pyextremes — pip install pyextremes · libregistry