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.4.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.4-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: koltrast-2.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 3872433463c4b8df90ea2c2cd7c598b31fb85f5d964c2ffff38b362d0fe2201b
MD5 7ae438d687e70c371032f6291180ca18
BLAKE2b-256 ab5ea9f8bad201962c5198a4fe81c168a1bcfd7d3cbc13d1fcfd66301ec515bf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: koltrast-2.0.4-py3-none-any.whl
  • Upload date:
  • Size: 3.7 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 77f9515b260c5e61d16e993de962a17244636756f4ca0618d4dad573adc1fc1b
MD5 392a0d1083eed53e6f1ea6f2a4545daf
BLAKE2b-256 a8f2da78d556bd4564b00a29490f4670132dcf0cdd2b272f9378c0d5d93b70a1

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