Skip to main content

Vasuki generates different kinds of random unique identifiers, tokens, and words

Project description

Software test outcome Software tests code coverage Supported versions of Python PyPI Status Version on PyPI https://pepy.tech/badge/vasuki/month License

https://ptrace.hiveeyes.org/2019-06-29_vasuki-small.jpg

Vasuki

About

Vasuki generates different kinds of random unique identifiers, tokens, and words. It can be used as a library and as an HTTP service, aiming to provide effortless identifier generation for your applications.

Install

Prerequisites

pip install vasuki

With service API:

pip install 'vasuki[service]'

Features

Unique ID generators

  • UUIDv4 universally unique identifier

  • ULID universally unique lexicographically sortable identifier

  • Gibberish random, pronounceable pseudo-words

  • MomentName, a short epoch slug

  • Nagamani19, a short, unique, non-sequential identifier based on Hashids and a custom Epoch starting on January 1, 2019.

Time and randomness is usually taking from the system as implemented by the libraries underpinning this package.

Slugifiers

  • six-nibble-name converts six nibbles (three bytes) into a 4-character name

Optional service API

The fine responder optionally exposes the machinery as HTTP API.

Synopsis

# UUIDv4 universally unique identifier.
vasuki uuid

# ULID universally unique lexicographically sortable identifier.
vasuki ulid

# Gibberish random, pronounceable pseudo-words
vasuki gibberish

# MomentName short epoch slugs
vasuki moment

# Nagamani19 short, unique, non-sequential identifier.
vasuki naga19

Examples

Identifier generation

# UUIDv4
vasuki uuid
d192b464-d32c-48f1-9c23-0fe04a4e8133

# ULID
vasuki ulid
01DEFKXYCJ0E91DQY0YPWZY01D

# Gibberish
vasuki gibberish
shoomly

# MomentName
vasuki moment
Zese

# Nagamani19
vasuki naga19
Xm3k6mWq

With transformations

Vasuki can apply uppercase or lowercase transformation to the generated identifier or word:

# UUIDv4, uppercase
vasuki uuid --upper
43FA0272-CA48-40AE-8CC1-204302D91D89

# ULID, lowercase
vasuki ulid --lower
01defkz01k47dqkvcyhy0mz06e

With variable word length

vasuki gibberish --size medium
schreblyiopp

Slug tools

vasuki slug 42 --format=sixnibble
Baca

Multiple tokens at once

vasuki naga19 --count 10
vasuki gibberish --size large --count 50

HTTP API

Start the Vasuki service as daemon:

vasuki service

Example requests would look like:

# UUIDv4
/unique/uuid

# Uppercase UUIDv4
/unique/uuid?upper=true

# Multiple ULIDs
/unique/ulid?count=10

# Very short Nagamani19
/unique/naga19?size=small

Development

Acquire sources:

git clone https://github.com/daq-tools/vasuki
cd vasuki

Install development sandbox:

python3 -m venv .venv
source .venv/bin/activate
pip install --editable=.[develop,docs,test]
vasuki --version

Run linter and software tests:

poe check

Disclaimer

The algorithms and procedures curated here generate different kinds of random and pseudo-random identifiers, tokens, names or passwords.

While some of the generated tokens max out on the randomness and uniqueness aspects like UUIDs, others compromise on the time vs. space domain but focus more on human memorability and empathize with their common sense and humor.

Saying that, you should know what about their properties and features when using those identifiers in different contexts. YMMV.

Credits

Etymology

Kurma is one of the avatars of Vishnu. He appears in the form of a tortoise or turtle to support the foundation of the cosmos, while the gods and demons churn the cosmic ocean with the help of serpent Vasuki to produce the nectar of immortality.

Vasuki is a naga serpent king, occasionally coiling around Kurma’s or Shiva’s neck, who blessed and wore him as an ornament. He is described as having a gem called Nagamani on his head.

Download files

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

Source Distribution

vasuki-0.5.0.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

vasuki-0.5.0-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file vasuki-0.5.0.tar.gz.

File metadata

  • Download URL: vasuki-0.5.0.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for vasuki-0.5.0.tar.gz
Algorithm Hash digest
SHA256 1ac9d5184382f0caedf3b1b35db3fb5f396c7511bef7e0ee0acd9cbe274c2a02
MD5 1d247f95b2c021386472ebba13fe2a76
BLAKE2b-256 bcae8d7f4bb2950488261bae417b03fd3c05c434c0577b76f7926dabb7881ad8

See more details on using hashes here.

File details

Details for the file vasuki-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: vasuki-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 17.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for vasuki-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2ceaa8e36a35ae990659994a324b22d25598a52002d2206ac757da763d820975
MD5 1645710c5ed320acfeac7c86b071011a
BLAKE2b-256 704f38183629bc9c4b97caf9bbd18db5b31fe15c45593dc31bfb3736cbc996bf

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