CLSP

CLSP short for Command Line Selection Prompt, is a by fzf inspired, minimalistic, and fast to navigate single choice prompt.
from clsp import select
user_choice = select([1, 2, 3], info="Please pick a number:")
print("You selected:")
print(user_choice)

CLSP is designed to be user-friendly, minimal, and very easy to understand.
Due to it's search function, it supports large lists and spares the end-user unnecessary frustration.
It's especially useful if you'd like the user to choose between files, numbers, country codes, and much more.
Documentation
from clsp import select
user_choice = select(["Choose me!", "Dare to choose me!"])
You can provide additional key arguments for further configuration:
title | STR | Information shown above the prompt. |
prompt | STR | Text in front of user input. |
search | STR | Pre-insert text into the input prompt. |
current | INT | Index as the default selection. |
rows | INT | Amount of choices at a time. |
cutoff | FLOAT | Precision of search. (0 < x < 1). |
amount_results | INT | The maximum amount of search results to return. |
highlight_color | STR | Highlight color for search (black, red, green, yellow, blue, magenta, cyan, white). |
full_exit | BOOL | Exit completely or pass None on KeyBoardInterrupt or ESC. |
ignore_warnings | BOOL | Ignore warnings. |
print(f"Selected value: {user_choice.value}")
print(f"Index: {user_choice.index}")
if user_choice.search:
print(f"Search-Query: {user_choice.search}")
print(f"Search Result: {user_choice.search_result}")