Metadata-Version: 2.1
Name: easyselect
Version: 22.1.0
Summary: simple and pretty tool for selecting items by keyboard in terminal
Project-URL: Homepage, https://github.com/gmankab/easyselect
Project-URL: Bug Tracker, https://github.com/gmankab/easyselect/issues
Project-URL: Documentation, https://github.com/gmankab/easyselect
Author-email: gmanka <gmankab@gmail.com>
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: rich
Requires-Dist: windows-curses; platform_system == 'Windows'
Description-Content-Type: text/markdown

# easyselect by gmanka

<img src="https://github.com/gmankab/easyselect/raw/main/img/transparent.png">

a useful library that allows the user to select between multiple items in the console using the keyboard. Supports very long lists that don't fit on the screen, [rich styles](https://rich.readthedocs.io/en/stable/style.html), control with buttons `up`, `down`, `left`, `right`, `wasd`, `j`, `h`, `home`, `end`, `page up`, `page down`

## navigation

- [installation](#installation)
- [usage](#usage)
- [print text while choosing](#print-text-while-choosing)
- [rich styles support](#rich-styles-support)
- [long items list support](#long-items-list-support)
- [page size](#page-size)
- [supported buttons](#supported-buttons)
- [license](#license)

### installation[^](#navigation)

```sh
pip install easyselect
```

### usage[^](#navigation)

```py
from easyselect import Sel

yes_or_no = Sel(
    items = [
        'yes',
        'no',
    ]
)

answer = yes_or_no.choose()
print(answer)
```

### print text while choosing[^](#navigation)

```py
yes_or_no = Sel(
    items = [
        'yes',
        'no',
    ],
    text = 'please select yes or no'
)
```

### rich styles support[^](#navigation)

linux only

```py
yes_or_no = Sel(
    items = [
        'yes',
        'no',
    ],
    styles = [
        'green',
        'red'
    ]
)
```

[rich styles documentation](https://rich.readthedocs.io/en/stable/style.html)

### very long items list support[^](#navigation)

```py
nums = Sel(
    items = list(range(50))
)
```

### page size[^](#navigation)

page_size arg allows to specify how much lines will be rendered on screen

default value is 15

```py
nums = Sel(
    items = list(range(50)),
    page_size = 3
)
```

### supported buttons[^](#navigation)

user will able to use these buttons

- up, down, left, right
- w, a, s, d, j, k
- home, end
- page up, page down

### license[^](#navigation)

[gnu gpl 3](https://gnu.org/licenses/gpl-3.0.en.html)
