skillfed

fastdtw

Dynamic Time Warping (DTW) algorithm with an O(N) time and memory complexity.

fastdtw v0.3.4 482.7K downloads/30d#6,421 on PyPI851
Permissive license MIT Abandoned released

What it is and what it does

fastdtw is a Python implementation of the FastDTW algorithm, an approximate Dynamic Time Warping method that aligns two sequences while maintaining linear time and memory complexity. Unlike standard DTW which has quadratic complexity, fastdtw trades some accuracy for speed, producing optimal or near-optimal alignments suitable for time-series comparison tasks.

The package depends on numpy and accepts sequences as arrays, computing both the alignment distance and the path that maps one sequence to the other. You provide a distance function to measure point-to-point dissimilarity. The project has not been actively maintained since 2019, so it is stable but receives no updates.

Use it for:

  • Compare time-series data to find similarity despite temporal distortions.
  • Align sequences for preprocessing in signal or pattern recognition workflows.
  • Match gesture or motion sequences for action recognition tasks.
  • Cluster or classify sequences where timing variations exist but overall shape should match.
  • Detect anomalies by computing DTW distance between a test sequence and a reference baseline.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

fastdtw computes approximate Dynamic Time Warping (DTW) alignments between sequences with linear O(N) time and memory complexity, returning both the distance and alignment path.

Yes, if you need fast approximate DTW for time-series alignment and can accept a stable but unmaintained package. The algorithm is well-established, the code is relatively simple, and there are no known vulnerabilities. Install friction is moderate due to compiled wheels. Suitable for research, prototyping, and production use where DTW is the right tool and you do not require ongoing maintenance.

Install

fastdtw on PyPI

pip

pip install fastdtw

uv

uv add fastdtw

poetry

poetry add fastdtw

Installing fastdtw

Before you install

Medium install friction due to compiled wheels; last release was 2019-10-07 and the project is marked abandoned, so no active maintenance or security updates should be expected.

License in practice

MIT license is permissive; you may use, modify, and distribute fastdtw freely in commercial and private projects with minimal restrictions.

Quickstart

pip install fastdtw

import numpy as np
from fastdtw import fastdtw

x = np.array([[1,1], [2,2], [3,3]])
y = np.array([[2,2], [3,3]])
distance, path = fastdtw(x, y, dist=euclidean)

Requires numpy; the example in the documentation uses a distance function that may require additional imports.

Verify before relying

  • Whether scipy is an undeclared runtime dependency or only an optional import for distance functions.
  • Python version compatibility beyond the classifiers (Python 2 and 3 listed, but no requires_python specified).
  • Whether the package works reliably with modern numpy versions given the 2019 last release date.
  • Exact behavior and accuracy trade-offs of the approximate algorithm relative to standard DTW.

Package facts

License MIT (permissive)
Python support not specified
Install friction medium — platform-specific wheel
Runtime dependencies 1 — numpy
Maintenance abandoned — 2,503 days since the last release
Last repo commit
First released
Downloads 482,686/month — #6,421 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: fastdtw-0.3.4-cp37-cp37m-macosx_10_14_x86_64.whl

Keywords: dtw

Intended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 2Programming Language :: Python :: 3Topic :: Scientific/Engineering

Tags

dynamic time warpingdtw sequence alignmenttime series distanceapproximate dtwsequence matching algorithmtemporal alignmentfastdtw implementation
time-seriessequence-alignmentalgorithm

More Scientific/Engineering packages