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
Usage
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(unsafe_chars, string)
.
prevent_misreadings(unsafe_chars, string)
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(lookalikes, 'a1l0o') # => 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.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdbf3ba197d0704013ef6cec91881fa4cdaf49a44050759c5c8f363158dfdcbb |
|
MD5 | 285608d84284eea727eb1892de4f44b8 |
|
BLAKE2b-256 | 1daf296fbdee68eda486fe56f200d15c1bd760b685f1e9f3db96a8ff688edf3d |