dtw-python
A comprehensive implementation of dynamic time warping (DTW) algorithms.
Decision gist · record as of 2026-08-14
Yes, if you need time series alignment or distance computation. Active maintenance, no known vulnerabilities, broad Python version support (3.9–3.13), and prebuilt wheels minimize friction. GPL-3.0-or-later copyleft is a blocker only if you cannot open-source your code. The package is production-stable and widely cited in academic literature.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires numpy and scipy; Python >= 3.9.
- Medium install friction due to compiled wheels; prebuilt binaries available for Python 3.9–3.13 on macOS (x86_64, arm64), Linux (x86_64, aarch64), and Windows.
- Actively maintained with recent releases.
License · maintenance · safety
GPL-3.0-or-later (copyleft) — GPL-3.0-or-later copyleft license; use in proprietary software requires either licensing negotiation or release of your own code under GPL-3.0 or later.
last release 2026-06-12 (63 days) · last repo commit 2026-08-07 · 343 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 250,950 downloads/mo, #8,609 on PyPI
Alternatives
Verify before relying
import numpy as np
from dtw import dtw
query = np.array([1, 2, 3, 4, 5])
reference = np.array([1, 2, 2, 3, 4, 5])
dist, cost_matrix, acc_cost_matrix, path = dtw(query, reference)- Performance characteristics (speed, memory usage) for typical time series lengths and multivariate data.
- Availability and quality of visualization/plotting functions mentioned in description.
- Whether all Rabiner-Juang, Sakoe-Chiba, and Rabiner-Myers step patterns are fully implemented.
What it is and what it does
dtw-python is a comprehensive implementation of Dynamic Time Warping algorithms for computing optimal alignments between time series. It measures how much temporal stretching or compression is needed to map one sequence onto another, outputting both the cumulative distance and the warping function (alignment path) itself. The package is widely used for time series classification, clustering, and pattern matching in domains like econometrics, chemistry, and bioinformatics.
The implementation supports arbitrary local constraints (symmetric, asymmetric, slope-limited step patterns) and global windowing constraints (Sakoe-Chiba band, Itakura parallelogram), partial matches (open-begin, open-end, substring), and proper normalization. It wraps fast native C code and depends on numpy and scipy for numerical operations. The package is a faithful Python port of R's established DTW package.
Use it for
- Classify or cluster financial time series (stock prices, economic indicators) by measuring temporal similarity.
- Match speech or audio signals with different playback speeds or durations for speaker recognition or phoneme alignment.
- Align medical time series (ECG, EEG, rehabilitation motion data) to detect patterns despite temporal variations.
- Compare DNA or protein sequences with variable-length insertions/deletions in bioinformatics workflows.
- Detect anomalies in sensor data by computing DTW distance to a reference normal pattern.
- Perform real-time sequence matching with open-end constraints for streaming or incomplete time series.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need time series alignment or distance computation.
Active maintenance, no known vulnerabilities, broad Python version support (3.9–3.13), and prebuilt wheels minimize friction. GPL-3.0-or-later copyleft is a blocker only if you cannot open-source your code. The package is production-stable and widely cited in academic literature.
Install
dtw-python on PyPI
Before you install
Medium install friction due to compiled wheels; prebuilt binaries available for Python 3.9–3.13 on macOS (x86_64, arm64), Linux (x86_64, aarch64), and Windows. Actively maintained with recent releases.
Requires numpy and scipy; Python >= 3.9.
License in practice
GPL-3.0-or-later copyleft license; use in proprietary software requires either licensing negotiation or release of your own code under GPL-3.0 or later.
Quickstart
import numpy as np
from dtw import dtw
query = np.array([1, 2, 3, 4, 5])
reference = np.array([1, 2, 2, 3, 4, 5])
dist, cost_matrix, acc_cost_matrix, path = dtw(query, reference)
Verify before relying
- Performance characteristics (speed, memory usage) for typical time series lengths and multivariate data.
- Availability and quality of visualization/plotting functions mentioned in description.
- Whether all Rabiner-Juang, Sakoe-Chiba, and Rabiner-Myers step patterns are fully implemented.
Package facts
| License | GPL-3.0-or-later copyleft |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 2 packagesnumpyscipy |
| Maintenance | Actively maintained 63 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 250,950 / month, #8,609 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: Science/ResearchNatural Language :: EnglishProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Scientific/Engineering |
Evidence: dtw_python-1.7.5-cp310-cp310-macosx_10_9_x86_64.whl; dtw_python-1.7.5-cp310-cp310-macosx_11_0_arm64.whl; dtw_python-1.7.5-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; dtw_python-1.7.5-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; dtw_python-1.7.5-cp310-cp310-win_amd64.whl; dtw_python-1.7.5-cp311-cp311-macosx_10_9_x86_64.whl; dtw_python-1.7.5-cp311-cp311-macosx_11_0_arm64.whl; dtw_python-1.7.5-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; dtw_python-1.7.5-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; dtw_python-1.7.5-cp311-cp311-win_amd64.whl; dtw_python-1.7.5-cp312-cp312-macosx_10_13_x86_64.whl; dtw_python-1.7.5-cp312-cp312-macosx_11_0_arm64.whl; dtw_python-1.7.5-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; dtw_python-1.7.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; dtw_python-1.7.5-cp312-cp312-win_amd64.whl; dtw_python-1.7.5-cp313-cp313-macosx_10_13_x86_64.whl; dtw_python-1.7.5-cp313-cp313-macosx_11_0_arm64.whl; dtw_python-1.7.5-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; dtw_python-1.7.5-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; dtw_python-1.7.5-cp313-cp313-win_amd64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “dynamic time warping alignment”
- dtw-pythonComputes Dynamic Time Warping alignments between time series,…
- dtaidistanceComputes distance measures between time series using Dynamic Time…
- fastdtwfastdtw computes approximate Dynamic Time Warping (DTW) alignments…
Give your agent the search over MCP, or paste the wish link into any chat.
More Scientific/Engineering packages
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.
scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.
scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.
Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.
dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.
Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.
Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.
See also dtaidistance · fastdtw · tslearn · pyts · tsfresh · darts · pypots · lttb · textdistance · kaldialign