Skip to main content

aprompt - Advanced Prompt

Why use input() when you can go advanced?

aprompt lets you prompt users in a neat way. It comes with a UI system and everything is customizable!

Demonstration

Documentation Status Code style: black

Features

  • ✅ Large set of built-in prompts.
  • ✅ Custom prompts
  • ✅ Custom themes
  • ✅ Drop-in replacement for argparse
  • ✅ Test API

Available Prompts

While it is easily possible to create custom prompts, aprompt comes with a lot of useful prompts.

  • Text
  • Integer
  • Confirmation
  • PIN Code
  • Sort
  • Choice
  • Multiple Choice
  • Path
  • Datetime
  • Date
  • Time

Unchecked prompts are planned for the future

Basic Usage

from aprompt import prompt
from aprompt.prompts import choice

languages: list[str] = prompt(
    "In what languages can you code in?",
    choice(
        "c",
        "c++",
        "erlang",
        "fortran",
        "haskell",
        "javascript",
        "nim",
        "python",
        "ruby",
        "rust",
        "typescript",
        multiple=True
    )
)

# ... do something with `languages` ...

Test API

aprompt provides the attribute test_with for the main prompt wrapper to test the result for a predefined sequence of keys.

def test_n() -> None:
    assert not prompt("", confirm(), test_with=iter("n\n"))

Links

ToDo

  • add path prompt (as extension) and document it
  • turn matches to if-elses
  • add demo file and add a GIF of it to the README (instead of only the choice variant)
  • add GIFs to all prompt engines docs
  • turn simple formatter into a class
  • add logo

Metadata

Release files for aprompt 3.0.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 aprompt 3.0.1
File Size Uploaded
aprompt-3.0.1.tar.gz 76.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aprompt 3.0.1
File Interpreter ABI Platform
aprompt-3.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 89.6 kB

Release files / aprompt-3.0.1.tar.gz

Download URL aprompt-3.0.1.tar.gz
Size 76.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b891c25b6ca3c21c7ee3ba84edbfd4a0f35415f6349bfc4622ea2ab43688c281
BLAKE2b-256 checksum
How to use checksums
cd98ebd6ccfca5cbe9f42dfc6f331aa27cbe62b626c29b4f91f4b58072959a68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release files / aprompt-3.0.1-py3-none-any.whl

Download URL aprompt-3.0.1-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
08551a6be234b42c8587fad4ad49dd6cb02d835e4e3f284f07893645a9e81d9d
BLAKE2b-256 checksum
How to use checksums
da01539194585928d2165bd498d573b8724c227901467f44244cb652d0f983e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release history Release notifications | RSS feed

This release

3.0.1 This release

2 release files

3.0.0

2 release files

0.1.1

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