Assign options to groups in the terminal with a simple GUI. Based on wong2's pick
Project description
groupick
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 fromgroups
: a list of ints and/or characters symbolising groups (max-length per item is 1)instructions
: (optional) a title above options listindicator
: (optional) custom the selection indicator, defaults to*
default_index
: (optional) index of item where cursor starts at by defaulthandle_all
: (optional) define whether it is mandatory to assign all options to groups, defaults toFalse
screen
: (optional), if you are usinggroupick
within an existing curses application, pass your existingscreen
object. It is assumed this has initialised in the standard way (e.g. viacurses.wrapper()
, orcurses.noecho(); curses.cbreak(); screen.kepad(True)
)
Community Projects
wong2's pick: Original pick project, for selecting one or more options (no grouping)
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.tar.gz
(4.7 kB
view details)
Built Distribution
File details
Details for the file groupick-1.1.2.tar.gz
.
File metadata
- Download URL: groupick-1.1.2.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d781f2a2a74f6b95b41fe46032f019849d7a56b65af59fb0efd060f5500821f |
|
MD5 | fb09303e595b17100a835bffde54b378 |
|
BLAKE2b-256 | cf90bea0097d3a24d26b92fa1666b56a6831715caea8a6b680caa9060631173a |
File details
Details for the file groupick-1.1.2-py3-none-any.whl
.
File metadata
- Download URL: groupick-1.1.2-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b262019d75f12ef4789ff4033effeb7b63f649c302505dbb46de94a4bfd1a661 |
|
MD5 | 7ce8598559cf7ca27f028e77892fac5d |
|
BLAKE2b-256 | c2e3c5ca05c8f85390b8d1ff7cb85752c10fe1aed77f1788eda162e0ba5917dc |