Skip to main content

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 to 0.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

timeslug-1.0.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

timeslug-1.0.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file timeslug-1.0.1.tar.gz.

File metadata

  • Download URL: timeslug-1.0.1.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for timeslug-1.0.1.tar.gz
Algorithm Hash digest
SHA256 1f6e4d5bc766bdba1af1865c6b7d9a62cee39950d1b96f25a7529bb33eb4037d
MD5 56e771375a76172151ea0de4b5373c1a
BLAKE2b-256 ce2a0b82113181abd24ff8d5a8bad1f25c6577f594b84b76ee9407b438655ddb

See more details on using hashes here.

File details

Details for the file timeslug-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: timeslug-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for timeslug-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ebaf66d752da64e75c7ae2d903e6d1050208041c07cfff176bfcacd5b6d97693
MD5 44e368954fa73492f4e58426702d2a9b
BLAKE2b-256 b9c74572a824eb3a5b5573ba3e7a9a854e8177d2c61744e3f548f77146b701ef

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