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-0.1.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

koltrast-0.1.1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for koltrast-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0a3f769ae9e459625538b8c6e5289dec99b18162b60a13eb8b0ccc525f46b00c
MD5 e662ed34584f9ec14d1ab092fbddd3c3
BLAKE2b-256 01a5ebdae9bdec210182100191dd8d12d67e5e21585118c349fb958586c5d7c3

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for koltrast-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 125eb4bbeb1d4590187d2fb4589ec7cc1e64d4e59ab061693757190f61f861a7
MD5 aed0403a34fc7108540a4518b8af8452
BLAKE2b-256 64b9c048fe3be586afb3c6203b191cd7065c5601a6d3f7865c29ded0fdebefe0

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