Predefined character sets to use with Nano ID
Project description
Nano ID dictionary
Predefined character sets to use with Nano ID.
Installation
Install Nano ID dictionary using pip:
pip install nanoid-dictionary
Character sets
Nano ID dictionary has alphabet_std
and human_alphabet
alphabets.
The dictionary also provides many useful sets of strings and functions to use:
lookalikes
;lowercase
;numbers
;uppercase
;prevent_misreadings(string, unsafe_chars)
.
prevent_misreadings(string, unsafe_chars)
accepts a string and removes all the characters that look similar. You can pass your own optional character set if you want.
from nanoid_dictionary import *
alphabet_std # => _-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
human_alphabet # => _-23456789abcdefghijkmnpqrstuvwxyzABCDEFGHIJKMNPQRSTUVWXYZ
lookalikes # => 1l0o
lowercase # => abcdefghijklmnopqrstuvwxyz
numbers # => 0123456789
prevent_misreadings('a1l0o', lookalikes) # => a
uppercase # => ABCDEFGHIJKLMNOPQRSTUVWXYZ
Thanks to
- Andrey Sitnik for Nano ID;
- Stanislav Lashmanov for Nano ID dictionary.
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
Close
Hashes for nanoid_dictionary-2.0.0-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98dc4207b08de5ffa1b7f0aaa7ca90586268e8f2457b92a395df9759a9620eec |
|
MD5 | 13e3ace08089e56cfba3df0ad7e36e43 |
|
BLAKE2b-256 | 3afaf6a3d2f227d58587efbdbb4d34602ca4ed2fc3202f991a68f1973c319a0e |