Skip to main content

Create intervals and helpers for data pipelines

Project description

Koltrast

Koltrast is a very small module that splits a time interval into multiple, shorter intervals.

It was made to help simplify the process of backfilling pipelines.

How to install

pip install koltrast

Example usage

import koltrast

intervals = koltrast.interval.generate_intervals(since="2014-06-01", until="2014-06-04", chunk="day")

for interval in intervals:
    print(interval)
Interval(since=DateTime(2014, 6, 1, 0, 0, 0, tzinfo=Timezone('UTC')), until=DateTime(2014, 6, 2, 0, 0, 0, tzinfo=Timezone('UTC')))
Interval(since=DateTime(2014, 6, 2, 0, 0, 0, tzinfo=Timezone('UTC')), until=DateTime(2014, 6, 3, 0, 0, 0, tzinfo=Timezone('UTC')))
Interval(since=DateTime(2014, 6, 3, 0, 0, 0, tzinfo=Timezone('UTC')), until=DateTime(2014, 6, 4, 0, 0, 0, tzinfo=Timezone('UTC')))

Notes

Accepts the following chunks: day, hour, week, month, year

Koltrast always uses "left", which means for a range from A > D, only A B C are selected.

If you provide a since and until, which cannot be divided evenly by the chunk you provided, the last interval will be shorter.

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

koltrast-2.0.5.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

koltrast-2.0.5-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file koltrast-2.0.5.tar.gz.

File metadata

  • Download URL: koltrast-2.0.5.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for koltrast-2.0.5.tar.gz
Algorithm Hash digest
SHA256 7301bc033a703ad7d9192f694eb269e312aba2e5dce61518a4c4877131ec881d
MD5 7e0b6603bc24a7df9d1842bf0f511992
BLAKE2b-256 be7a94897b7d1bd0ad5bb92a32e23a5f4a8fa37f2b679b2814b6e0167198e8d1

See more details on using hashes here.

File details

Details for the file koltrast-2.0.5-py3-none-any.whl.

File metadata

  • Download URL: koltrast-2.0.5-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for koltrast-2.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d393422d5f749706fad1001e3480c47b37a299cddae22c56ecaa06caee8ea2d7
MD5 d1f6e871bf0b1cf895a78c7d876e0a18
BLAKE2b-256 011f325cafb67146c6be3a67e129eaf7c3eaf1f44cb1846c04b495fd7e1c27ec

See more details on using hashes here.

Supported by

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