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.1.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: kuid-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 a50c558072edebfcd6a631feaa8c1c2b4ba9807efd72e80ce34485de4509761a
MD5 d31775418bb5ed58fe83cccc673d3800
BLAKE2b-256 fda0f915075950b0f834b196b641362571687e890cfa263d4415f3ebe3f6d992

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kuid-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 91b08e7d6ff685775659fa66a634a670f5a5e9dd686eaa54cd27c0deaae8088a
MD5 dd1be3684079d10465b424d4f03fa83f
BLAKE2b-256 8d715bbe6dfa2e23a0e4eb76cccdcb4b0d0dee14185e2c8d7772e56eddc23491

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