Skip to main content

pick

image PyPI PyPI Python 3.8 - 3.14 support

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

Basic Multiselect

Installation

$ pip install pick

Optional: blessed backend

pick uses the curses backend by default. If you prefer using blessed, install the optional extra:

$ pip install "pick[blessed]"

Then pass backend="blessed" to 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.
  • backend: (optional), the rendering backend to use. Accepts "curses" (default), "blessed" (requires pip install pick[blessed]), or a custom Backend instance.

Community Projects

pickpack: A fork of pick to select tree data.

Metadata

Release files for pick 2.6.0

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

Source distribution (sdist)

Source distribution for pick 2.6.0
File Size Uploaded
pick-2.6.0.tar.gz 6.3 kB Details

Built distribution (wheel)

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

Total release size: 14.2 kB

Release files / pick-2.6.0.tar.gz

Download URL pick-2.6.0.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f24434a845ae9265ebf7657fc224b9a203ac75aa576b568e061484a72e27be82
BLAKE2b-256 checksum
How to use checksums
b6f9450cc44b21190d99b86df3e59f7573d85f3ef2c4f7670ce4f65cb2def3b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / pick-2.6.0-py3-none-any.whl

Download URL pick-2.6.0-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2acd5cad09be96398fba3b8be89454929de7b05362e01c69d94a05801820871f
BLAKE2b-256 checksum
How to use checksums
a593704982e09f3481d2055cf8ef7372445dc8ea6c883daf60f0816deb9e362c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release history Release notifications | RSS feed

This release

2.6.0 This release

2 release files

2.4.0

2 release files

2.3.2

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.6.7

2 release files

0.6.6

2 release files

0.6.5

3 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

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