Complex password generator
Project description
pypwdgen
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
Release history Release notifications | RSS feed
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)