prompts.py
Beautiful prompts for Python.
Inspired by the prompts package on NPM. This project was written specifically for view.py
Example
from prompts import ask, ValidatorResult
def validate(name: str) -> ValidatorResult:
if name == "andrew":
return "You're not allowed here, buddy!"
return True
ask("What's your name?", validate=validate)
Features
- Fully typed
- Extendable
- Drop-in support for Click
Click Example
from prompts.integration import PrettyOption
import click
@click.command()
@click.option(
"--name",
default="Peter",
prompt=True,
cls=PrettyOption, # Enable prompts.py inputs!
)
def main(name: str):
...
if __name__ == "__main__":
main()
Installation
$ pip install prompts.py
License
prompts.py is distributed under the terms of the MIT license.
Release files for prompts.py 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| prompts_py-0.1.1.tar.gz | 142.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| prompts_py-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 151.6 kB
Release files / prompts_py-0.1.1.tar.gz
| Download URL | prompts_py-0.1.1.tar.gz |
|---|---|
| Size | 142.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9aa3325d707c76a32df007a67890e9e620a018c3a12a76e9c2f9ffca3e6cf857
|
|
BLAKE2b-256 checksum How to use checksums |
4e4b89aaad88df47e95b83bb4e2344e9cc3df80fe171d3f3be5d0555216607e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.9.19
|
Release files / prompts_py-0.1.1-py3-none-any.whl
| Download URL | prompts_py-0.1.1-py3-none-any.whl |
|---|---|
| Size | 9.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3c0567af8f1021fc115108b8bb77d533ef6a1524074c18cd69eafbe569d33ca0
|
|
BLAKE2b-256 checksum How to use checksums |
6f7e922a7ec438174f05259cb3d89efc2f6075321ed4239f3ab677cb58953b8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.9.19
|