NonePrompt
Prompt toolkit for console interaction.
Typing is fully supported. Async is also supported!
Installation
pip install noneprompt
Prompt Usage
Input
from noneprompt import InputPrompt
InputPrompt("What is your name?", validator=lambda string: True).prompt()
await InputPrompt("What is your name?", validator=lambda string: True).prompt_async()
Confirm
from noneprompt import ConfirmPrompt
ConfirmPrompt("Are you sure?", default_choice=False).prompt()
await ConfirmPrompt("Are you sure?", default_choice=False).prompt_async()
List
from noneprompt import ListPrompt, Choice
ListPrompt("What is your favorite color?", choices=[Choice("Red"), Choice("Blue")]).prompt()
await ListPrompt("What is your favorite color?", choices=[Choice("Red"), Choice("Blue")]).prompt_async()
Checkbox
from noneprompt import CheckboxPrompt, Choice
CheckboxPrompt("Choose your favorite colors", choices=[Choice("Red"), Choice("Blue")]).prompt()
await CheckboxPrompt("Choose your favorite colors", choices=[Choice("Red"), Choice("Blue")]).prompt_async()
Choice Data
You can add data to choices. Result type can be inferred from the data type.
from noneprompt import ListPrompt, Choice
result: Choice[str] = ListPrompt(
"What is your favorite color?",
choices=[
Choice("Red", data="#FF0000"),
Choice("Blue", data="#0000FF"),
],
).prompt()
print(result.data)
Defaults and Cancellation
from noneprompt import InputPrompt
result = InputPrompt("Press Ctrl-C to cancel.").prompt(default="Cancelled")
assert result == "Cancelled"
from noneprompt import InputPrompt, CancelledError
try:
InputPrompt("Press Ctrl-C to cancel.").prompt()
except CancelledError:
# Do something
pass
Style Guide
See the docstring of prompt classes for more information.
from noneprompt import InputPrompt
from prompt_toolkit.styles import Style
InputPrompt("What is your name?").prompt(style=Style([("input": "#ffffff"), ("answer": "bold")]))
Disable ansi colors:
from noneprompt import InputPrompt
InputPrompt("What is your name?").prompt(no_ansi=True)
Try from command line
noneprompt -h
Metadata
Release files for noneprompt 0.1.11
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 |
|---|---|---|---|---|
| noneprompt-0.1.11.tar.gz | 9.3 kB | Without provenance | Details for noneprompt-0.1.11.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| noneprompt-0.1.11-py3-none-any.whl | Python 3 | none | any | Details for noneprompt-0.1.11-py3-none-any.whl |
Total release size: 26.9 kB
Release files / noneprompt-0.1.11.tar.gz
| Download URL | noneprompt-0.1.11.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
68226918f2a1543aa380caada5c380ae5ca38f57292278c5bfd3b7289f1ac6db
|
|
BLAKE2b-256 checksum How to use checksums |
f4bedf8efafed7989d60c0d0d87559e65cdc40a6321186e13955cb85f289cd09
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / noneprompt-0.1.11-py3-none-any.whl
| Download URL | noneprompt-0.1.11-py3-none-any.whl |
|---|---|
| Size | 17.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e3d83e7cf57f645a35c6b8eaf918baefe077c41b761bb6326e8e6adb4f73150e
|
|
BLAKE2b-256 checksum How to use checksums |
7cac0c16167b09d35851235e2703cca1b860a150122f1d698bc2367309bd5d9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for noneprompt 0.1.11
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.