Skip to main content

Advanced Prompts

Project description

aprompt

Advanced Prompts replace the built-in input() with colored and optimized prompts. Note that using aprompt inside an IDE will probably not work. Run your scripts from the terminal.

Features

Prompts

  • text
  • password
  • code
  • amount
  • select
  • multi-select
  • path (beta)
  • datetime
  • time

Other

  • custom formatter (not documented yet)
  • custom prompts (not documented yet)
  • detailed docs

Usage

import aprompt as ap

name = ap.prompt(
    "Please enter your name.",
    ap.prompts.text()
)

age = ap.prompt(
    "Please enter your age.",
    ap.prompts.amount(
        minimum = 0,
        maximum = 150,
    )
)

password = ap.prompt(
    "Please enter your password.",
    ap.prompts.text(hide = True)
)

language = ap.prompt(
    "What language do you prefer?",
    ap.prompts.select(
        "English",
        "Chinese",
        "French",
        "Japanese",
        "German",
    )
)

can_code_in = ap.prompt(
    "In what languages can you code in? (Choose 3 or more)",
    ap.prompts.select(
        "c",
        "c++",
        "c#",
        "python",
        "ruby",
        "javascript",
        "java",
        "pascal",
        "haskell",
        "rust",
        "go",
        "lua",
        "swift",
        "R",
        "bash",
        sort = True,
        multiple = True,
        require = lambda x: x >= 3,
    )
)

...

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

aprompt-1.0.0b2.tar.gz (8.7 kB view hashes)

Uploaded Source

Built Distribution

aprompt-1.0.0b2-py3-none-any.whl (8.9 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