Skip to main content

Python implementation of a sliding window.

Project description

License Coverage Version

Time Series

A simple python implementation of a sliding window.

Installation

pip install time-series

Examples

import timeseries

# max 10 data points
fixed_window = timeseries.Fixed(10)

# removes added data points after 10 seconds
timer_window = timeseries.Timer(10)

# deletes data points after 10 iterations
for i in range(100):
    current_window = fixed_window.slide(i)

# deletes data points after 10 seconds have elapsed.
for i in range(100):
    current_window = timer_window.slide(i)

# prints 89...99
for i in fixed_window:
    print(i)

# will most likely print 0...99
for i in timer_window:
    print(i)

if fixed_window.is_full:
    print("fixed window is full")

# shrinks the number of elements to 2 (threadsafe)
fixed_window.maxsize = 2

# print current number of items
print(timer_window.size, len(timer_window))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

time-series-0.2.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

time_series-0.2-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file time-series-0.2.tar.gz.

File metadata

  • Download URL: time-series-0.2.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for time-series-0.2.tar.gz
Algorithm Hash digest
SHA256 a39c0f880eaa0ae7db713a54f7b55c0b3d35863b104cb36aa12c5db4fc3e8bdc
MD5 12f587c6a201e691ad1c51995da8bebb
BLAKE2b-256 dcaa49896b1bf0e38825f3bfcd65f5110dab55222f3027e63225efee00ccbdf0

See more details on using hashes here.

File details

Details for the file time_series-0.2-py3-none-any.whl.

File metadata

  • Download URL: time_series-0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for time_series-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6872eb94d9ef80b5c7ed3c5d38511dec3f1fec6b2c6b8c587c475d8cf7b397b8
MD5 198d1dd90d6932a2e4a6645d708a1d1e
BLAKE2b-256 8216a6f73386a6d44149d3b71de2d4da6525b7df70b2a795b2a63ad778914592

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page