Python library to validate usernames suitable for use in public facing applications.
Python library to validate usernames suitable for use in public facing applications where use can choose login names and sub-domains.
- Provides a default regex validator
- Validates against list of banned words that should not be used as username.
- Python 2.6, 2.7, 3.3, 3.4
pip install python-usernames
from usernames import is_safe_username >> is_safe_username("jerk") False # contains one of the banned words >> is_safe_username("handsome!") False # contains non-url friendly `!`
is_safe_username takes the following optional arguments:
- regex: regular expression string that must pass before the banned words is checked. Default is ^[a-zA-Z0-9_.-]+$
- whitelist: a list of words that should be considered as always safe.
- blacklist: a list of words that should be considered as unsafe.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size python-usernames-0.1.3.tar.gz (5.2 kB)||File type Source||Python version None||Upload date||Hashes View|