skillfed

rainflow

Implementation of ASTM E1049-85 rainflow cycle counting algorithm

rainflow v3.2.0 116.9K downloads/30d#12,192 on PyPI126
Permissive license MIT Abandoned released

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 rainflow

uv

uv add rainflow

poetry

poetry add rainflow

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Scientific/EngineeringTopic :: Software Development :: Libraries :: Python Modules

Tags

rainflow cycle countingfatigue analysis algorithmASTM E1049-85 implementationstress cycle extractiontime series fatiguecycle countingfatigue damage assessment
fatigue-analysismaterials-sciencesignal-processing

More Scientific/Engineering packages