mukimov
Tiny cross-platform Python library: password prompt that shows * for each typed character — like getpass(), but with visual feedback.
from mukimov import stars
password = stars("Password: ")
print(password)
Terminal:
Password: ********
password contains the real text ("12345678"), only * are shown on screen.
Features
- Only standard library, zero dependencies
- Windows (
msvcrt) + Linux/macOS (termios/tty) - Each character is immediately replaced with
* - Backspace correctly deletes the last
* - Enter finishes input
- Real password is never printed
- Ctrl+C →
KeyboardInterrupt, Ctrl+D on empty input →EOFError - Falls back to
getpass(no echo) when stdin is not a TTY (pipes, IDE, CI)
Install
pip install .
For development:
pip install -e .[test] # or: pip install -e . && pip install pytest
pytest -q
Usage
from mukimov import stars
username = input("Username: ")
password = stars("Password: ")
print(username)
Username: mukimov
Password: ********
Custom mask character:
password = stars("Password: ", mask="#")
More examples — each typed character is echoed with your symbol, but the returned value is always the real password:
from mukimov import stars
password = stars("Password: ") # input 12345 -> shows: Password: *****
password = stars("Password: ", "/") # input 12345 -> shows: Password: /////
password = stars("Secret: ", "#") # input hello -> shows: Secret: #####
password = stars("Password: ", "•") # unicode masks work too
mask must be exactly one character, otherwise ValueError is raised:
stars("Password: ", "") # ValueError: Параметр mask='' пустой...
stars("Password: ", "/*") # ValueError: Параметр mask='/*' содержит 2 символа...
Ошибки
Сообщения об ошибках — на русском. В них указано: какой параметр неверный,
что передано (через repr()), почему это неправильно, что ожидалось и пример
правильного вызова. Введённый пароль никогда не попадает в сообщения об ошибках.
Неправильно → ошибка → правильно:
stars("Password: ", "")
# ValueError: Параметр mask='' пустой. Укажите ровно 1 символ для маскировки.
# Пример: stars("Password: ", "*")
stars("Password: ", "*") # правильно
stars("Password: ", "//")
# ValueError: Параметр mask='//' содержит 2 символа. Допускается только 1 символ.
# Пример: stars("Password: ", "*")
stars("Password: ", "/") # правильно
stars("Password: ", "hello")
# ValueError: Параметр mask='hello' содержит 5 символов. Допускается только 1 символ.
# Пример: stars("Password: ", "*")
stars("Password: ", "*") # правильно
stars("Password: ", 123)
# TypeError: Параметр mask должен быть строкой (str), но получен int: 123.
# Пример: stars("Password: ", "*")
stars("Password: ", "#") # правильно
stars(123)
# TypeError: Параметр prompt должен быть строкой (str), но получен int: 123.
# Пример: stars("Password: ")
stars("Password: ") # правильно
Build & publish to PyPI
python -m pip install --upgrade build twine
python -m build
python -m twine check dist/*
python -m twine upload dist/*
Test PyPI first:
python -m twine upload --repository testpypi dist/*
pip install --index-url https://test.pypi.org/simple/ mukimov
License
MIT
Developed by Mukimov Studio.
Release files for mukimov 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mukimov-0.1.2.tar.gz | 8.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mukimov-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.5 kB
Release files / mukimov-0.1.2.tar.gz
| Download URL | mukimov-0.1.2.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
660c3c916aabcd25db372efc77c99d802be52dc838fc8bf1a23f3d509efa9ebe
|
|
BLAKE2b-256 checksum How to use checksums |
1385c70d57892dea075a10740dc0fa19362f48387dc2594115e790d5d3d6ae4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / mukimov-0.1.2-py3-none-any.whl
| Download URL | mukimov-0.1.2-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
969d304946abea66421b1f45461436044d357f6f5f470ebdbbb3177d11401f93
|
|
BLAKE2b-256 checksum How to use checksums |
024f8c150f643c2aea781c21f3a5f0e479bd14daf1a1d20fc8d636c72226a4da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|