password_validator
This is a python port of npm package password-validator.
Install
pip install password-validator
Usage
from password_validator import PasswordValidator
# Create a schema
schema = PasswordValidator()
# Add properties to it
schema\
.min(8)\
.max(100)\
.has().uppercase()\
.has().lowercase()\
.has().digits()\
.has().no().spaces()\
# Validate against a password string
print(schema.validate('validPASS123'));
# => True
print(schema.validate('invalidPASS'));
# => False
Rules
Rules supported as of now are:
Rules |
Descriptions |
|---|---|
digits() |
specifies password must include digits |
letters() |
specifies password must include letters |
lowercase() |
specifies password must include lowercase letters |
uppercase() |
specifies password must include uppercase letters |
symbols() |
specifies password must include symbols |
spaces() |
specifies password must include spaces |
min(len) |
specifies minimum length |
max(len) |
specifies maximum length |
no([regex]) |
inverts the result of validations applied next |
has([regex]) |
inverts the effect of no() and applies a regex (optional) |
License
Release files for password-validator 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| password_validator-1.0.tar.gz | 4.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| password_validator-1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.0 kB
Release files / password_validator-1.0.tar.gz
| Download URL | password_validator-1.0.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f12c1036b17c67fab607ad8003f43e73940793d7ab89bc7efcb2cd47c024533b
|
|
BLAKE2b-256 checksum How to use checksums |
1f603529640092041a8d46e9c88cdcd6d00f212b3e38e398d4c167eec549fc46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3
|
Release files / password_validator-1.0-py3-none-any.whl
| Download URL | password_validator-1.0-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4de1758e15b4e9bdf32933fcc99ce89efcdd28566e26e130726bb4295dd0d44c
|
|
BLAKE2b-256 checksum How to use checksums |
b814b65256d9f801d172a815adf003892b034fe6dbadec7b9def4f45309a7a56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3
|