Skip to main content

Predefined character sets to use with Nano ID

Project description

Nano ID dictionary

Predefined character sets to use with Nano ID.


Install Nano ID dictionary using pip:

pip install nanoid-dictionary


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

Thanks to

Project details

Download files

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

Files for nanoid-dictionary, version 2.1.0
Filename, size File type Python version Upload date Hashes
Filename, size nanoid_dictionary-2.1.0-py3-none-any.whl (2.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size nanoid-dictionary-2.1.0.tar.gz (2.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page