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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file prompts_py-0.1.1.tar.gz.

File metadata

  • Download URL: prompts_py-0.1.1.tar.gz
  • Upload date:
  • Size: 142.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.19

File hashes

Hashes for prompts_py-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9aa3325d707c76a32df007a67890e9e620a018c3a12a76e9c2f9ffca3e6cf857
MD5 dcdf23bdaa75377d6d63fcf9ca48a98e
BLAKE2b-256 4e4b89aaad88df47e95b83bb4e2344e9cc3df80fe171d3f3be5d0555216607e9

See more details on using hashes here.

File details

Details for the file prompts_py-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: prompts_py-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.19

File hashes

Hashes for prompts_py-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3c0567af8f1021fc115108b8bb77d533ef6a1524074c18cd69eafbe569d33ca0
MD5 46f53e8b4be24210326f75d19225eb4b
BLAKE2b-256 6f7e922a7ec438174f05259cb3d89efc2f6075321ed4239f3ab677cb58953b8d

See more details on using hashes here.

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