Skip to main content

Generate unique time-based identifers

Project description

tuuid

tuuid is a Python library for generating unique identifers that are:

  • Small (only 13 characters)
  • URL safe
  • Guaranteed to be unique (see below)
  • Able to be decoded to a datetime.datetime or timestamp

Internally, a threading.Lock mutex is used to ensure unique values across the system.

Installation

Use the package manager pip to install foobar.

pip install tuuid

Usage

import tuuid

tuuid.random()
# returns 'gJD9zjQwq4AkD'

tuuid.decode('gJD9zjQwq4AkD')
# returns 'datetime.datetime(2022, 3, 13, 3, 11, 11)'

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT. You can freely use tuuids in open source projects and commercial products.

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

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

Source Distribution

tuuid-1.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

tuuid-1.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file tuuid-1.0.tar.gz.

File metadata

  • Download URL: tuuid-1.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.2.0 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.8.12

File hashes

Hashes for tuuid-1.0.tar.gz
Algorithm Hash digest
SHA256 f830e19652cdf1a2d653aecad6387ee47dc04b2363a1e3aef8d78d219ed4f624
MD5 090a4b0a16be0ccc02c6676eb8f28d26
BLAKE2b-256 018042ca550bb65b70dd1084301a02faa0fc0b5d49afdb19fb08df18c1cf6d67

See more details on using hashes here.

File details

Details for the file tuuid-1.0-py3-none-any.whl.

File metadata

  • Download URL: tuuid-1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.2.0 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.8.12

File hashes

Hashes for tuuid-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 080f44c355d2fd461dbcacbf7ff32cce02cdc36b109ea56555e74670abbc93a2
MD5 0ff5a526aee447e494e02b1e6970fc05
BLAKE2b-256 91486003faf522c76c99b2455f22a5488f2e3f546d837c46bb73ef35ba1c3205

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