Skip to main content

prmt

Description

Simple and robust command line prompts for most of the values. The formatting of the questions and prompts is completely customizable. This lib has no dependencies and no magic.

Features:

  • Prompt bool from user. (prmt.confirm)
  • Prompt string from user. (prmt.string)
  • Prompt string from user, opening an editor window. (prmt.string_from_editor)
  • Prompt integer from user. (prmt.integer)
  • Prompt list of strings from user. (prmt.list_of_str)
  • Prompt user to select an item from a list/dict of items. (prmt.select)

Optional features:

  • Set default values.
  • Customize formatting for each prompt.
  • Customize formatting for all prompts via the prmt.Prompt() class.
  • Open default Text Editor for the user to enter text.
  • Blacklist values. (If the user enters blacklisted values she will be prompted again)

Requirements

Python >=3.7

Install

pip install prmt

or

poetry install prmt

Examples

Look into the tests folder for code examples.

To see it in action on the command line, run:

pipenv run python make.py test

Development

git clone https://github.com/feluxe/prmt.git

cd prmt

pipenv install --dev --pre

pipenv run python make.py --help

Metadata

Release files for prmt 4.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

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

Release files / prmt-4.1.0-py3-none-any.whl

Download URL prmt-4.1.0-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
94b254a5ae59d07873e296166134a9a7491a1040ad4ce0e96cf73c16077e83b9
BLAKE2b-256 checksum
How to use checksums
b8c631ed90a7039ab97ac82d05234bc81bcf6509cf398266e47f5732744ca0c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5
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