Skip to main content

Simple and custom random password generator for python

Project description

Random password Generator

PyPI version Build Status

A minimal and custom random password generator.

[NOTICE] API and WEB versions are now moved to https://github.com/suryasr007/rpg-web

Usage

  • Install the package.
  • Import the package.
  • Create an instance
  • Modify the default properties. (Optional)
  • Generate the password (Default length of password 6-16 unless specified via properties).
  pip install random-password-generator
  from password_generator import PasswordGenerator

  pwo = PasswordGenerator()
  pwo.generate()

Configuration

property Description Default
minlen Minimum length of the password 6
maxlen Maximum length of the password 16
minuchars Minimum upper case characters required in password 1
minlchars Minimum lower case characters required in password 1
minnumbers Minimum numbers required in password 1
minschars Minimum special characters in the password 1

Update V2.2.0

Application is now minimal(No dependencies). The API and WEB version are moved to https://github.com/suryasr007/rpg-web

Update V2.1.0

Application uses secrets module instead of random module on Python environments above 3.6.

Update V1.1.0

From version 1.1.0, Characters can be excluded from the required password by setting the properties on PasswordGenerator object

example:

  pwo = PasswordGenerator()

  pwo.excludeuchars = "ABCDEFTUVWXY" # (Optional)
  pwo.excludelchars = "abcdefghijkl" # (Optional)
  pwo.excludenumbers = "012345" # (Optional)
  pwo.excludeschars = "!$%^" # (Optional)

Generate a custom password

  pwo = PasswordGenerator()

  # All properties are optional
  pwo.minlen = 30 # (Optional)
  pwo.maxlen = 30 # (Optional)
  pwo.minuchars = 2 # (Optional)
  pwo.minlchars = 3 # (Optional)
  pwo.minnumbers = 1 # (Optional)
  pwo.minschars = 1 # (Optional)

  pwo.generate()

Generate a password from given characters

  pwo = PasswordGenerator()

  # It takes two arguments
  # required characters and length of required password
  pwo.shuffle_password('sdafasdf#@&^#&234u8', 20)

Generate Non Duplicate Password

  pwo = PasswordGenerator()

  # length of required password
  pwo.non_duplicate_password(20)

Contributions

Contributions are welcomed via PR.

License

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

random-password-generator-2.2.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file random-password-generator-2.2.0.tar.gz.

File metadata

  • Download URL: random-password-generator-2.2.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.3

File hashes

Hashes for random-password-generator-2.2.0.tar.gz
Algorithm Hash digest
SHA256 d8a8e2c0420fdd2c096bc7948f62701cb36761aea42e59c9a504d02f0e359d43
MD5 893568640471b7a9c4a57975bf16719f
BLAKE2b-256 d6aecef95522c149cdedbcccb2f3c9b16e72d56c8445268e88cd6ce1c648f5cb

See more details on using hashes here.

File details

Details for the file random_password_generator-2.2.0-py3-none-any.whl.

File metadata

  • Download URL: random_password_generator-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.3

File hashes

Hashes for random_password_generator-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 da9ce21a9b6a99dfda940596fe417a55470a2e0343fae56dea785f431780d8a9
MD5 ab8e6386796add5fb2c950a017481a3a
BLAKE2b-256 15f77dc48013751fd4e8b3ea034bd4f80028a157e0992e6b6a1b2d47423744c3

See more details on using hashes here.

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