Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aprompt

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aprompt

Advanced Prompts

  • 3.0.1
  • PyPI
  • Socket score

Maintainers
1

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

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

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc