{"id":28479779,"url":"https://github.com/dizcza/cdtw-python","last_synced_at":"2026-03-09T10:33:57.684Z","repository":{"id":57859177,"uuid":"425952187","full_name":"dizcza/cdtw-python","owner":"dizcza","description":"The simplest Dynamic Time Warping in C with Python bindings","archived":false,"fork":false,"pushed_at":"2025-05-18T20:20:51.000Z","size":158,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-04T18:53:46.089Z","etag":null,"topics":["dtw","dynamic-time-warping"],"latest_commit_sha":null,"homepage":"https://cdtw-python.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dizcza.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-11-08T18:35:08.000Z","updated_at":"2025-05-18T20:20:54.000Z","dependencies_parsed_at":"2025-05-18T21:22:50.844Z","dependency_job_id":"518127b4-b5e8-42b0-bc95-fcd671b99a32","html_url":"https://github.com/dizcza/cdtw-python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dizcza/cdtw-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dizcza%2Fcdtw-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dizcza%2Fcdtw-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dizcza%2Fcdtw-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dizcza%2Fcdtw-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dizcza","download_url":"https://codeload.github.com/dizcza/cdtw-python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dizcza%2Fcdtw-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30291807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T02:57:19.223Z","status":"ssl_error","status_checked_at":"2026-03-09T02:56:26.373Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dtw","dynamic-time-warping"],"created_at":"2025-06-07T18:10:20.786Z","updated_at":"2026-03-09T10:33:57.658Z","avatar_url":"https://github.com/dizcza.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CircleCI](https://circleci.com/gh/dizcza/cdtw-python.svg?style=svg)](https://app.circleci.com/pipelines/github/dizcza/cdtw-python)\n![](https://coveralls.io/repos/dizcza/cdtw-python/badge.png \"Unit Test Coverage\")\n[![Documentation Status](https://readthedocs.org/projects/cdtw-python/badge/?version=latest)](https://cdtw-python.readthedocs.io/en/latest/?badge=latest)\n\n\n# Dynamic Time Warping in C with Python bindings\n\nThe simplest (and perhaps the fastest) Dynamic Time Warping C implementation with Python bindings.\n\nThe behavior is equivalent to the [dtaidistance](https://github.com/wannesm/dtaidistance) package but with much simpler (basic) API and **X2 faster**.\n\n## Installation\n\n```\npip install -e git+https://github.com/dizcza/cdtw-python.git#egg=cdtw\n```\n\n## Documentation\n\nhttps://cdtw-python.readthedocs.io/en/latest/\n\n\n## Quick start\n\n```python\n\u003e\u003e\u003e from cdtw import dtw_mat, dtw_dist, dtw_path\n\u003e\u003e\u003e x = [1, 2, 3, 4, 5]\n\u003e\u003e\u003e y = [2, 3, 4]\n\n# total distance\n\u003e\u003e\u003e dtw_dist(x, y)\n1.4142135381698608\n\n# full distance (cost) matrix\n\u003e\u003e\u003e cost = dtw_mat(x, y)\n\u003e\u003e\u003e cost\narray([[1.       , 2.236068 , 3.7416575],\n       [1.       , 1.4142135, 2.4494898],\n       [1.4142135, 1.       , 1.4142135],\n       [2.4494898, 1.4142135, 1.       ],\n       [3.8729835, 2.4494898, 1.4142135]], dtype=float32)\n\n# best warp path\n\u003e\u003e\u003e dtw_path(cost).tolist()\n[[0, 0], [1, 0], [2, 1], [3, 2], [4, 2]]\n```\n\nSee [Tutorial.ipynb](./docs/Tutorial.ipynb) for further explanation.\n\n\n## Benchmarking\n\n```python\n\u003e\u003e\u003e import dtaidistance\n\u003e\u003e\u003e import numpy as np\n\u003e\u003e\u003e import cdtw\n\u003e\u003e\u003e np.random.seed(0)\n\u003e\u003e\u003e x = np.random.randn(5_000)\n\u003e\u003e\u003e y = np.random.randn(10_000)\n\n\u003e\u003e\u003e %timeit cdtw.dtw_dist(x, y)\n157 ms ± 218 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n\n\u003e\u003e\u003e %timeit dtaidistance.dtw.distance_fast(x, y)\n296 ms ± 2.2 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n\n\u003e\u003e\u003e %timeit cdtw.dtw_mat(x, y)\n404 ms ± 37 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n\n\u003e\u003e\u003e %timeit dtaidistance.dtw.warping_paths_fast(x, y)\n991 ms ± 47.8 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n```\n\nThe *cdtw* package converts everything to the `float` data type (if needed) while *dtaidistance* requires `double`. The *cdtw* compiled with the `double` precision is X1.5 faster than *dtaidistance*.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdizcza%2Fcdtw-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdizcza%2Fcdtw-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdizcza%2Fcdtw-python/lists"}