Generate a base36 timestamp from an ISO 8601 datetime string
Project description
timeslug
A lightweight Python CLI tool that generates base36 timestamps from ISO 8601 datetime strings. Has no dependencies.
Installation
You can install the package via pip:
pip install timeslug
CLI usage
Generate a base36 code from any ISO 8601 datetime string:
timeslug "2026-05-26T15:30:00Z"
If no timezone is specified in the input string, timeslug falls back to UTC.
Options
-o,--offset: Number of days to increment from the epoch (1970-01-01) before generating the code. Defaults to0.
The following example increments the epoch by 10,957 days (to 2000-01-01) and generates a code from 2026-05-26 15:30:00 UTC:
timeslug "2026-05-26T15:30:00" -o 10957
Python API
You can import the functions in your Python projects:
from timeslug import generate_code, encode_base36
# Generate a base36 code from an ISO 8601 string
slug = generate_code("2026-05-26T15:30:00Z")
print(slug)
# Encode any integer to base36
encoded = encode_base36(12345)
print(encoded)
License
This project is licensed under the MIT License.
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 timeslug-1.0.0.tar.gz.
File metadata
- Download URL: timeslug-1.0.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
689d7f36ed8733bb32b79a5ea4e47407eb07738f5fda2767cda2c5b2888f7009
|
|
| MD5 |
4626d071c140f73f984b44732f586838
|
|
| BLAKE2b-256 |
bb7164b4af87e03f54c5f6c3698cc4bd3d67a02661cad8238ffa8f11c824275a
|
File details
Details for the file timeslug-1.0.0-py3-none-any.whl.
File metadata
- Download URL: timeslug-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b13c5087edbda7fd80e4d0cf984366fea297daa2da9bc71bf9f8486eb93b66c
|
|
| MD5 |
c04e7bdec2cc0b00cfebde34a9ebc416
|
|
| BLAKE2b-256 |
90efdd1d6e32ffbb65c863859553078e350068cb749a13e2828597964fb8f502
|