Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

maskpw-0.5.5.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

maskpw-0.5.5-py2.py3-none-any.whl (3.3 kB view details)

Uploaded Python 2Python 3

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

Hashes for maskpw-0.5.5.tar.gz
Algorithm Hash digest
SHA256 20944afb1da5a2117363f0d814957d11c33846ac4a18682baca6f4b2de0d5e2b
MD5 44cae7b2732dcfdd621c5f7e2f218fce
BLAKE2b-256 db319e4aea7f4020cee0c1ecb6a91bbb2e59aa5ea85bc733d50086482e693a1a

See more details on using hashes here.

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

Hashes for maskpw-0.5.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 eb980173c96f837170a0cf757f3a31d7aaf0d6ebbfbac87c6b03adfc2f3eb42d
MD5 35c5180ed39a4966de3ff2b0f278ec6e
BLAKE2b-256 9e48f3a67314b48cbaf3ec50e848cf7fe5d892061720c8250b791fb5f5337552

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page