Skip to main content

dtaianomaly

Time series anomaly detection

Unit tests Doctest docs-stable docs-latest PyPi Version Downloads PyPI license Code style: black InTimeAD UI

A simple-to-use Python package for the development and analysis of time series anomaly detection techniques. Here we describe the main usage of dtaianomaly, but be sure to check out the documentation for more information.

Installation

The preferred way to install dtaianomaly is via PyPi. See the documentation for more options.

pip install dtaianomaly

Features

The three key features of dtaianomaly are as follows:

  1. State-of-the-art time series anomaly detection via a simple API. Learn more!
  2. Develop custom models for anomaly detection. Learn more!
  3. Quantitative evaluation of time series anomaly detection. Learn more!

Example

Below code shows a simple example of dtaianomaly, in which we detect anomalies in a time series of the UCR time series anomaly archive using HydraAD. This time series is included in the data folder of this repository. The example is part of the anomaly detection notebook, which also generates the figure below. More examples are provided in the other notebooks and in the documentation.

from dtaianomaly.data import UCRLoader
from dtaianomaly.anomaly_detection import HydraAD
from dtaianomaly.visualization import plot_anomaly_scores

# Load the data
data = UCRLoader("data/UCR-time-series-anomaly-archive/002_UCR_Anomaly_DISTORTED2sddb40_35000_56600_56900.txt").load()

# Fit HydraAD on the training data, with an automatically computed window size
detector = HydraAD(window_size="fft")
detector.fit(data.X_train)

# Compute the anomaly scores of the test data
anomaly_scores = detector.predict_proba(data.X_test)

# Visualize the anomaly scores
plot_anomaly_scores(data.X_test, data.y_test, anomaly_scores, figsize=(10, 3))

example-README.svg

Acknowledgments

If you find dtaianomaly useful for your work, we would appreciate the following citation:

@article{carpentier2025dtaianomaly,
      title={{dtaianomaly: A Python library for time series anomaly detection}}, 
      author={Louis Carpentier and Nick Seeuws and Wannes Meert and Mathias Verbeke},
      year={2025},
      eprint={2502.14381},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2502.14381}, 
}

Carpentier, L., Seeuws, N., Meert, W., Verbeke, M.: dtaianomaly: A Python library for time series anomaly detection (2025), https://arxiv.org/abs/2502.14381

Contribute

The goal of dtaianomaly is to be community-driven. All types of contributions are welcome. This includes code, but also bug reports, improvements to the documentation, additional tests and more. Check out the documentation to find more information about how you can contribute!

License

Copyright (c) 2023-2025 KU Leuven, DTAI Research Group

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Metadata

Release files for dtaianomaly 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dtaianomaly 0.6.0
File Size Uploaded Provenance Actions
dtaianomaly-0.6.0.tar.gz 6.3 MB With provenance Details for dtaianomaly-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dtaianomaly 0.6.0
File Interpreter ABI Platform Actions
dtaianomaly-0.6.0-py3-none-any.whl Python 3 none any Details for dtaianomaly-0.6.0-py3-none-any.whl

Total release size: 6.5 MB

Release files / dtaianomaly-0.6.0.tar.gz

Download URL dtaianomaly-0.6.0.tar.gz
Size 6.3 MB
Tags Source
SHA-256 checksum
How to use checksums
9e1b9c95dcf4a1d2f334011246e67072a8af5dd4170acdc97daf3d0a91c53de8
BLAKE2b-256 checksum
How to use checksums
c2bd832cb4971600345b5cd1112067acb19c38a0676e28aec973bfcea3b9a0c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

Release files / dtaianomaly-0.6.0-py3-none-any.whl

Download URL dtaianomaly-0.6.0-py3-none-any.whl
Size 223.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b1f3dcca2fd2985c3a5181a5baffad864cc2776edaf14bdcf40837bf70a368a
BLAKE2b-256 checksum
How to use checksums
1498b651a0f6f4e9561ff50553096a2b5adaf5c6b83fcfd143b7b715f5e699a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

Security for dtaianomaly 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dtaianomaly-0.6.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page