Skip to main content

Library to shorten UUIDs

Project description

kuid

A universally unique identifier, is essentially a shorter version of a UUID and is commonly used to identify records in various applications.

Rationale

When writing a web application, often times we would like to keep the URLs short.

http://localhost/posts/5eAU5M3OyqyuX93bJHopJV

This certainly gives a more concise look than the following.

http://localhost/posts/b9926647-86a7-4f31-9c38-f7cf711bf865

Installation

kuid can be installed via pypi.

pip install kuid

Usuage

The following section describes a basic usage of base62.

>>> import uuid
>>> import kuid
>>> 
>>> kuid.encode(uuid.UUID('b9926647-86a7-4f31-9c38-f7cf711bf865'))
'5eAU5M3OyqyuX93bJHopJV'
>>> 
>>> kuid.decode('5eAU5M3OyqyuX93bJHopJV')
UUID('b9926647-86a7-4f31-9c38-f7cf711bf865')

It also has wrappers around basic uuid functions

>>> import kuid
>>> 
>>> kuid.kuid1()
'47ZU06aw8pUWT5BzmVHsST'
>>> kuid.kuid4()
'60fq4TTss8KYXlT2yJy3AQ'

Credits

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

kuid-0.2.0.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

kuid-0.2.0-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file kuid-0.2.0.tar.gz.

File metadata

  • Download URL: kuid-0.2.0.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for kuid-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d238a698ad4012cf256eaa44608c4fdc0aa97933bb999d88d9df5a1cc339d07f
MD5 4dac306e3a2ab6bc8ffd3e822c9192d4
BLAKE2b-256 5f9825fa66b1e6cbf5d724413c6edd05c4cea4b942ae9c01ae524bfb335e22cc

See more details on using hashes here.

File details

Details for the file kuid-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: kuid-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 2.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for kuid-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2862085ac7efcaf04017055cf5bb219a2f6a95963828ceae38d62bc66b4c318a
MD5 8a81043243c2b69e32caf8e6f6b4a5f9
BLAKE2b-256 d69a000e6a0f3a8eefecc6f5f99a95f6f9e67163634c385e781e2743f36e5bac

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page