Skip to main content

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.

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)

Source distribution for prompts.py 0.1.1
File Size Uploaded
prompts_py-0.1.1.tar.gz 142.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for prompts.py 0.1.1
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page