Skip to main content

A configurable password policy checker

Project description

Configurable Password Policy Checker

This package provides a configurable password policy checker that allows you to set custom requirements for password strength.

Installation

You can install this package using pip:

pip install passvalidate

Usage

from passvalidate import PasswordPolicy

# Use default policy
default_policy = PasswordPolicy()
is_valid, issues = default_policy.check_password("YourPassword123!")
if is_valid:
    print("Password meets all requirements")
else:
    print("Password issues:")
    for issue in issues:
        print(f"- {issue}")

# Use custom policy
custom_policy = PasswordPolicy(
    min_length=10,
    min_uppercase=1,
    min_lowercase=1,
    min_digits=1,
    min_special=1,
    special_chars="!@#$%^&*",
    allow_spaces=True
)
is_valid, issues = custom_policy.check_password("Your Custom Password 1!")
if is_valid:
    print("Password meets all custom requirements")
else:
    print("Password issues:")
    for issue in issues:
        print(f"- {issue}")

# Get policy description
print(custom_policy.get_policy_description())

Development

To set up the development environment:

  1. Clone the repository
  2. Install Poetry if you haven't already: https://python-poetry.org/docs/#installation
  3. Run poetry install to install dependencies
  4. Run poetry run pytest to run tests

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

passvalidate-0.1.1.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

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

passvalidate-0.1.1-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file passvalidate-0.1.1.tar.gz.

File metadata

  • Download URL: passvalidate-0.1.1.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.2 Darwin/23.1.0

File hashes

Hashes for passvalidate-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8a02c8feca0aaae0cb38ad9ff50eb5b8bbed55483a2bd4d5112c647026ff8fc1
MD5 507ccc5b72568ffd471d9470ce632734
BLAKE2b-256 597e505331f8429e45662db61232e3395ea57206f0c3605fc6e1063c8b6db681

See more details on using hashes here.

File details

Details for the file passvalidate-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: passvalidate-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.2 Darwin/23.1.0

File hashes

Hashes for passvalidate-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 040a6687f19279d97fdb67e9b4a9b5700df8be420903383ffd8e673fcd6981a4
MD5 c1aa704476ad51cfd91fb3e759ec30ee
BLAKE2b-256 f3e6707b183f9f28445bafc3393f8ad5509dbdfcc581324f54fcb598b8d20631

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