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.

Installation

pip install nanoid-dictionary

Usage

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.

Source Distribution

nanoid-dictionary-2.4.0.tar.gz (2.0 kB view hashes)

Uploaded Source

Built Distribution

nanoid_dictionary-2.4.0-py3-none-any.whl (3.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page