semvec/pypi-packages huggingface dataset:
sausage-links 1.0.0
Implementation of the Sausage Links algorithm base Swinging Door in Python.
Requires Python: >=3.9
Keywords: SausageLinks

|License| |Release| |Supported versions| |Docs|
|Code Coverage| |Build status Appveyor| |Build Status Travis CI|
|Contact| |Blog|

Sausage Links
=============

Implementation of the Sausage Links algorithm base Swinging Door in Python.

Example of usage
----------------

.. code:: python

    >>> from datetime import datetime
    >>> from pandas import read_csv, DataFrame

    >>> df = DataFrame(
    ...     [
    ...         {
    ...             "Date": datetime.strptime(date, "%Y-%m-%d"),
    ...             "Price": value
    ...         }
    ...         for date, value in read_csv(
    ...             "https://datahub.io/core/oil-prices/r/wti-daily.csv"
    ...         ).values.tolist()
    ...     ]
    ... )

    >>> print(len(df))
    9895

    >>> df.plot(x="Date", y="Price")

.. code:: python

    >>> from sausage_links import sausage_links

    >>> compress = DataFrame(
    ...      list(
    ...         {
    ...             "Date": datetime.fromtimestamp(date),
    ...             "Price": value
    ...         }
    ...         for date, value in sausage_links(
    ...             iter(
    ...                 (date.timestamp(), value)
    ...                 for date, value in df.values.tolist()
    ...             ), deviation=(1, .5), max_len=604_800,
    ...             auto_dev_factor=200_000, ema_alpha=0.5
    ...         )
    ...     )
    ... )

    >>> print(len(compress))
    4177

    >>> compress.plot(x="Date", y="Price")

.. |License| image:: https://img.shields.io/badge/License-MIT-yellow.svg
   :target:  https://opensource.org/licenses/MIT
.. |Release| image:: https://img.shields.io/github/release/chelaxe/SausageLinks.svg
   :target: https://github.com/chelaxe/SausageLinks/releases
.. |Supported versions| image:: https://img.shields.io/pypi/pyversions/sausage_links.svg
   :target: https://pypi.org/project/sausage_links/
.. |Docs| image:: https://readthedocs.org/projects/sausagelinks/badge/?version=latest&style=flat
   :target:  https://sausagelinks.readthedocs.io/en/latest/
.. |Code Coverage| image:: https://codecov.io/gh/chelaxe/SausageLinks/branch/main/graph/badge.svg
   :target: https://codecov.io/gh/chelaxe/SausageLinks
.. |Build status Appveyor| image:: https://ci.appveyor.com/api/projects/status/github/chelaxe/sausagelinks?branch=main&svg=true
   :target: https://ci.appveyor.com/project/chelaxe/sausagelinks
.. |Build Status Travis CI| image:: https://api.travis-ci.com/chelaxe/SausageLinks.svg?branch=main
   :target: https://app.travis-ci.com/github/chelaxe/SausageLinks
.. |Contact| image:: https://img.shields.io/badge/telegram-write%20me-blue.svg
   :target:  https://t.me/chelaxe
.. |Blog| image:: https://img.shields.io/badge/site-my%20blog-yellow.svg
   :target:  https://chelaxe.ru/