prompts.py 0.1.1

Creator: bradpython12

Last updated:

Add to Cart

Description:

prompts.py 0.1.1

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.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.