Skip to content

Commit

Permalink
👌 IMPROVE: multipick->groupick
Browse files Browse the repository at this point in the history
  • Loading branch information
anafvana committed Sep 22, 2022
1 parent c49d33c commit 9443dfe
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
@@ -1,4 +1,4 @@
name: Multipick Tests
name: groupick Tests
on: [push, pull_request]
jobs:
ci:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -10,4 +10,4 @@ test:

.PHONY=clean
clean:
rm -fr build dist multipick.egg-info
rm -fr build dist groupick.egg-info
20 changes: 10 additions & 10 deletions README.md
@@ -1,27 +1,27 @@
# multipick
# groupick

[![image](https://github.com/anafvana/multipick/actions/workflows/ci.yml/badge.svg)](https://github.com/anafvana/multipick/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/multipick.svg)](https://pypi.org/project/multipick/)
[![PyPI](https://img.shields.io/pypi/dm/multipick)](https://pypi.org/project/multipick/)
[![image](https://github.com/anafvana/groupick/actions/workflows/ci.yml/badge.svg)](https://github.com/anafvana/groupick/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/groupick.svg)](https://pypi.org/project/groupick/)
[![PyPI](https://img.shields.io/pypi/dm/groupick)](https://pypi.org/project/groupick/)

**multipick** is a small python library based on [wong2's pick](https://github.com/wong2/pick) which allows you to create a curses-based interactive selection in the terminal. With **multipick** you can assign options to groups.
**groupick** is a small python library based on [wong2's pick](https://github.com/wong2/pick) which allows you to create a curses-based interactive selection in the terminal. With **groupick** you can assign options to groups.

![](example/basic.gif)

## Installation

$ pip install multipick
$ pip install groupick

## Usage

**multipick** comes with a simple api:
**groupick** comes with a simple api:

>>> from multipick import multipick
>>> 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 = multipick(options, groups, instructions, indicator="=>", default_index=2)
>>> selected = groupick(options, groups, instructions, indicator="=>", default_index=2)
>>> print(f"Here is your assignment: {selected}")

**output**:
Expand All @@ -41,4 +41,4 @@

[wong2's pick](https://github.com/wong2/pick): Original pick project, for selecting one or more options (no grouping)

[pickpack](https://github.com/anafvana/pickpack): A fork of `multipick` to select tree data.
[pickpack](https://github.com/anafvana/pickpack): A fork of `groupick` to select tree data.
4 changes: 2 additions & 2 deletions example/basic.py
@@ -1,7 +1,7 @@
from multipick import multipick
from groupick import groupick

title = "Assign languages to groups 'a', 'b' or '1'."
options = ["Java", "JavaScript", "Python", "PHP", "C++", "Erlang", "Haskell"]
groups:set = {"a", "b", 1}
selected = multipick(options, groups, title, indicator="=>", default_index=2)
selected = groupick(options, groups, title, indicator="=>", default_index=2)
print(f"Here is your assignment: {selected}")
4 changes: 2 additions & 2 deletions example/scroll.py
@@ -1,7 +1,7 @@
from multipick import multipick
from groupick import groupick

title = "Assign languages to groups 'a', 'b' or '1'."
options = ["foo.bar%s.baz" % x for x in range(1, 71)]
groups:set = {"a", "b", 1}
selected = multipick(options, groups, title)
selected = groupick(options, groups, title)
print(selected)
6 changes: 3 additions & 3 deletions pyproject.toml
@@ -1,12 +1,12 @@
[tool.poetry]
name = "multipick"
name = "groupick"
version = "1.0.0"
description = "Assign options to groups in the terminal with a simple GUI. Based on wong2's pick"
authors = ["Ana <anafvana@gmail.com>", "wong2 <wonderfuly@gmail.com>"]
license = "MIT"
readme = "README.md"
repository = "https://github.com/anafvana/multipick/"
homepage = "https://github.com/anafvana/multipick/"
repository = "https://github.com/anafvana/groupick/"
homepage = "https://github.com/anafvana/groupick/"
keywords = ["terminal", "gui","pick", "group", "assign"]

[tool.poetry.dependencies]
Expand Down
4 changes: 2 additions & 2 deletions src/multipick/__init__.py → src/groupick/__init__.py
Expand Up @@ -4,7 +4,7 @@
from typing import (Any, Dict, Generic, List, Optional, Sequence, Set, Tuple,
TypeVar)

__all__ = ["Picker", "multipick", "Option"]
__all__ = ["Picker", "groupick", "Option"]


@dataclass
Expand Down Expand Up @@ -189,7 +189,7 @@ def start(self):
return curses.wrapper(self._start)


def multipick(
def groupick(
options: Sequence[OPTION_T],
groups: Set[int|str],
instructions: Optional[str] = None,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/test_multipick.py
@@ -1,4 +1,4 @@
from multipick import Picker
from groupick import Picker

options = ["Java", "JavaScript", "Python", "PHP", "C++", "Erlang", "Haskell"]
groups:set = {"a", "b", 1}
Expand Down

0 comments on commit 9443dfe

Please sign in to comment.