skillfed

pymannkendall

A python package for non-parametric Mann-Kendall family of trend tests.

pymannkendall v1.4.3 633.1K downloads/30d#5,648 on PyPI289
Permissive license MIT AGING released

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 pymannkendall

uv

uv add pymannkendall

poetry

poetry add pymannkendall

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Scientific/Engineering

Tags

mann-kendall trend testtime series trend analysismonotonic trend detectionseasonal trend testsen's slope estimatornon-parametric trend analysisautocorrelated time series
time-series-analysisstatistical-testingenvironmental-data

More Scientific/Engineering packages