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
This is the base color for Multi-select and Single-select.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file select_options-1.1.1.tar.gz.
File metadata
- Download URL: select_options-1.1.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8e771504c051c2d05f330a06e0a0a0130f3c2a09dee61b702e4867d9a49cad2
|
|
| MD5 |
41ee398f8a9e4920f57ae69edcf33c14
|
|
| BLAKE2b-256 |
4db59b792d9e4bc37dc6e05f1a3e80ec5742f53a5d505c999974d59f51bcf7ce
|
File details
Details for the file select_options-1.1.1-py3-none-any.whl.
File metadata
- Download URL: select_options-1.1.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fc1d62b72627f785c696f136c1351c462ff1e1e6244b491f5fced8976511e67
|
|
| MD5 |
4bdebfb0268518221879692e62c37206
|
|
| BLAKE2b-256 |
e59089b539455ae26b93685c0604818defdb6170a1845063189e1383a6a4f5f6
|