Skip to main content

Predefined character sets to be used with Nano ID

Project description

Alphabets and string functions designed to be used with Nano ID.


pip install nanoid-dictionary


Available alphabets and functions:

  • alphabet_std
  • human_alphabet
  • lookalikes
  • lowercase
  • numbers
  • prevent_misreadings(unsafe_chars, alphabet)
  • uppercase

prevent_misreadings(unsafe_chars, alphabet) accepts a string and removes all the characters that look similar by default. The function is also case-insensitive.

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

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.4.0
Filename, size File type Python version Upload date Hashes
Filename, size nanoid_dictionary-2.4.0-py3-none-any.whl (3.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size nanoid-dictionary-2.4.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