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.8.tar.gz (4.6 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.8-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: koltrast-2.0.8.tar.gz
  • Upload date:
  • Size: 4.6 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.8.tar.gz
Algorithm Hash digest
SHA256 5b5b7de2c1b379a7645da3121bbd4ce2ad8e91a272b53e28b0aa74a3f1d3ec91
MD5 9c3dddc5c026a7d6c091caba1faf1d3a
BLAKE2b-256 d6f36a2408f360df11747fbfd82ffae79b6edf7f880a05df8e904392481d626b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: koltrast-2.0.8-py3-none-any.whl
  • Upload date:
  • Size: 4.2 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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 d5af07d01b444a58be1e27a857f3d291d07d277a6670a001874bc77c79a9848b
MD5 20bc045023184a3cee0f8ba3936ed8c6
BLAKE2b-256 6192f275fed120937828490f463167ba150395fde52ce19833b6c5961c378b3d

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