A simple library to ask the user for a password. Similar to getpass.getpass() but allows to specify a default mask (like '*' instead of blank).
Project description
Maskpw
A simple library to ask the user for a password. Similar to getpass.getpass() but allows to specify a default mask (like * instead of blank).
Features 🧰
- Customize prompt showed to the user.
- Use a custom mask to hide the password.
Installation 📦⬇
Use pip to install it.
python3 -m pip install maskpw
Usage 🛠
To use it, just import the get_password function and call it with a prompt ("Password: " by default):
from maskpw import get_password
if __name__ == "__main__":
username = input("Username: ")
password = get_password()
print(f"Username: {username}; Password: {password}")
This will show the following:
$ python test.py
Username: John Doe
Password: *****
Username: John Doe; Password: 12347
If you want to change the mask:
from maskpw import get_password
if __name__ == "__main__":
username = input("Username: ")
password = get_password(mask="#")
print(f"Username: {username}; Password: {password}")
Now it will look like:
$ python test.py
Username: John Doe
Password: #####
Username: John Doe; Password: 12347
Contributing ✍
Pull requests are welcome. For major changes, bug fixes or feature requests, please open an issue first to discuss what you would like to change.
License 📜⚖
This project uses the MIT license.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file maskpw-0.5.5.tar.gz.
File metadata
- Download URL: maskpw-0.5.5.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.26.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20944afb1da5a2117363f0d814957d11c33846ac4a18682baca6f4b2de0d5e2b
|
|
| MD5 |
44cae7b2732dcfdd621c5f7e2f218fce
|
|
| BLAKE2b-256 |
db319e4aea7f4020cee0c1ecb6a91bbb2e59aa5ea85bc733d50086482e693a1a
|
File details
Details for the file maskpw-0.5.5-py2.py3-none-any.whl.
File metadata
- Download URL: maskpw-0.5.5-py2.py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.26.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb980173c96f837170a0cf757f3a31d7aaf0d6ebbfbac87c6b03adfc2f3eb42d
|
|
| MD5 |
35c5180ed39a4966de3ff2b0f278ec6e
|
|
| BLAKE2b-256 |
9e48f3a67314b48cbaf3ec50e848cf7fe5d892061720c8250b791fb5f5337552
|