Skip to main content

getpass alternative with masking, Spyder support and additional features

Project description

Maskpass

Maskpass is a Python library like getpass but with advanced features like masking and reveal/unreveal.
It also works in Spyder IDLE

Installation

Use the package manager pip to install maskpass.

pip install maskpass

Usage

This module contains functions askpass() and advpass()
askpass() uses msvcrt.getch() in windows and altenatives in *nix OS, but it doesn't work in Spyder.

import maskpass
password=maskpass.askpass()

The function returns the entered password in string format
Accepts 2 optional arguments prompt and mask. Default for prompt is Enter password: . Default for mask is *.
Use mask="" for not echoing anything into the terminal. (Like entering sudo passwords in *nix)

Using advpass()

advpass() uses pynput to get the password, and it works in Spyder too!

import maskpass
password=maskpass.advpass()

The function returns the entered password in string format.
Accepts 3 optional arguments prompt, mask and idle. Default for prompt is Enter password: . Default for mask is *.

idle expects a bool, it is for overriding IDLE check, and has default False. Usually there is no need to change this, since it's automatically checked whether it's running on IDLE or terminal.

advpass() 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 advpass() and needs pynput

Screenshots

Example GIF

Normal askpass

Spyder Example GIF

advpass in Spyder

Terminal Example GIF

advpass in terminal

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 advpass() works well in Spyder, Windows cmd/powershell/terminal and Linux terminal. 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.3.3.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

maskpass-0.3.3-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file maskpass-0.3.3.tar.gz.

File metadata

  • Download URL: maskpass-0.3.3.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1

File hashes

Hashes for maskpass-0.3.3.tar.gz
Algorithm Hash digest
SHA256 b25cef9e9d2efa7aa73bee6ee732fc706f6d4ab48c5891f04e8249841d5ade8a
MD5 d004b05c0fedaebf31abfd6f263bfc0b
BLAKE2b-256 ecc5b80d160acf11766f10e1114d1d4d86926a49f7df98b5e41682d53c6ec1ba

See more details on using hashes here.

File details

Details for the file maskpass-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: maskpass-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1

File hashes

Hashes for maskpass-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 86959abf7dbcecf29a56a02002f7a8c3693b45c920d2344953bac6acea455d82
MD5 127cefd74fb2baa4afe31511bdbfc164
BLAKE2b-256 2440a24f2644fea69ea8b5664722e0a60a022a487441d4d9f5f073200c617178

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