aio-meilisearch-0.1.1
توضیحات
Async library for MeiliSearch
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | aio-meilisearch-0.1.1 |
| نام | aio-meilisearch |
| نسخه کتابخانه | 0.1.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | devtud |
| ایمیل نویسنده | devtud@gmail.com |
| آدرس صفحه اصلی | https://github.com/devtud/aio_meilisearch |
| آدرس اینترنتی | https://pypi.org/project/aio-meilisearch/ |
| مجوز | MIT |
[](https://github.com/devtud/aio_meilisearch/actions?workflow=Tests)


[](https://pypi.python.org/pypi/aio_meilisearch)
# AIO_MEILISEARCH
## Async Wrapper over Meilisearch REST API with type hints
```bash
pip install aio_meilisearch
```
## Usage
```python
from typing import TypedDict, List, Optional
import httpx
from aio_meilisearch import (
MeiliSearch,
MeiliConfig,
Index,
SearchResponse,
)
class MovieDict(TypedDict):
id: str
name: str
genres: List[str]
url: str
year: int
http = httpx.AsyncClient()
meilisearch = MeiliSearch(
meili_config=MeiliConfig(
base_url='http://localhost:7700',
private_key='PRIVATE_KEY',
public_key='PUBLIC_KEY',
),
http_client=http,
)
index: Index[MovieDict] = await meilisearch.create_index(name="movies", pk="id")
await index.update_settings(
{
"searchableAttributes": ["name", "genres"],
"displayedAttributes": [
"name",
"genres",
"id",
"url",
"year",
],
"attributesForFaceting": ["genres", "year"],
}
)
movie_list: List[MovieDict] = [
{
"name": "Oblivion",
"genres": ["action", "adventure", "sci-fi"],
"id": "tt1483013",
"url": "https://www.imdb.com/title/tt1483013/",
"year": 2013,
}
]
await index.documents.add_many(movie_list)
response: SearchResponse[MovieDict] = await index.documents.search(query="action")
```
## Contributing
**Prerequisites:**
- **poetry**
- **nox**
- **nox-poetry**
Install them on your system:
```bash
pip install poetry nox nox-poetry
```
Run tests:
```bash
nox
```
نیازمندی
| مقدار | نام |
|---|---|
| - | httpx |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.8,<4.0 | Python |
نحوه نصب
نصب پکیج whl aio-meilisearch-0.1.1:
pip install aio-meilisearch-0.1.1.whl
نصب پکیج tar.gz aio-meilisearch-0.1.1:
pip install aio-meilisearch-0.1.1.tar.gz