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:
- Clone the repository.
- Create a virtual environment and activate it.
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ulid_dates-0.1.0.tar.gz.
File metadata
- Download URL: ulid_dates-0.1.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8dfe4169460eeb3b3a46bfdefc9344add8001f2a98db459ecb832acc1a02af3b
|
|
| MD5 |
ca2552f21868eb2e84fa0ce2c9aae8f1
|
|
| BLAKE2b-256 |
4b89518bebf4531f3384315c9476483511193c7a2e1db127f3994885305d312a
|
File details
Details for the file ulid_dates-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ulid_dates-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a061a0c8a79d4fa6df1fdc315f9c998105b44c4913036443a6652b417a7da43
|
|
| MD5 |
28378529c1c4d463f1530eaaf7666779
|
|
| BLAKE2b-256 |
9172cedb4d62424d6423d9acaae62e2fe08f2afda9c1402d40de6aca80df8eb3
|