Skip to main content

A simple library for creating interactive selection menus in terminal applications.

Project description

select_options

select_options is a Python library for creating interactive selection menus in terminal applications. Designed for personal use, but open to proposals and contributions.

Overview

A simple library to make a beautiful appearance on the console to select one or various options.

Features

  • Interactive selection menus
  • Multiselect support
  • Customizable prompts
  • Adjustable columns (auto between 2-5, manual control planned)
  • Limit selection in multiselect menus
  • Future: color customization

Installation

Install via pip:

pip install select_options

Or install from source:

git clone https://github.com/Gerry1402/select.git
cd select
pip install .

Usage

For every type of iterable except dict, the menu shows the string representation of each item. If items are not stringifiable, use a dict where the key is the displayed content and the value is the result.

Example:

from select_options import Select
options = ["Option 1", "Option 2", "Option 3"]

selected = Select(options, prompt="Choose an option")

single = selected.run()
print(f"You selected: {single_selected}")

select.prompt = "Choose one or various options"
selected.multiselect = True

multi = selected.run()

Parameters

  • Title: Purpose of the selection, instructions shown below the table.
  • Multiselect: Allows multiple selections.
  • Limit: Restricts the number of selections in multiselect menus.
  • Columns: Auto-adjusts columns (2-5); manual control planned.

Compatibility

Tested on Windows 11. Compatibility with other OS/environments is not guaranteed.

Requirements

  • Python >= 3.7
  • textual

License

MIT License

Gerard Vello
Email: gerard.vello@gmail.com


Roadmap

  • Manual column control
  • Color customization

Screenshots

Base color selection This is the base color for Multi-select and Single-select.

Color of selected ones with current position over a selected This are the colors that appear on the Multi-select, the blue are the selected ones and the purple is the current position over a selected option.

Contributions, suggestions, and issues are welcome. Feel free to open a pull request or issue on GitHub.

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

select_options-1.1.0.tar.gz (52.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

select_options-1.1.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file select_options-1.1.0.tar.gz.

File metadata

  • Download URL: select_options-1.1.0.tar.gz
  • Upload date:
  • Size: 52.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for select_options-1.1.0.tar.gz
Algorithm Hash digest
SHA256 66b2908e7065d1328e04d6a2b19f1266859dcdd611d74a0fd9206ff411af5ebe
MD5 197dad816f4b7a96146036995ba101c1
BLAKE2b-256 0b5ae351810c17d868de4246198c52dca9257147fd42d08753bd83f616b74397

See more details on using hashes here.

File details

Details for the file select_options-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: select_options-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for select_options-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b15ff4ed27cb77c71058a9d47bc7d1718ccc37de11fd74971fe819c016d0f9fa
MD5 f49375093a50a8d20bafdb2e31739148
BLAKE2b-256 6eae527707e40dcefe54d025b34cc5bb9e03523b24e04fdbbd9988cf1d116d27

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page