Metadata-Version: 2.1
Name: tsflex
Version: 0.1.1.1
Summary: Toolkit for flexible operations on time-series data
Home-page: https://github.com/tsflex/tsflex
License: MIT
Keywords: time-series,processing,feature-extraction,data-science
Author: Jonas Van Der Donckt, Jeroen Van Der Donckt, Emiel Deprost
Requires-Python: >=3.7.1,<4.0.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: dill (>=0.3.3,<0.4.0)
Requires-Dist: fastparquet (>=0.6.3,<0.7.0)
Requires-Dist: numpy (>=1.19.0,<2.0.0)
Requires-Dist: pandas (>=1.2.3,<2.0.0)
Requires-Dist: pathos (>=0.2.7,<0.3.0)
Requires-Dist: scikit-learn (>=0.24.2,<0.25.0)
Requires-Dist: tqdm (>=4.60.0,<5.0.0)
Project-URL: Documentation, https://tsflex.github.io/tsflex
Project-URL: Repository, https://github.com/tsflex/tsflex
Description-Content-Type: text/markdown

# <p align="center"><img alt="tsflex" src="./docs/_static/logo.png" height="100"></p>

*tsflex* stands for: _**flex**ible **t**ime-**s**eries operations_<br>

It is a `time-series first` toolkit for **processing & feature extraction**, making few assumptions about input data. 

* [example notebooks](examples/)

## Table of contents
  - [Installation](#installation)
  - [Usage](#usage)
    - [Series processing](#series-processing)
    - [Feature extraction](#feature-extraction)
  - [Documentation](#documentation)


## Installation

If you are using **pip**, just execute the following command:

```sh
pip install tsflex
```

## Usage

_tsflex_ is built to be intuitive, so we encourage you to copy-paste this code and toy with some parameters!


### Series processing

`:WIP:`

### Feature extraction

```python
import pandas as pd; import scipy.stats as ss; import numpy as np
from tsflex.features import FeatureDescriptor, FeatureCollection, NumpyFuncWrapper

# 1. -------- Get your time-indexed data --------
series_size = 10_000
series_name="lux"

data = pd.Series(
    data=np.random.random(series_size), 
    index=pd.date_range("2021-07-01", freq="1h", periods=series_size)
).rename(series_name)
# -- 1.1 drop some data, as we don't make frequency assumptions
data = data.drop(np.random.choice(data.index, 200, replace=False))


# 2 -------- Construct your feature collection --------
fc = FeatureCollection(
    feature_descriptors=[
        FeatureDescriptor(
            function=NumpyFuncWrapper(func=ss.skew, output_names="skew"),
            series_name=series_name, 
            window="1day", stride="6hours"
        )
    ]
)
# -- 2.1. Add multiple features to your feature collection
fc.add(FeatureDescriptor(np.min, series_name, '2days', '1day'))


# 3 -------- Calculate features --------
fc.calculate(data=data)
```

## Documentation

To see the documentation locally, install [pdoc](https://github.com/pdoc3/pdoc) and execute the succeeding command from this folder location.

```sh
pdoc3 --template-dir docs/pdoc_template/ --http :8181 tsflex
```

<br>

---

<p align="center">
👤 <i>Jonas Van Der Donckt, Jeroen Van Der Donckt, Emiel Deprost</i>
</p>



