Skip to main content

License Release Supported versions Docs Code Coverage Build status Appveyor Build Status Travis CI Contact Blog

Swinging Door

Implementation of the Swinging Door algorithm in Python.

Example of usage

>>> 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")
>>> from swinging_door import swinging_door

>>> compress = DataFrame(
...      list(
...         {
...             "Date": datetime.fromtimestamp(date),
...             "Price": value
...         }
...         for date, value in swinging_door(
...             iter(
...                 (date.timestamp(), value)
...                 for date, value in df.values.tolist()
...             ), deviation=.5
...         )
...     )
... )

>>> print(len(compress))
3392

>>> compress.plot(x="Date", y="Price")

Metadata

Release files for swinging-door 2.0.1

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

Source distribution (sdist)

Source distribution for swinging-door 2.0.1
File Size Uploaded Provenance Actions
swinging_door-2.0.1.tar.gz 4.5 kB Without provenance Details for swinging_door-2.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for swinging-door 2.0.1
File Interpreter ABI Platform Actions
swinging_door-2.0.1-py3-none-any.whl Python 3 none any Details for swinging_door-2.0.1-py3-none-any.whl

Total release size: 9.1 kB

Release files / swinging_door-2.0.1.tar.gz

Download URL swinging_door-2.0.1.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5680c4d60be20facda2c6383e18c113c5080f36855efbe3b37e1012e270a154b
BLAKE2b-256 checksum
How to use checksums
25b76b076860773064d08d6a9d30e4d995c1d411386523f338cbf730d2e200d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.9

Release files / swinging_door-2.0.1-py3-none-any.whl

Download URL swinging_door-2.0.1-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
581fcbbaf026eaa31975f534e1d71abe9245bf604fb0ad4e1370221326b7c422
BLAKE2b-256 checksum
How to use checksums
b50855de433017b747c628d6ec7e0f6be573f00f6a17217e8df5a2eb825652d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.9

Security for swinging-door 2.0.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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