Metadata-Version: 2.4
Name: pyhctsa
Version: 2.0.0
Summary: Highly comparative time-series analysis in Python.
Author-email: "Joshua B. Moore" <joshua.moore@sydney.edu.au>, "Ben D. Fulcher" <ben.fulcher@sydney.edu.au>
Maintainer-email: "Joshua B. Moore" <joshua.moore@sydney.edu.au>, "Ben D. Fulcher" <ben.fulcher@sydney.edu.au>
License-Expression: GPL-3.0-or-later
Project-URL: Homepage, https://dynamicsandneuralsystems.github.io/pyhctsa/
Project-URL: Repository, https://github.com/DynamicsAndNeuralSystems/pyhctsa
Project-URL: Documentation, https://dynamicsandneuralsystems.github.io/pyhctsa/
Project-URL: Issues, https://github.com/DynamicsAndNeuralSystems/pyhctsa/issues
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: C
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: THIRD_PARTY_LICENSES.md
License-File: pyhctsa/toolboxes/RAD/LICENSE
License-File: pyhctsa/toolboxes/c22/LICENSE
License-File: pyhctsa/toolboxes/gpml/LICENSE
License-File: pyhctsa/toolboxes/pywavelets/LICENSE
License-File: pyhctsa/toolboxes/DVV/COPYING
License-File: pyhctsa/toolboxes/Max_Little/COPYING
License-File: pyhctsa/toolboxes/Tisean_3_0_1/COPYING
License-File: pyhctsa/toolboxes/physionet/COPYING
License-File: pyhctsa/toolboxes/DVV/NOTICE
License-File: pyhctsa/toolboxes/Max_Little/NOTICE
License-File: pyhctsa/toolboxes/RAD/NOTICE
License-File: pyhctsa/toolboxes/Tisean_3_0_1/NOTICE
License-File: pyhctsa/toolboxes/c22/NOTICE
License-File: pyhctsa/toolboxes/gpml/NOTICE
License-File: pyhctsa/toolboxes/physionet/NOTICE
License-File: pyhctsa/toolboxes/pywavelets/NOTICE
Requires-Dist: numpy>=2
Requires-Dist: scipy
Requires-Dist: pandas
Requires-Dist: pyyaml
Requires-Dist: statsmodels
Requires-Dist: numba
Requires-Dist: scikit-learn
Requires-Dist: hmmlearn; python_version < "3.14" and (sys_platform != "win32" or platform_machine != "ARM64")
Requires-Dist: ripser; python_version < "3.15" and (sys_platform != "win32" or platform_machine != "ARM64")
Requires-Dist: arch
Requires-Dist: PyWavelets
Requires-Dist: rich
Requires-Dist: pathos
Requires-Dist: lmfit
Provides-Extra: hmm
Requires-Dist: hmmlearn; extra == "hmm"
Provides-Extra: tda
Requires-Dist: ripser; extra == "tda"
Provides-Extra: parquet
Requires-Dist: pyarrow; extra == "parquet"
Provides-Extra: test
Requires-Dist: pytest>=6.0; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: pytest-mock; extra == "test"
Requires-Dist: ripser; extra == "test"
Requires-Dist: pyarrow; extra == "test"
Requires-Dist: hmmlearn; extra == "test"
Dynamic: license-file

<p align="center">
  <picture>
    <source srcset="https://raw.githubusercontent.com/DynamicsAndNeuralSystems/pyhctsa/main/img/pyhctsa_logo_dark.png" media="(prefers-color-scheme: dark)">
    <img src="https://raw.githubusercontent.com/DynamicsAndNeuralSystems/pyhctsa/main/img/pyhctsa_logo.png" alt="pyhctsa logo" height="320"/>
  </picture>
</p>

<h1 align="center"><em>pyhctsa</em></h1>
<p align="center"><strong>Highly comparative time-series analysis in Python</strong></p>

<p align="center">
  <a href="https://pepy.tech/projects/pyhctsa"><img src="https://static.pepy.tech/personalized-badge/pyhctsa?period=total&units=INTERNATIONAL_SYSTEM&left_color=GREY&right_color=GREEN&left_text=downloads" alt="PyPI Downloads"></a>
  <a href="https://pypi.org/project/pyhctsa/"><img src="https://img.shields.io/pypi/v/pyhctsa.svg" alt="PyPI Version"></a>
  <a href="https://pypi.org/project/pyhctsa/"><img src="https://img.shields.io/pypi/pyversions/pyhctsa.svg" alt="Python Version"></a>
  <a href="https://github.com/DynamicsAndNeuralSystems/pyhctsa/actions/workflows/run_unit_tests.yaml"><img src="https://img.shields.io/github/actions/workflow/status/DynamicsAndNeuralSystems/pyhctsa/run_unit_tests.yaml?branch=main&label=CI" alt="CI"></a>
  <a href="https://github.com/DynamicsAndNeuralSystems/pyhctsa/actions/workflows/run_unit_tests.yaml"><img src="https://raw.githubusercontent.com/DynamicsAndNeuralSystems/pyhctsa/coverage-badge/coverage.svg" alt="Coverage"></a>
  <a href="https://www.gnu.org/licenses/gpl-3.0"><img src="https://img.shields.io/badge/License-GPL_v3-orange.svg" alt="License"></a>
  <br>
  <a href="https://doi.org/10.21105/joss.10581"><img src="https://joss.theoj.org/papers/10.21105/joss.10581/status.svg" alt="JOSS"></a>
  <a href="https://github.com/pyOpenSci/software-submission/issues/282"><img src="https://pyopensci.org/badges/peer-reviewed.svg" alt="pyOpenSci Peer-Reviewed"></a>
  <a href="https://doi.org/10.5281/zenodo.18529934"><img src="https://img.shields.io/badge/DOI-10.5281%2Fzenodo.18529934-blue.svg" alt="Zenodo DOI"></a>
</p>

<p align="center">
  <a href="https://dynamicsandneuralsystems.github.io/pyhctsa/">Documentation</a> &nbsp;·&nbsp;
  <a href="https://dynamicsandneuralsystems.github.io/pyhctsa/usage/getting_started.html">Getting started</a> &nbsp;·&nbsp;
  <a href="https://dynamicsandneuralsystems.github.io/pyhctsa/methods/index.html">Method list</a> &nbsp;·&nbsp;
  <a href="https://dynamicsandneuralsystems.github.io/pyhctsa/api.html">API reference</a> &nbsp;·&nbsp;
  <a href="https://doi.org/10.21105/joss.10581">Paper</a>
</p>

---

The **PY**thon toolkit for **H**ighly **C**omparative **T**ime-**S**eries **A**nalysis (_pyhctsa_) is a living library of
time-series analysis methods.
It computes **over 6300 interpretable time-series features** (6406 in the default feature set: 6166 from the operations of `hctsa` plus 240 pyhctsa-only features) from a single univariate
series — spanning distributional shape, autocorrelation, entropy and information theory, scaling, stationarity,
nonlinear dynamics, spectral and wavelet properties, model fits, and more — making it the most comprehensive feature
set available in native Python.

<p align="center">
  <img src="https://raw.githubusercontent.com/DynamicsAndNeuralSystems/pyhctsa/main/paper/pyhctsa_graphical_abstract.png" alt="Overview of the pyhctsa workflow" width="750"/>
</p>

## Installation

_pyhctsa_ requires Python 3.10 or newer:

```bash
pip install pyhctsa
```

This gives all 6406 features of the default feature set on Python 3.10 to 3.13.
Two dependencies are used by only a few features.
If either cannot be imported, the calculator skips those features and warns, naming the package to install, instead of failing:

- `ripser`, for the 8 persistent-homology features (`persistent_homology`), is installed with pyhctsa.
  It publishes wheels for Python 3.10 to 3.14 on Linux, macOS and Windows (x64), so no compiler is needed.
  If your environment lacks it (after `pip install --no-deps`, for example), add it with `pip install ripser`.
- `hmmlearn`, for the 34 hidden-Markov-model features (`hmm_fit`, `hmm_compare_n_states`), is installed with pyhctsa on Python 3.10 to 3.13.
  It does not yet publish wheels for Python 3.14, so there pyhctsa gives 6372 features.
  To get the other 34, install it yourself (`pip install "pyhctsa[hmm]"`), which builds it from source and needs a C++ compiler.

Each is installed only where it is known to publish a wheel, so that a failed build of either can never stop pyhctsa from installing.
On other platforms (a Python version newer than those listed, or Windows on ARM) neither is installed, and the warning gives the command to add it.

pyhctsa publishes no wheel for Intel Macs (macOS x86_64), so pip builds it from source there, which needs the Xcode Command Line Tools.
On Intel Macs, use Python 3.10 to 3.13: `numba`, a required dependency, no longer publishes Intel Mac wheels and has none for Python 3.14.

We strongly recommend installing into a fresh virtual environment to prevent dependency clashes:

```bash
conda create -n pyhctsa python=3.12 -y && conda activate pyhctsa && pip install pyhctsa
```

## Quickstart

Instantiate a `FeatureCalculator` and call `extract` on your data:

```python
from pyhctsa.calculator import FeatureCalculator
from pyhctsa.utils import get_dataset

calc = FeatureCalculator()          # the default feature set

e1000 = get_dataset()               # Empirical1000 dataset (downloaded once, 33 MB)
data = e1000[0]                     # a list, array, or pandas Series

res = calc.extract(data)            # pandas DataFrame, one row per series
```

`extract` accepts either a single time series or a list of series, which do **not** need to be the same length:

```python
res = calc.extract(e1000[:10], verbose=True)
print(res.shape)                    # (10, F) -> N series x F features
```

Results are returned as a `pandas.DataFrame` of shape *N* × *F*, where *N* is the number of time-series
instances and *F* is the number of time-series features.

For Empirical1000 and the 1000×1000 collection you can skip the computation: `get_dataset_features('e1000')` (or `'1000x1000'`; the aliases `'Empirical1000'` and `'S1000'` also work) downloads the full feature matrix that pyhctsa 2.0.0 computed with the default feature set.
These are pyhctsa features (6406), not the hctsa (MATLAB) feature matrices in the same figshare records, which are a different feature set.

## Next steps

- [Getting started](https://dynamicsandneuralsystems.github.io/pyhctsa/usage/getting_started.html): computing features, calling individual operations, and
  parallel computing with `LocalDistributor`.
- [Advanced usage](https://dynamicsandneuralsystems.github.io/pyhctsa/usage/advanced_usage.html): custom feature sets from your own `.yaml` configuration,
  and feature filtering.
- [Sampling rate](https://dynamicsandneuralsystems.github.io/pyhctsa/usage/sampling_rate.html): why the sampling rate matters, and how to check
  and set one rate for a whole dataset (`sampling_report`, `resample_dataset`) before extraction.
- [Method list](https://dynamicsandneuralsystems.github.io/pyhctsa/methods/index.html) and [API reference](https://dynamicsandneuralsystems.github.io/pyhctsa/api.html): every operation and its outputs.
- [Tutorials](https://github.com/DynamicsAndNeuralSystems/pyhctsa/tree/main/tutorials): step-by-step notebooks.

## Citation

If you use _pyhctsa_ in your work, please cite the accompanying JOSS paper:

> Moore, J. B., & Fulcher, B. D. (2026). _pyhctsa_: A Python package for highly comparative time-series analysis.
> _Journal of Open Source Software_, 11(123), 10581. https://doi.org/10.21105/joss.10581

Please also cite the papers that introduced highly comparative time-series analysis and _hctsa_:

> Fulcher, B. D., & Jones, N. S. (2017). _hctsa_: A computational framework for automated time-series phenotyping using massive feature extraction.
> _Cell Systems_, 5(5), 527–531.e3. https://doi.org/10.1016/j.cels.2017.10.001

> Fulcher, B. D., Little, M. A., & Jones, N. S. (2013). Highly comparative time-series analysis: the empirical structure of time series and their methods.
> _Journal of the Royal Society Interface_, 10(83), 20130048. https://doi.org/10.1098/rsif.2013.0048

<details>
<summary>BibTeX</summary>

```bibtex
@article{Moore2026pyhctsa,
  author  = {Moore, Joshua B. and Fulcher, Ben D.},
  title   = {pyhctsa: A Python package for highly comparative time-series analysis},
  journal = {Journal of Open Source Software},
  year    = {2026},
  volume  = {11},
  number  = {123},
  pages   = {10581},
  doi     = {10.21105/joss.10581}
}

@article{Fulcher2017hctsa,
  author  = {Fulcher, Ben D. and Jones, Nick S.},
  title   = {hctsa: A computational framework for automated time-series phenotyping using massive feature extraction},
  journal = {Cell Systems},
  year    = {2017},
  volume  = {5},
  number  = {5},
  pages   = {527--531.e3},
  doi     = {10.1016/j.cels.2017.10.001}
}

@article{Fulcher2013hctsa,
  author  = {Fulcher, Ben D. and Little, Max A. and Jones, Nick S.},
  title   = {Highly comparative time-series analysis: the empirical structure of time series and their methods},
  journal = {Journal of the Royal Society Interface},
  year    = {2013},
  volume  = {10},
  number  = {83},
  pages   = {20130048},
  doi     = {10.1098/rsif.2013.0048}
}
```

</details>

Machine-readable metadata is provided in [`CITATION.cff`](https://github.com/DynamicsAndNeuralSystems/pyhctsa/blob/main/CITATION.cff).

## Licenses

_pyhctsa_ is licensed under the [GNU General Public License v3.0 or later](https://github.com/DynamicsAndNeuralSystems/pyhctsa/blob/main/LICENSE). It is a Python implementation of
the feature library of [_hctsa_](https://github.com/benfulcher/hctsa). Some features use third-party code, bundled in
[`pyhctsa/toolboxes/`](https://github.com/DynamicsAndNeuralSystems/pyhctsa/tree/main/pyhctsa/toolboxes) under its own GPL-compatible license (full texts in
[`THIRD_PARTY_LICENSES.md`](https://github.com/DynamicsAndNeuralSystems/pyhctsa/blob/main/THIRD_PARTY_LICENSES.md)); others are clean-room re-implementations of published methods.
Full credits are on the [Acknowledgements](https://dynamicsandneuralsystems.github.io/pyhctsa/acknowledgements.html) page of the documentation.

## Notes

- **Version 2 and this repository's history.** _pyhctsa_ 2.0 (November 2026) lives in a re-created repository with a fresh history.
  Every function that depended on MATLAB code was re-implemented clean-room from published methods, and bundled third-party code is GPL-compatible (see [Licenses](#licenses)).
  Earlier releases (1.x) have been yanked; please upgrade.
- **AI use.** Much of _pyhctsa_ 2.0, including the clean-room re-implementations, tests and documentation, was written with AI coding assistants (Anthropic's Claude) under the direction of the maintainers.
  Not every contribution has been reviewed line by line by a human.
  Instead, each has been verified against the outputs of existing implementations (e.g., _hctsa_) where appropriate, or else by appropriately formulated direct tests of behavior.
