Skip to main content

Pick an option in the terminal with a simple GUI

Project description

pick

image PyPI PyPI

pick is a small python library to help you create curses based interactive selection list in the terminal.

Basic Multiselect

Installation

$ pip install pick

Usage

pick comes with a simple api:

>>> from pick import pick

>>> title = 'Please choose your favorite programming language: '
>>> options = ['Java', 'JavaScript', 'Python', 'PHP', 'C++', 'Erlang', 'Haskell']
>>> option, index = pick(options, title)
>>> print(option)
>>> print(index)

outputs:

>>> C++
>>> 4

pick multiselect example:

>>> from pick import pick

>>> title = 'Please choose your favorite programming language (press SPACE to mark, ENTER to continue): '
>>> options = ['Java', 'JavaScript', 'Python', 'PHP', 'C++', 'Erlang', 'Haskell']
>>> selected = pick(options, title, multiselect=True, min_selection_count=1)
>>> print(selected)

outputs:

>>> [('Java', 0), ('C++', 4)]

Options

  • options: a list of options to choose from
  • title: (optional) a title above options list
  • indicator: (optional) custom the selection indicator, defaults to *
  • default_index: (optional) set this if the default selected option is not the first one
  • multiselect: (optional), if set to True its possible to select multiple items by hitting SPACE
  • min_selection_count: (optional) for multi select feature to dictate a minimum of selected items before continuing

Community Projects

pickpack: A fork of pick to select tree data.

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

pick-2.1.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

pick-2.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file pick-2.1.0.tar.gz.

File metadata

  • Download URL: pick-2.1.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.8 CPython/3.9.4 Darwin/22.2.0

File hashes

Hashes for pick-2.1.0.tar.gz
Algorithm Hash digest
SHA256 cac569ee2a04c8caea67e8598bfd861cc048b91cba47b68f00690fec84530867
MD5 135513cf6c916f1627c943fbd72aea8f
BLAKE2b-256 7949595ae3cd9bbe4bcd5d4e9c7dc2c16643e87dd3a31d875e36ede298741b6a

See more details on using hashes here.

File details

Details for the file pick-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: pick-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.8 CPython/3.9.4 Darwin/22.2.0

File hashes

Hashes for pick-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f29a62b0be691d816a7ae283c0d4c5c2bc60fd398d94f81ac0ff5ddf37a5eef7
MD5 399774a894c461e88b97ce11ad28fe20
BLAKE2b-256 e6403681af01dfea107e913b8d816e13fb73ba852158facf01a7438d3440512f

See more details on using hashes here.

Supported by

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