rich-inquirer
Interactive CLI prompts using Rich and readchar, inspired by python-inquirer.
Features
- Text input with password masking
- Select and fuzzy select prompts
- Confirmation prompts
- Prompt chaining with
PromptContext Esccancellation returningNone
Install
pip install rich-inquirer
Usage
from rich_inquirer.prompt import TextPrompt, SelectPrompt, ConfirmPrompt, FuzzyPrompt
name = TextPrompt("What's your name?").ask()
language = SelectPrompt("Choose a language:", ["Python", "Go", "Rust"]).ask()
confirmed = ConfirmPrompt("Continue?", default=True).ask()
match = FuzzyPrompt("Search language:", ["Python", "TypeScript", "Rust"]).ask()
The prompt classes are also available from the top-level package:
from rich_inquirer import TextPrompt
Use Choice when the displayed label should differ from the returned value.
from rich_inquirer.base import Choice
from rich_inquirer.prompt import SelectPrompt
choice = SelectPrompt(
"Choose a language:",
[
Choice("py", name="Python"),
Choice("rs", name="Rust"),
],
).ask()
PromptContext
from rich_inquirer.context import PromptContext
from rich_inquirer.prompt import TextPrompt, SelectPrompt, ConfirmPrompt
context = PromptContext()
context.add("name", TextPrompt("Enter your name:"))
context.add("language", SelectPrompt("Choose language:", ["Python", "Go", "Rust"]))
context.add("confirm", ConfirmPrompt("Continue?", default=True))
results = context.run()
print(results)
If a prompt is cancelled with Esc, PromptContext.run() stops and returns the results collected so far.
Development
pip install -e ".[dev]"
pytest
Metadata
Release files for rich-inquirer 0.1.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rich_inquirer-0.1.10.tar.gz | 9.9 kB | Without provenance | Details for rich_inquirer-0.1.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rich_inquirer-0.1.10-py3-none-any.whl | Python 3 | none | any | Details for rich_inquirer-0.1.10-py3-none-any.whl |
Total release size: 19.9 kB
Release files / rich_inquirer-0.1.10.tar.gz
| Download URL | rich_inquirer-0.1.10.tar.gz |
|---|---|
| Size | 9.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3ded128f2f38f1f71d14455fd58a954c317bed512a6904d2e8281c26246bbcf3
|
|
BLAKE2b-256 checksum How to use checksums |
dea55f3445234489fc9bdf87c640ffa0c2686f040100db12fd0e664e74d76af8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Release files / rich_inquirer-0.1.10-py3-none-any.whl
| Download URL | rich_inquirer-0.1.10-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bbb52d109d5a54c7b556518e29cc8008dfb41b9c4877bd0ec486ffb9da11e29d
|
|
BLAKE2b-256 checksum How to use checksums |
b4fec42b4e5db9c087ac06c9fd61fe859449e38d6b4489fc23a9a1b0681de249
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Security for rich-inquirer 0.1.10
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.