Skip to main content

Complex password generator

Project description

pypwdgen

GitHub Workflow Status (branch) PyPI PyPI - Python Version

Complex pasword generator

Prerequisites

Python 3.6 minimum is required to use the secrets module (which is recomended instead of the random module to manipulate sensitive data).

Installation

pip install pypwdgen

Using the cli

python3 -m pypwdgen 

Optional arguments

-l, --length:
    Length of the password (default: 9)
-n, --number:
    Number of passwords to generate (default: 1)
-c, --complexity:
    Minimum number of character classes to use (default: 3)

Example

# generates 20 passwords of 10 characters
python3 -m pypwdgen -l 10 -n 20

Using in a script

You can easily use pypwdgen to generate password inside your scripts.

Get only the password itself

from pypwdgen.core import Password

passwd_string = str(Password(20, 4))  # Please note the usage of str()

# Print password
print(f"My password is: {passwd_string}")

Get a Password object and use its properties

from pypwdgen.core import Password

passwd_object = Password(20, 4)

# Print password complexity score from object attribute
print(f"My password complexity score is: {passwd_object.complexity}")

# Print password string from object attribute
print(f"My password is: {passwd_object.password}")

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

pypwdgen-1.0.4.tar.gz (6.1 kB view hashes)

Uploaded Source

Built Distribution

pypwdgen-1.0.4-py3-none-any.whl (6.5 kB view hashes)

Uploaded Python 3

Supported by

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