Skip to main content

Validate usernames against a blacklist

Project description

Build Status PyPI version

The-Big-Username-Blacklist-Python

This library lets you validate usernames against a blacklist. The blacklist data is based on the data from The-Big-Username-Blacklist and contains privilege, programming terms, section names, financial terms and actions.

How it works

the_big_username_blacklist exposes a function named validate, you can use that function to see if a word is occuring in the blacklist.

Usage

Validating a username is easy, if the word is in the blacklist, return False (validation failed), otherwise True. Example:

>>>> from the_big_username_blacklist import validate
>>>> validate("root")
False
>>>> validate("martin")
True

Access the blacklist

If you only want to retrive the blacklist data, you can find it in the list property.

>>>> from the_big_username_blacklist import get_blacklist
>>>> get_blacklist()
[ '400',
  '401',
  '403'...

Installation

This package is available through pip

$ pip install the-big-username-blacklist

Tests

Make sure you have the necessary dependencies (pytest)

pip install -r requirements/tests.txt

Then run the tests

py.test tests

Contributing

Want to contribute? Awesome. Just send a pull request.

License

The-Big-Username-Blacklist-Python is released under the MIT License.

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

the_big_username_blacklist-1.3.0.tar.gz (5.1 kB view details)

Uploaded Source

File details

Details for the file the_big_username_blacklist-1.3.0.tar.gz.

File metadata

File hashes

Hashes for the_big_username_blacklist-1.3.0.tar.gz
Algorithm Hash digest
SHA256 01a1f1dc80eaa9f667141017462ea81b76585b594230e92960dcdba9b1d07d0d
MD5 1a641a0df845e899ba9119d45d86a6bc
BLAKE2b-256 dbd04f29ff09f829236735f9c50d95c4c901a9e97bce32eb3c05c062b796539d

See more details on using hashes here.

Supported by

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