Metadata-Version: 2.4
Name: ltr-bert-sir-client
Version: 0.2.0
Summary: HTTP client for the ltr-bert-sir ELSIE API (s-m-quadri/ltr-bert-sir)
Project-URL: Homepage, https://huggingface.co/s-m-quadri/ltr-bert-sir
Project-URL: Repository, https://github.com/s-m-quadri/ltr-bert-sir-client-py
Project-URL: Documentation, https://huggingface.co/spaces/s-m-quadri/sir-elsie
Author: Syed Minnatullah Quadri
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: information-retrieval,ltr-bert,ltr-bert-sir,semantic-search,sir
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Provides-Extra: dev
Requires-Dist: pytest-httpx>=0.35; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Description-Content-Type: text/markdown

# ltr-bert-sir-client

Python client for the [ltr-bert-sir](https://huggingface.co/s-m-quadri/ltr-bert-sir) ELSIE API ([sir-elsie Space](https://huggingface.co/spaces/s-m-quadri/sir-elsie)).

## Install

```bash
pip install ltr-bert-sir-client
```

## Usage

```python
from ltr_bert_sir_client import SirClient

with SirClient() as sir:
    print(sir.health())
    hits = sir.search({"query": "alice rabbit hole", "mode": "blend", "k": 10})
    print(hits["hits"])
```

UI demo files:

```python
from ltr_bert_sir_client.ui import write_demo

write_demo("./demo", "http://127.0.0.1:8000")
```

Local API:

```python
SirClient("http://127.0.0.1:8000")
```

## Development

```bash
python3 -m venv .venv
.venv/bin/pip install -e ".[dev]"
.venv/bin/pytest -q
.venv/bin/python -m build
```

## Notebooks

See `notebooks/quickstart.py` and `notebooks/quickstart.ipynb`.

## Repository layout

```text
ltr-bert-sir-client-py/
├── .github/workflows/ci.yml
├── src/ltr_bert_sir_client/
│   ├── client.py
│   ├── types.py
│   ├── format.py
│   ├── hints.py
│   ├── collections.py
│   └── ui/
├── tests/test_client.py
├── notebooks/
├── pyproject.toml
└── LICENSE
```

## Publish

```bash
python -m build
twine upload dist/*
```

License: Apache-2.0
