Skip to main content

Random password generator

Project description

Random Password Generator

Python package to generate random passwords.

Usage

  • Install the package
pip install randompw-generator
  • Import the package
from rpg import RandomPassword
  • Create an instance of the RandomPassword and generate password
pw = RandomPassword()
pw.generate()

Configuration

The default length of the password is 15, it can be changed at the time of instantiation.

# It will generate a password of the length of 20
pw = RandomPassword(20)
pw.generate()

Length can also be increased by specifying the number of each type of character.

example :

pw = RandomPassword()

# Set the number of lowercase character to 10.
pw.set_lower(10)

# Set the number of lowercase character to 9.
pw.set_upper(9)

# Set the number of lowercase character to 3.
pw.set_digits(3)

# Set the number of lowercase character to 4.
pw.set_spchars(4)

# It'll generate a password contaning 10 lowercase
# 9 upppercase, 3 digits and 4 special characters.
pw.generate()

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

randompw-generator-1.0.2.tar.gz (2.5 kB view hashes)

Uploaded Source

Built Distribution

randompw_generator-1.0.2-py3-none-any.whl (3.4 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