HRUID
Human Readable Unique Identifier for Python
Usage
Install
???
Use
import hruid
generator = hruid.Generator()
phrase = generator.random()
print(phrase)
Overview
This Python package implements human readable ID generation based on the Asanablog post by Greg Slovacek.
In it, he describes how a unique phrase can be generated in lieu of a confusing and complex alphanumeric ID.
Imagine representing 32 bits of information (numbers up to 4 billion) as a sentence instead of a jumble of digits. Each sentence can have the same predictable structure, and the number will be used to choose words from a dictionary to fill in that structure—like Mad Libs.
One possible sentence structure can be: count + adjective + plural noun + verb + adverb, e.g. “6 sad squid snuggle softly.” We can divide the bit-space of the number like so:
- 5 bits for the count (2-33, so it is always plural)
- 7 bits for the adjective (one of 128 possibilities)
- 7 bits for the plural noun (one of 128 possibilities, which we made all animals just for fun)
- 7 bits for the verb (one of 128 possibilities)
- 6 bits for the adverb (one of 64 possibilities)
Now, given a dictionary containing words categorized in this way, we can generate 4 billion unique (and sometimes very memorable) sentences. In Asana, the ID used to generate the error phrase is random, so the same sentence is unlikely to occur twice.
Develop
Install dependencies
poetry install
Run example.py which does some basic things with the package
poetry run python example.py
Run the package in CLI mode
poetry run python -m hruid
To run tests
poetry run tests
License
Metadata
Release files for hruid 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hruid-0.0.3.tar.gz | 17.3 kB | Without provenance | Details for hruid-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hruid-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for hruid-0.0.3-py3-none-any.whl |
Total release size: 35.6 kB
Release files / hruid-0.0.3.tar.gz
| Download URL | hruid-0.0.3.tar.gz |
|---|---|
| Size | 17.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0091431c60ae5969077f48d4549b3001d5a3dd6853c32f1e864823a673e89dc8
|
|
BLAKE2b-256 checksum How to use checksums |
38824255b1d2e6182198a1063932928993b61becde7a000f48ffc75b8e7400d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.17 CPython/3.7.1 Linux/4.15.0-1028-gcp
|
Release files / hruid-0.0.3-py3-none-any.whl
| Download URL | hruid-0.0.3-py3-none-any.whl |
|---|---|
| Size | 18.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
46bb5190897834f4612102789a12e6720d4fbc9d4c2d7ce33189c443f4815d0f
|
|
BLAKE2b-256 checksum How to use checksums |
b8eb432231a8c8f6aed0a550d5d53597ebc0d9c6cabf22321194e6e082ddfe72
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.17 CPython/3.7.1 Linux/4.15.0-1028-gcp
|
Security for hruid 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.