Skip to main content

Simple, colorful, multi-mode TUI that requires no boilerplate

Project description

Selecto

Selecto is a colorful, simple-to-use Text User Interface (TUI) library that requires just 1 line of code to get started. It's designed to make building beautiful and interactive CLI apps a breeze.

Features

  • Easy to use.
  • Colorful and interactive interface.
  • Requires only 1 line of code to run.
  • No external dependencies – everything you need is built-in.
  • Dual mode: Select one item or multiple items.
    • Single mode: Select a single item and return it.
    • Multiple mode: Select multiple items and return them as a list.

Installation

You can install Selecto via pip:

pip install selecto

Usage

To control selecto, arrow keys provide navigation: arrow up and down to move a single row arrow left and right to move multiple rows (number of rows configurable) return key to select item in single selection mode space key to toggle item and return key to confirm selections in multiple selection mode Q to exit

To start selecto in the single selection mode (default mode):

from selecto import selecto

choice=selecto(list(range(50)))

if choice is not None:
    print(choice)

To start selecto in multiple selection mode:

from selecto import selecto

choice=selecto(list(range(50)),select_multiple=True) # by default value set to False

if choice is not None:
    print(choice)

To change the number of rows left and right arrow keys jump:

from selecto import selecto

choice=selecto(list(range(50)),multi_index_jump=25) # default is 5

if choice is not None:
    print(choice)

Selecto has randomized messages on exit or errors, to disable them:

from selecto import selecto

choice=selecto(list(range(50)),exit_messages=False) # True by default, False replaces all messages with generic messages

if choice is not None:
    print(choice)

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

selecto-1.0.4.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

selecto-1.0.4-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file selecto-1.0.4.tar.gz.

File metadata

  • Download URL: selecto-1.0.4.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for selecto-1.0.4.tar.gz
Algorithm Hash digest
SHA256 0f804e672ce4a64eca002eb63ed7ef2a174a572b992558b9ddfb07c1526923cc
MD5 3c66bb4dfe8311b17e2444126a9a92e8
BLAKE2b-256 6a08ab1df1bf34432568b363bbb3ebf9a34eb3f9b1cb5ced1c1375f1e3dbf3f6

See more details on using hashes here.

File details

Details for the file selecto-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: selecto-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for selecto-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d0c60843f4a4080350af2b5c45fa1567df1a935c44285dadad2a503566911c01
MD5 5cd7feb36e96b0a0d854f3518af8a9c3
BLAKE2b-256 354b439d9d60493857b7f1bce559c55e151805f008031df7ef0932f2518a8db1

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