Skip to main content

Determine ULID prefixes for date ranges

Project description

ULID Dates

A Python utility to determine ULID prefixes for date ranges.

This can be useful for querying databases or logs for ULIDs that fall within a specific time period.

Installation

Install the package using pip:

pip install ulid-dates

Alternatively, using uv:

uv pip install ulid-dates

Usage

from datetime import datetime, timedelta
from ulid_dates import ulid_prefix_range_for_dates

start_date = datetime(2023, 1, 1)
end_date = start_date + timedelta(days=1)

start_prefix, end_prefix = ulid_prefix_range_for_dates(start_date, end_date)

print(f"ULID prefix for {start_date}: {start_prefix}")
print(f"ULID prefix for {end_date}: {end_prefix}")

Development

To set up the development environment:

  1. Clone the repository.
  2. Create a virtual environment and activate it.
  3. Install the dependencies in editable mode.

Using pip:

pip install -e .[dev]

Alternatively, using uv:

uv pip install -e .[dev]

Running Tests

To run the tests, use pytest:

pytest

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

ulid_dates-0.1.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

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

ulid_dates-0.1.1-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ulid_dates-0.1.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.13

File hashes

Hashes for ulid_dates-0.1.1.tar.gz
Algorithm Hash digest
SHA256 48c74d29764e0f1938aada327813e0e3cbbde1897c1a5046be23b990fa723c39
MD5 3d1fb889cde97216ab2a4aa30ba65808
BLAKE2b-256 b767ea724a51a0bc217c919164b5e1d0822102d74a3b1cef31e88db85237215b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ulid_dates-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.13

File hashes

Hashes for ulid_dates-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 67261b18336b9c9ff7fdde6b0c5a820b87b4bfd0484ea06677b279eb05cc8c59
MD5 f1a24fb4de4c87e9b90c4d9a5ed351a3
BLAKE2b-256 d1c206f4842ad5bba784857dc22b7e2abe739b5d05d430194a73498e6ffb5c3e

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