Skip to main content

Beautiful prompts for Python.

Project description

prompts.py

Beautiful prompts for Python.

PyPI - Version PyPI - Python Version

Inspired by the prompts package on NPM. This project was written specifically for view.py


Example

Alt Text

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prompts_py-0.1.1.tar.gz (142.2 kB view hashes)

Uploaded Source

Built Distribution

prompts_py-0.1.1-py3-none-any.whl (9.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page