Skip to main content

Assign options to groups in the terminal with a simple GUI. Based on wong2's pick

Project description

groupick

image PyPI PyPI

groupick is a small python library based on wong2's pick which allows you to create a curses-based interactive selection in the terminal. With groupick you can assign options to groups.

Installation

$ pip install groupick

Usage

groupick comes with a simple api:

>>> from groupick import groupick

>>> instructions = "Assign languages to groups 'a', 'b' or '1'."
>>> options = ["Java", "JavaScript", "Python", "PHP", "C++", "Erlang", "Haskell"]
>>> groups:set = {"a", "b", 1}
>>> selected = groupick(options, groups, instructions, indicator="=>", default_index=2)
>>> print(f"Here is your assignment: {selected}")

output:

>>> {'1': [], 'a': [("JavaScript", 1)], 'b': []}

Options

  • options: a list of options to choose from
  • groups: a list of ints and/or characters symbolising groups (max-length per item is 1)
  • instructions: (optional) a title above options list
  • indicator: (optional) custom the selection indicator, defaults to *
  • default_index: (optional) index of item where cursor starts at by default
  • handle_all: (optional) define whether it is mandatory to assign all options to groups, defaults to False
  • screen: (optional), if you are using groupick within an existing curses application, pass 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))

Community Projects

wong2's pick: Original pick project, for selecting one or more options (no grouping)

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

groupick-1.1.2.post1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

groupick-1.1.2.post1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file groupick-1.1.2.post1.tar.gz.

File metadata

  • Download URL: groupick-1.1.2.post1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for groupick-1.1.2.post1.tar.gz
Algorithm Hash digest
SHA256 6a01e3b3f5dba8770961d6c00cf55ccc83e1e9ea1c9fe35e2bf299437b0d5091
MD5 f2d95d581fb54aadd1242b6db6ca347b
BLAKE2b-256 ee2bc6202532955e111ef94c7debf28c0611d2924e4bb0e8ddb6b3ccd8b275c5

See more details on using hashes here.

File details

Details for the file groupick-1.1.2.post1-py3-none-any.whl.

File metadata

  • Download URL: groupick-1.1.2.post1-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for groupick-1.1.2.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 b3fbadd5685e03b19820d5fd8dbd6f5ef48a0dd1a957c4a0961b9a32ac69ddbf
MD5 130923fc526be654435d5318a8785069
BLAKE2b-256 fd68e8b9aeeaa482fa9c9224accb7e20d5a6220e64b69a750d6305aecd710c53

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