Catalog PyPI
PACKAGE EXPLORERView in registry

advanced-password-validator

PyPI

A dynamic password validation system with preconfigured modes and rule-based design

authenticationpasswordpythonrulessecurityvalidation
Versions collected1
Direct dependencies0From release 1.0.1
Last observed20 Oct, 19:58 UTC

README

Version 1.0.1 documentation

🔐 Advanced Password Validator

License: MIT Python Version PyPI - Coming Soon


A dynamic, rule-based password validation system for Python. Supports configurable validation rules and pre-set security modes to suit different application needs.

🚀 Features

  • ✅ Rule-based architecture — plug & play validation rules
  • 🔁 Preconfigured modes: lenient, moderate, strict
  • 🔒 Supports: min/max length, symbols, blacklist, common password checks, etc.
  • 📂 Compare passwords to a list of over 30000 already-registered passwords for added security
  • 🧪 Designed for unit testing & integration

📦 Installation


pip install advanced_password_validator
poetry add advanced_password_validator

🌎 Code Usage:

An overview of a common coding example utilizing the advanced_password_validator to validate a password using customizable rules

from advanced_password_validator import PasswordValidator, Mode

# Instantiate a validator object:
validator = PasswordValidator(
    min_length = 8,                     # Integer / Defaults to None
    max_length = 65,                    # Integer / Defaults to None
    require_uppercase = True,           # Boolean / Defaults to False
    require_numbers = True,             # Boolean / Defaults to False
    require_symbols = True,             # Boolean / Defaults to False
    no_spaces = True,                   # Boolean / Defaults to False
    must_include_char = None,           # String / Defaults to None
    no_repeating_chars = 5,             # Integer / Defaults to None
    blacklisted_pattern = False,        # Boolean / Defaults to False
    not_common = False,                 # Boolean / Defaults to False
    mode = None                         # Mode (Enum) / Defaults to None
)

# validate against password strings:
password_valid1 = validator.validate("ThisIsSuperValid123+")[0]
password_valid2 = validator.validate("nouppercase123+")[0]
password_valid3 = validator.validate("NoNumbers++")[0]

print(password_valid1)  # <= Returns True
print(password_valid2)  # <= Returns False
print(password_valid3)  # <= Returns False

0️⃣ Return Type

The validate method returns a tuple: (bool, list)

  • [0] = a boolean value determining if the password passed the validation
  • [1] = a list of errors based on what Rules the password didn't pass (the list will be empty if validation passes)

📜 Rules Overview:

A rudimentary overview of the rules that can enabled for custom validation

RulesDescription
min_lengthSpecifies the minimum length required for the password (Integer)
max_lengthSpecifies the maximum length possible for the password (Integer)
require_uppercaseSpecifies if the password must include at least 1 uppercase letter (Boolean)
require_numbersSpecifies if the password must include at least 1 digit (Boolean)
require_symbolsSpecifies if the password must include at least 1 special character (Boolean)
no_spacesSpecifies if the password can include spaces (Boolean)
must_include_charSpecifies one of more required characters in the password (String)
no_repeating_charsSpecifies how many sequentially, repeating characters can be included in the password (Integer)
blacklisted_patternSpecifies whether to check the password against a list of blacklisted patterns (Boolean)
not_commonSpecifies whether to check the password against a list of commonly used passwords (Boolean)
modeSpecifies whether to use one of the 3 preconfigured modes (Mode)

🤖 Preconfigured Modes:

The advanced password validator package supports 3 preconfigured validator modes:

  1. Lenient
  2. Moderate
  3. Strict Each of these individual modes come preconfigured with different values, and are meant to be utilised for quick out-of-the-box solutions.
from advanced_password_validator import PasswordValidator, Mode

validator = PasswordValidator(
    mode=Mode.lenient
)
# The mode param takes in a Mode-object (Enum) - Mode.lenient, Mode.moderate, Mode.strict

Lenient

  • min_length = 8
  • max_length = 65

Moderate

  • min_length = 8
  • max_length = 65
  • require_uppercase = True
  • require_numbers = True
  • no_spaces = True
  • no_repeating_chars = 4

Strict

  • min_length = 12
  • max_length = 65
  • require_uppercase = True
  • require_numbers = True
  • require_symbols = True
  • no_spaces = True
  • no_repeating_chars = 3
  • blacklisted_pattern = True
  • not_common = True

📄 License Details:

This project is licensed under the MIT License – see the LICENSE section for further details.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.114 Jun 20250

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
massivelyoverthinking/password_validator

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:58 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:765a035d64a9398d6ae3a5bd6ff73fa0989d2f579d2477c4c80b2f22f56c2e1e