getpw

A better way to get passwords from users in python


Keywords
getpass, get, password, mask, mask-password, passwords
License
MIT
Install
pip install getpw==0.4

Documentation

getpw!

Python 3.7.1

A better way to get passwords from users in python

what getpw do for you?

  • a secure way to read passwords from users
  • check password strength and length
  • custom prompt and mask

install

You can either install from pypi or the source code

  1. Using pip
pip install getpw
  1. from the source code
git clone https://github.com/n0x1s/getpw
cd getpw
pip install -e .

How to use

Let us suppose you want to get a password or a secret token from the user without exposing him

>>> from getpw import getpw
>>> getpw()
> Enter Password: ***********

asciicast arguments that you can pass:

  • prompt : message that will be showen to the user -> default 'Enter Password: '
  • mask : char that will replace password chars -> default '*'
  • minlength : the minimum length -> default 1
  • minlength : the maximum length -> default 32
  • delay : delay in seconds -> default None
  • strong: check if password strong -> default False

Todo

I will try to maintain this respiratory and update or add new things to it you are welcome to contribute ☺️

And, as always have a beautiful day!