Skip to main content

Validates password according to flexible and intuitive specifications

Project description

pypi version python version format status

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

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

password_validator-0.2.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

password_validator-0.2-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file password_validator-0.2.tar.gz.

File metadata

  • Download URL: password_validator-0.2.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for password_validator-0.2.tar.gz
Algorithm Hash digest
SHA256 1bbf8f159509db6f84962dd564f3f5bdb6faa3f1a5c497520ec8aabc34e11d7c
MD5 85edc07bf5cfbefae226dc17f9a19fbe
BLAKE2b-256 12a4cd18fc64adfefc8da1e5690076dab3a818a53d2d81a4aa2d40f24093a051

See more details on using hashes here.

File details

Details for the file password_validator-0.2-py3-none-any.whl.

File metadata

  • Download URL: password_validator-0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for password_validator-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7e7359f1b97b4ada459add676c352edbe5e2d72cbfefee116666e7beb9a3e4b7
MD5 17b05cfac6824384c9377190ba4a7641
BLAKE2b-256 f69333516b9a277b5e41cb10fa84d7908ae5551ee024bfea492a00eac763c272

See more details on using hashes here.

Supported by

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