Skip to content

SwezyDev/secure_input

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

standard (3)

PyPI Python Telegram
PyPI
Leave a ⭐ if you like this repository


🚩 What is secure_input?

secure_input is a tiny, dependency-free Python package that provides a secure, user-friendly way to prompt for sensitive input (like passwords) in terminal applications. It supports masking (e.g. *) and aims to be simple to use and easy to drop into any script.


🚀 Installation

Install from PyPI:

pip install secure-input

PyPI: https://pypi.org/project/secure-input/


🧩 Quick usage

from secure_input import secure_input

password = secure_input("Enter your Password: ", show="*")
print("You entered:", password)

secure_input(prompt: str, show: str) -> str

  • prompt: text shown to the user
  • show: masking character (e.g. "*")

📚 Features

  • Easy Usage
  • Optional masking character for input
  • Cross-platform terminals supported

⚠️ Notes & Limitations

  • Non-ASCII characters (e.g. Ö Ä Ü ß) may not be handled correctly — use plain ASCII letters, numbers and symbols for best results.
  • Always validate and handle the secret data securely in your application (do not print or log real passwords in production).

🧪 Examples

A short interactive example:

from secure_input import secure_input

api_key = secure_input("API Key: ", show="*")
if len(api_key) == 0:
    print("No key provided")
else:
    print("Key received (length):", len(api_key))

📦 Where to get help


📝 License

Distributed under the MIT License — see LICENSE for details.


👤 Maintainer & Contact


Made with ❤️ — If you find this useful, please leave a ⭐ on the repo

Star History Chart