Skip to main content

getpass alternative with masking and additional features

Project description

Maskpass

Maskpass is a Python library like getpass but with advanced features like masking and revealing

Installation

Use the package manager pip to install maskpass.

pip install maskpass

Usage

This module contains functions askpass() and special_askpass(), both having two optional arguments prompt and mask. The default value for prompt is Enter Password: and for mask is * For most cases, askpass() will do, but it doesn't work for Spyder IDLE. special_askpass() works for Spyder but it requires pynput to be installed.

import maskpass
password=maskpass.askpass()

Use mask="" for not echoing anything into the terminal. (Like entering sudo passwords in *nix)

The function returns the entered password in string format

For Spyder/QtConsole

import maskpass
password=maskpass.special_askpass()

special_askpass() also has a revealing feature which will toggle the visibility of the entered password when Left CTRL is pressed. Press it again to change back the visibility. Note: Only works with special_askpass() and in Spyder and needs pynput

Screenshots

Normal askpass Example GIF

Special askpass in Spyder Spyder Example GIF

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Issues

Currently I have only tested it in Windows 10, Manjaro and Parrot, so I'm not sure it works in macOS. The special_askpass() works in Spyder. It works in Jupyter Notebook but its not that nice, better to use getpass in Jupyter. Haven't tested it in PyCharm yet, so it might work.

License

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

maskpass-0.2.0.tar.gz (3.7 kB view hashes)

Uploaded Source

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