Skip to main content

A cross-platform Python module that displays **** for password input. Works on Windows, unlike getpass. Formerly called stdiomask.

Project description

PWInput

A cross-platform Python module that displays **** for password input. Works on Windows, unlike getpass. Formerly called stdiomask.

Installation

To install with pip, run:

pip install pwinput

Quickstart Guide

The getpass.getpass() function in the Python Standard Library won't display "mask" characters as you type; it only displays nothing as you type. If you want mask characters to appear, you can use the pwinput.pwinput() function instead.

Typical usage:

>>> import pwinput
>>> pwinput.pwinput()  # Show * for each typed character.
Password: *********
'swordfish'
>>> pwinput.pwinput(prompt='PW: ')  # Show a custom prompt.
PW: *********
'swordfish'
>>> pwinput.pwinput(mask='X')  # Show a different character when user types.
Password: XXXXXXXXX
'swordfish'
>>> pwinput.pwinput(mask='') # Don't show anything when user types (falls back and calls getpass.getpass()).
Password:
'swordfish'

Contribute

If you'd like to contribute to pwinput, check out https://github.com/asweigart/pwinput

Support

If you find this project helpful and would like to support its development, consider donating to its creator on Patreon.

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

pwinput-1.0.2.tar.gz (4.5 kB view details)

Uploaded Source

File details

Details for the file pwinput-1.0.2.tar.gz.

File metadata

  • Download URL: pwinput-1.0.2.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.1

File hashes

Hashes for pwinput-1.0.2.tar.gz
Algorithm Hash digest
SHA256 03614712c487c54267ba02c8dde1405c15bbfb6e230fe6f1f366e2e94e344e25
MD5 f0850a86aa341a8618f2a0495f033612
BLAKE2b-256 e0c4f9c06bbd65739f8f962a0757a14e5cfdc4784a4c62c1994667d365bb3ec6

See more details on using hashes here.

Provenance

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