Human-readable unique identifiers
Project description
Named IDs
A Python module for generating human-readable unique identifiers.
Installation
pip install named_ids
Usage
The default size is "small" (adjective + noun). Here's how to use the module:
import named_ids
# Optional. Set a seed for reproducible results
random.seed(42)
# Optional. Only needed if you want to use a different size than the default (small)
named_ids.set("large")
# Generate ID
print(named_ids.next())
# Or just sample
print(named_ids.sample()) # defaults to the one set
print(named_ids.sample("huge")) # can also set the size
next() ensures unique IDs by stepping through combinations sequentially. sample() provides random IDs without maintaining sequence.
Size Options
| Name | Pool Size | Components | Example |
|---|---|---|---|
| tiny | 1,5 thousand | noun | queen |
| small | 2 million | adjective + noun | red_queen |
| medium | 2 billion | adjective + noun + verb | red_queen_bomb |
| large | 624 billion | adjective + noun + verb + adverb | red_queen_bomb_carefully |
| huge | 623 trillion | number + adjective + noun + verb + adverb | 371_red_queen_bomb_carefully |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file named_ids-0.1.0.tar.gz.
File metadata
- Download URL: named_ids-0.1.0.tar.gz
- Upload date:
- Size: 20.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e27e5e20ea47a40fceb9cfc3f98091387ed0ea2d7e7de8d46320b5450e0fcef4
|
|
| MD5 |
db7fc2af16afa4fcb40c9dc9a53f2b29
|
|
| BLAKE2b-256 |
a110d4906169eaa3d02f724ae99f89fd2351f77fd17ff07ea11610a6cb111b9a
|
File details
Details for the file named_ids-0.1.0-py3-none-any.whl.
File metadata
- Download URL: named_ids-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8f2fcdaa507d1d9d435baae7ff19a5527a992aa18e6baa7dd9de4246c5c756d
|
|
| MD5 |
6243d4033d4471ece196552c35d2008c
|
|
| BLAKE2b-256 |
cb2c43cb99bd33f6133891c2761a561ae1ceb4711c05556e2fa5f9529df75bde
|