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.

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

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.1.0.tar.gz (2.0 kB view hashes)

Uploaded Source

Built Distribution

nanoid_dictionary-2.1.0-py3-none-any.whl (2.6 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