Skip to main content

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
  • screen: (optional), if you are using pick within an existing curses application set this to your existing screen object. It is assumed this has initialised in the standard way (e.g. via curses.wrapper(), or curses.noecho(); curses.cbreak(); screen.kepad(True))
  • position: (optional), if you are using pick within an existing curses application use this to set the first position to write to. e.g., position=pick.Position(y=1, x=1)
  • quit_keys: (optional), if you want to quit early, you can pass a key codes. If the corresponding key are pressed, it will quit the menu.

Community Projects

pickpack: A fork of pick to select tree data.

Metadata

Release files for colorpick 2.4.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for colorpick 2.4.3
File Size Uploaded
colorpick-2.4.3.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for colorpick 2.4.3
File Interpreter ABI Platform
colorpick-2.4.3-py3-none-any.whl Python 3 none any Details

Total release size: 11.1 kB

Release files / colorpick-2.4.3.tar.gz

Download URL colorpick-2.4.3.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
def5450a3ae4db7510f2d01377bbb430304f82b5b7af0d8e9b89144f94f28fcf
BLAKE2b-256 checksum
How to use checksums
d94e7b0db4edb07b3ac93e7ebddd79eeefae0e830d02567d8e46b332784344c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.3 Windows/11

Release files / colorpick-2.4.3-py3-none-any.whl

Download URL colorpick-2.4.3-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
93873346b2833077b497ddcee7b03a6ff4271fc868f2aff5cf4cab432031d771
BLAKE2b-256 checksum
How to use checksums
b3b4b8daa318dfc4152970f73b40c6c1f46e82fa9e9618b0964b076847668170
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.3 Windows/11

Release history Release notifications | RSS feed

This release

2.4.3 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page