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.

Metadata

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 Provenance Actions
prompts_py-0.1.1.tar.gz 142.2 kB Without provenance Details for prompts_py-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for prompts.py 0.1.1
File Interpreter ABI Platform Actions
prompts_py-0.1.1-py3-none-any.whl Python 3 none any Details for prompts_py-0.1.1-py3-none-any.whl

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

Security for prompts.py 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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