rainflow
Implementation of ASTM E1049-85 rainflow cycle counting algorithm
What it is and what it does
Rainflow is a Python library that implements the ASTM E1049-85 rainflow cycle counting algorithm, a standard method in fatigue analysis for identifying and counting stress cycles in time-series data. It takes a sequence of numerical values (lists, numpy arrays, or pandas Series) and extracts cycles with their ranges, mean values, and occurrence counts—information essential for predicting material fatigue life and damage accumulation.
The library provides two main functions: `count_cycles` for a summary of cycle ranges and frequencies (with optional binning or rounding), and `extract_cycles` for detailed cycle information including start and end indices. It has no external runtime dependencies, making installation straightforward, but the project is no longer actively maintained as of April 2023, though it remains classified as Production/Stable.
Use it for:
- Analyze stress-strain time series from mechanical testing or field measurements to predict component fatigue life.
- Process vibration or load data to identify and count significant stress reversals for damage assessment.
- Bin and aggregate cycle counts by range for S-N curve (stress-life) or Goodman diagram fatigue calculations.
- Extract cycle statistics (range, mean, count, position) for custom fatigue models or post-processing workflows.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Rainflow implements the ASTM E1049-85 rainflow cycle counting algorithm for fatigue analysis, processing time-series data to extract and count stress cycles.
Yes, if you need rainflow cycle counting for fatigue analysis and can accept a stable but unmaintained library. The implementation is straightforward, has no dependencies, and the algorithm itself is a fixed standard. However, verify that the ASTM E1049-85 implementation meets your validation requirements, and be aware that no active support or updates are available for compatibility issues with newer Python or dependencies in your broader stack.
Install
rainflow on PyPI
pip
pip install rainflowuv
uv add rainflowpoetry
poetry add rainflowInstalling rainflow
Before you install
Low install friction with no runtime dependencies. Marked as abandoned (last commit 2023-04-17, 1215 days ago), though classified as Production/Stable and supporting Python 3.7–3.11.
License in practice
MIT license is permissive; you may use, modify, and distribute this package freely with minimal restrictions.
Quickstart
pip install rainflow
import rainflow
signal = [0.2, 0.5, 0.3, 0.8, 0.4, 0.1]
rainflow.count_cycles(signal)
# Returns: [(range, count), ...]
Verify before relying
- Whether the package remains compatible with Python versions released after the last commit in April 2023.
- Whether the ASTM E1049-85 algorithm implementation has been validated against the standard or peer-reviewed work.
- Active maintenance status and responsiveness to bug reports or pull requests, given the abandoned label.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,215 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 116,864/month — #12,192 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: rainflow-3.2.0-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
py-import-cyclesDetects import cycles in Python projects by…
permissive · top 15,000 on PyPI
importlabImportlab infers Python import dependencies and…
permissive · top 5,000 on PyPI
cyclicDetects and reports cyclic relationships in a…
permissive · top 15,000 on PyPI
pytsPyts provides time series classification…
permissive · top 15,000 on PyPI
rupturesDetects change points in time series and signal…
permissive · top 5,000 on PyPI
noisereduceReduces noise in audio and time-domain signals…
permissive · top 15,000 on PyPI
tsfreshAutomatically extracts hundreds of time-series…
permissive · top 15,000 on PyPI
syllapyCounts syllables in English words, returning an…
permissive · top 5,000 on PyPI
py-expression-evalParses and evaluates mathematical expressions…
permissive · top 15,000 on PyPI
uncertaintiesPerforms arithmetic and mathematical operations…
permissive · top 5,000 on PyPI