pymannkendall
A python package for non-parametric Mann-Kendall family of trend tests.
What it is and what it does
pyMannKendall is a pure Python implementation of the Mann-Kendall family of non-parametric trend tests, designed for analyzing time series data without assuming normal distribution. It provides 11 variants of the Mann-Kendall test (original, Hamed-Rao, Yue-Wang, pre-whitening, multivariate, seasonal, regional, correlated multivariate, correlated seasonal, and partial) plus two Sen's slope estimators for quantifying trend magnitude. The package depends on numpy and scipy for numerical computation.
The tests return structured results including trend direction, p-value, test statistics, Kendall's Tau, and slope estimates. It is particularly useful when time series data violates normality assumptions or contains serial correlation, seasonal patterns, or spatial structure. Each test accepts a data vector and optional parameters like significance level and seasonal period, making it flexible for different analytical scenarios.
Use it for:
- Detect long-term increasing or decreasing trends in climate or environmental monitoring data with seasonal adjustments
- Analyze regional hydrological trends across multiple monitoring stations using regional MK test
- Estimate trend magnitude and confidence intervals in water quality or air pollution time series
- Test for trends in autocorrelated economic or financial time series using variance-corrected variants
- Identify monotonic patterns in multi-parameter datasets where parameters are correlated with each other
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Implements a suite of Mann-Kendall trend tests and Sen's slope estimators for analyzing monotonic trends in time series data, including variants for seasonal, regional, and autocorrelated data.
Yes, if you need robust non-parametric trend analysis for time series data. Install friction is minimal and the package is stable and well-established. However, note that the last release was in January 2023; verify that it supports your target Python version and that no critical bugs have emerged in your use case before production deployment.
Install
pymannkendall on PyPI
pip
pip install pymannkendalluv
uv add pymannkendallpoetry
poetry add pymannkendallInstalling pymannkendall
Before you install
Low friction installation with only numpy and scipy as runtime dependencies. Package is aging (last release 2023-01-14, 1308 days prior) but remains in production-stable status with an active repository and modest community engagement (289 stars).
License in practice
MIT license permits unrestricted use, modification, and distribution in both open and proprietary projects with minimal obligations beyond attribution.
Quickstart
pip install pymannkendall
import numpy as np
import pymannkendall as mk
data = np.random.rand(360)
result = mk.original_test(data)
print(result.trend, result.p, result.slope)
Verify before relying
- Whether the package actively supports modern Python versions beyond 3.9 (classifiers list 3.9 as latest)
- Current test coverage and whether pytest suite remains comprehensive
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — numpy, scipy |
| Maintenance | aging — 1,308 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 633,123/month — #5,648 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pymannkendall-1.4.3-py3-none-any.whl
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
scikit-posthocsProvides post hoc statistical tests for…
permissive · top 15,000 on PyPI
prophetProphet forecasts time series data using an…
permissive · top 5,000 on PyPI
cornerGenerates publication-quality corner plots…
permissive · top 15,000 on PyPI
utideUTide performs tidal analysis and prediction on…
permissive · top 15,000 on PyPI
lifelineslifelines implements survival analysis…
permissive · top 5,000 on PyPI
tbatsImplements BATS and TBATS exponential smoothing…
permissive · top 15,000 on PyPI
rupturesDetects change points in time series and signal…
permissive · top 5,000 on PyPI
coreforecastProvides fast C++ implementations of…
permissive · top 5,000 on PyPI
statsmodelsstatsmodels provides statistical models,…
permissive · top 1,000 on PyPI
neuralprophetNeuralProphet is a PyTorch-based framework for…
permissive · top 15,000 on PyPI