fastdtw
Dynamic Time Warping (DTW) algorithm with an O(N) time and memory complexity.
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 fastdtwuv
uv add fastdtwpoetry
poetry add fastdtwInstalling 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
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
dtaidistanceComputes distance measures between time series…
permissive · top 15,000 on PyPI
dtw-pythonComputes Dynamic Time Warping alignments…
copyleft · top 15,000 on PyPI
tmtoolsProvides Python bindings to the TM-align…
copyleft · top 15,000 on PyPI
textdistanceComputes distance and similarity between text…
permissive · top 5,000 on PyPI
kaldialignComputes edit distance, alignment, and word…
permissive · top 15,000 on PyPI
monotonic-alignment-searchFinds the most probable alignment between a…
permissive · top 15,000 on PyPI
edlibEdlib calculates edit distance (Levenshtein…
permissive · top 15,000 on PyPI
pyspark-hnswProvides a PySpark-compatible implementation of…
unclear · top 15,000 on PyPI
editdistanceComputes the edit distance (Levenshtein…
permissive · top 5,000 on PyPI
tslearntslearn provides machine learning algorithms…
permissive · top 15,000 on PyPI