Metadata-Version: 2.4
Name: textual-searchable-selectionlist
Version: 0.0.2
Summary: Add search to Textual SelectionList.
Author: Joao Coelho
Description-Content-Type: text/markdown
Classifier: License :: OSI Approved :: MIT License
Classifier: Framework :: Pytest
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: Development Status :: 4 - Beta
License-File: LICENSE.txt
Requires-Dist: textual
Project-URL: Home, https://github.com/joaonc/textual-searchable-selectionlist

# Searchable SelectionList
[![image](https://img.shields.io/pypi/v/textual-searchable-selectionlist.svg)](https://pypi.python.org/pypi/textual-searchable-selectionlist)
[![Project License - MIT](https://img.shields.io/pypi/l/textual-searchable-selectionlist.svg)](./LICENSE.txt)

Add search to Textual's [SelectionList](https://textual.textualize.io/widgets/selection_list/).

* Selectable items can be filtered by substring.
* Select one or multiple items.
* Search is case-insensitive.
* Title and description can be customized.

## Installation
```bash
pip install textual-searchable-selectionlist
```

## Usage
```python
from textual_searchable_selectionlist.options import SelectionStrategy
from textual_searchable_selectionlist.select import select, select_enum

selected = select(
    ['John', 'Jane', 'James'],
    selection_strategy=SelectionStrategy.MULTIPLE,
    search_title='Select people',
)

# Enums
# class Color(Enum):
#     RED = 'red'
#     GREEN = 'green'
#
# selected_colors = select_enum(Color, selection_strategy=SelectionStrategy.ONE)
```

## Testing
There are currently no automated tests. Manual testing can be done by running:
```bash
python tests/manual/searchable_selection_list_select.py
```

