meilisearch-python-sdk 7.4.1__tar.gz → 7.5.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/.github/workflows/docs_publish.yml +1 -1
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/.github/workflows/nightly_testing.yml +1 -1
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/.github/workflows/prek_update.yml +1 -1
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/.github/workflows/pypi_publish.yml +1 -1
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/.github/workflows/testing.yml +7 -7
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/PKG-INFO +2 -7
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/README.md +0 -5
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/docker-compose.https.yml +1 -1
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/docker-compose.yml +1 -1
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/docs/async_client_api.md +2 -2
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/docs/client_api.md +2 -2
- meilisearch_python_sdk-7.5.1/docs/errors_api.md +9 -0
- meilisearch_python_sdk-7.5.1/docs/index.md +217 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/docs/json_handler.md +4 -0
- meilisearch_python_sdk-7.5.1/docs/models_client.md +22 -0
- meilisearch_python_sdk-7.5.1/docs/models_index.md +13 -0
- meilisearch_python_sdk-7.5.1/docs/models_search.md +10 -0
- meilisearch_python_sdk-7.5.1/docs/models_settings.md +10 -0
- meilisearch_python_sdk-7.5.1/docs/models_task.md +14 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/docs/plugins.md +4 -0
- meilisearch_python_sdk-7.5.1/meilisearch_python_sdk/_version.py +1 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/models/index.py +2 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/mkdocs.yaml +20 -1
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/prek.toml +3 -3
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/pyproject.toml +4 -4
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/tests/test_async_index.py +2 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/tests/test_index.py +2 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/uv.lock +312 -277
- meilisearch_python_sdk-7.4.1/docs/index.md +0 -30
- meilisearch_python_sdk-7.4.1/meilisearch_python_sdk/_version.py +0 -1
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/.github/FUNDING.yml +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/.github/release-draft-template.yaml +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/.github/renovate.json5 +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/.github/workflows/release-drafter.yml +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/.gitignore +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/CONTRIBUTING.md +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/LICENSE +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/assets/add_in_batches.png +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/assets/searches.png +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/codecov.yml +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/datasets/small_movies.json +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/docs/.nojekyll +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/docs/CNAME +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/docs/async_index_api.md +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/docs/css/custom.css +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/docs/decorators_api.md +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/docs/index_api.md +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/docs/js/umami.js +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/docs/overrides/partials/footer.html +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/docs/pydantic.md +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/examples/.gitignore +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/examples/README.md +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/examples/__init__.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/examples/add_documents_decorator.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/examples/add_documents_in_batches.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/examples/async_add_documents_decorator.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/examples/async_add_documents_in_batches.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/examples/async_documents_and_search_results.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/examples/async_search_tracker.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/examples/async_update_settings.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/examples/documents_and_search_results.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/examples/fastapi_example.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/examples/orjson_example.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/examples/pyproject.toml +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/examples/requirements.txt +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/examples/search_tracker.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/examples/tests/__init__.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/examples/tests/conftest.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/examples/tests/test_async_examples.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/examples/tests/test_examples.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/examples/update_settings.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/justfile +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/__init__.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/_batch.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/_client/__init__.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/_client/_async_client.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/_client/_base_client.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/_client/_client.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/_client/_common.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/_http_requests.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/_task.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/_utils.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/decorators.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/errors.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/index/__init__.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/index/_common.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/index/async_index.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/index/index.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/json_handler.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/models/__init__.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/models/batch.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/models/client.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/models/documents.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/models/health.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/models/search.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/models/settings.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/models/task.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/models/version.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/models/webhook.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/plugins.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/py.typed +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/types.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/tests/__init__.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/tests/conftest.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/tests/test_async_client.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/tests/test_async_documents.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/tests/test_async_index_plugins.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/tests/test_async_search.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/tests/test_client.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/tests/test_decorators.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/tests/test_documents.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/tests/test_errors.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/tests/test_http_requests.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/tests/test_index_plugins.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/tests/test_json_handler.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/tests/test_search.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/tests/test_settings_models.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/tests/test_utils.py +0 -0
- {meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/tests/test_version.py +0 -0
|
@@ -15,7 +15,7 @@ jobs:
|
|
|
15
15
|
- name: install Just
|
|
16
16
|
uses: taiki-e/install-action@just
|
|
17
17
|
- name: Install uv
|
|
18
|
-
uses: astral-sh/setup-uv@
|
|
18
|
+
uses: astral-sh/setup-uv@v10.0.1
|
|
19
19
|
with:
|
|
20
20
|
enable-cache: true
|
|
21
21
|
- name: Set up Python
|
|
@@ -31,7 +31,7 @@ jobs:
|
|
|
31
31
|
runs-on: ubuntu-latest
|
|
32
32
|
steps:
|
|
33
33
|
- uses: actions/checkout@v7
|
|
34
|
-
- uses: j178/prek-action@
|
|
34
|
+
- uses: j178/prek-action@v3.0.0
|
|
35
35
|
env:
|
|
36
36
|
PREK_SKIP: no-commit-to-branch,pyrefly-check
|
|
37
37
|
parallel-testing:
|
|
@@ -45,7 +45,7 @@ jobs:
|
|
|
45
45
|
- name: install Just
|
|
46
46
|
uses: taiki-e/install-action@just
|
|
47
47
|
- name: Install uv
|
|
48
|
-
uses: astral-sh/setup-uv@
|
|
48
|
+
uses: astral-sh/setup-uv@v10.0.1
|
|
49
49
|
with:
|
|
50
50
|
enable-cache: true
|
|
51
51
|
- name: Set up Python ${{ matrix.python-version }}
|
|
@@ -74,7 +74,7 @@ jobs:
|
|
|
74
74
|
- name: install Just
|
|
75
75
|
uses: taiki-e/install-action@just
|
|
76
76
|
- name: Install uv
|
|
77
|
-
uses: astral-sh/setup-uv@
|
|
77
|
+
uses: astral-sh/setup-uv@v10.0.1
|
|
78
78
|
with:
|
|
79
79
|
enable-cache: true
|
|
80
80
|
- name: Set up Python ${{ matrix.python-version }}
|
|
@@ -114,7 +114,7 @@ jobs:
|
|
|
114
114
|
- name: install Just
|
|
115
115
|
uses: taiki-e/install-action@just
|
|
116
116
|
- name: Install uv
|
|
117
|
-
uses: astral-sh/setup-uv@
|
|
117
|
+
uses: astral-sh/setup-uv@v10.0.1
|
|
118
118
|
with:
|
|
119
119
|
enable-cache: true
|
|
120
120
|
- name: Set up Python ${{ matrix.python-version }}
|
|
@@ -143,7 +143,7 @@ jobs:
|
|
|
143
143
|
- name: install Just
|
|
144
144
|
uses: taiki-e/install-action@just
|
|
145
145
|
- name: Install uv
|
|
146
|
-
uses: astral-sh/setup-uv@
|
|
146
|
+
uses: astral-sh/setup-uv@v10.0.1
|
|
147
147
|
with:
|
|
148
148
|
enable-cache: true
|
|
149
149
|
- name: Set up Python ${{ matrix.python-version }}
|
|
@@ -197,7 +197,7 @@ jobs:
|
|
|
197
197
|
- name: install Just
|
|
198
198
|
uses: taiki-e/install-action@just
|
|
199
199
|
- name: Install uv
|
|
200
|
-
uses: astral-sh/setup-uv@
|
|
200
|
+
uses: astral-sh/setup-uv@v10.0.1
|
|
201
201
|
with:
|
|
202
202
|
enable-cache: true
|
|
203
203
|
- name: Set up Python
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: meilisearch-python-sdk
|
|
3
|
-
Version: 7.
|
|
3
|
+
Version: 7.5.1
|
|
4
4
|
Summary: A Python client providing both async and sync support for the Meilisearch API
|
|
5
5
|
Project-URL: repository, https://github.com/sanders41/meilisearch-python-sdk
|
|
6
6
|
Project-URL: homepage, https://github.com/sanders41/meilisearch-python-sdk
|
|
@@ -265,11 +265,6 @@ This test compares how long it takes to complete 1000 searches (lower is better)
|
|
|
265
265
|
to be ~30% faster than the sync client for data ingestion. You can find a good write-up of the
|
|
266
266
|
results how he tested them in his [blog post](https://thedataquarry.com/posts/meilisearch-async/).
|
|
267
267
|
|
|
268
|
-
## Testing
|
|
269
|
-
|
|
270
|
-
[pytest-meilisearch](https://github.com/sanders41/pytest-meilisearch) is a pytest plugin that can
|
|
271
|
-
help with testing your code. It provides a lot of the boiler plate code you will need.
|
|
272
|
-
|
|
273
268
|
## Documentation
|
|
274
269
|
|
|
275
270
|
See our [docs](https://meilisearch-python-sdk.paulsanders.dev) for the full documentation.
|
|
@@ -213,11 +213,6 @@ This test compares how long it takes to complete 1000 searches (lower is better)
|
|
|
213
213
|
to be ~30% faster than the sync client for data ingestion. You can find a good write-up of the
|
|
214
214
|
results how he tested them in his [blog post](https://thedataquarry.com/posts/meilisearch-async/).
|
|
215
215
|
|
|
216
|
-
## Testing
|
|
217
|
-
|
|
218
|
-
[pytest-meilisearch](https://github.com/sanders41/pytest-meilisearch) is a pytest plugin that can
|
|
219
|
-
help with testing your code. It provides a lot of the boiler plate code you will need.
|
|
220
|
-
|
|
221
216
|
## Documentation
|
|
222
217
|
|
|
223
218
|
See our [docs](https://meilisearch-python-sdk.paulsanders.dev) for the full documentation.
|
|
@@ -6,7 +6,7 @@ This client runs in a context manager which ensures that everything is cleaned u
|
|
|
6
6
|
the client is done. To create a client:
|
|
7
7
|
|
|
8
8
|
```py
|
|
9
|
-
from
|
|
9
|
+
from meilisearch_python_sdk import AsyncClient
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
async with AsyncClient("http://localhost:7700", "masterKey") as client:
|
|
@@ -37,7 +37,7 @@ It is also possible to call the client without using a context manager, but in d
|
|
|
37
37
|
need to make sure to do the cleanup yourself:
|
|
38
38
|
|
|
39
39
|
```py
|
|
40
|
-
from
|
|
40
|
+
from meilisearch_python_sdk import AsyncClient
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
try:
|
|
@@ -6,7 +6,7 @@ This client runs in a context manager which ensures that everything is cleaned u
|
|
|
6
6
|
the client is done. To create a client:
|
|
7
7
|
|
|
8
8
|
```py
|
|
9
|
-
from
|
|
9
|
+
from meilisearch_python_sdk import Client
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
with Client("http://localhost:7700", "masterKey") as client:
|
|
@@ -37,7 +37,7 @@ It is also possible to call the client without using a context manager, but in d
|
|
|
37
37
|
need to make sure to do the cleanup yourself:
|
|
38
38
|
|
|
39
39
|
```py
|
|
40
|
-
from
|
|
40
|
+
from meilisearch_python_sdk import Client
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
try:
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
## Errors
|
|
2
|
+
|
|
3
|
+
These are the exceptions raised by the SDK. `MeilisearchApiError` is raised when Meilisearch
|
|
4
|
+
returns an error response, and `MeilisearchCommunicationError` is raised when Meilisearch cannot
|
|
5
|
+
be reached at all. The token errors are raised when generating or validating tenant tokens.
|
|
6
|
+
|
|
7
|
+
## Errors API
|
|
8
|
+
|
|
9
|
+
::: meilisearch_python_sdk.errors
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# Meilisearch Python SDK
|
|
2
|
+
|
|
3
|
+
Meilisearch Python SDK provides both an async and sync client for the
|
|
4
|
+
[Meilisearch](https://github.com/meilisearch/meilisearch) API.
|
|
5
|
+
|
|
6
|
+
The focus of this documentation is on the Meilisearch Python SDK API. More information of
|
|
7
|
+
Meilisearch itself and how to use it can be found at [https://www.meilisearch.com/docs](https://www.meilisearch.com/docs).
|
|
8
|
+
|
|
9
|
+
## Which client to chose
|
|
10
|
+
|
|
11
|
+
If the code base you are working with uses asyncio, for example if you are using
|
|
12
|
+
[FastAPI](https://fastapi.tiangolo.com/), chose the `AsyncClint` otherwise chose the `Client`.
|
|
13
|
+
The functionality of the two clients is the same, the difference being the `AsyncClient` provides
|
|
14
|
+
async methods and uses the `AsyncIndex`, which also provides async methods, while the `Client`
|
|
15
|
+
provides blocking methods and uses the `Index`, which also provides blocking methods.
|
|
16
|
+
|
|
17
|
+
## Instillation
|
|
18
|
+
|
|
19
|
+
Using a virtual environment is recommended for installing this package. Once the virtual
|
|
20
|
+
environment is created and activated, install the package with:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
pip install meilisearch-python-sdk
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Installing with the orjson extra will make JSON serilization/deserilization faster.
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
pip install meilisearch-python-sdk[orjson]
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Run Meilisearch
|
|
33
|
+
|
|
34
|
+
This package talks to a running Meilisearch server, so you will need one to connect to. There are
|
|
35
|
+
several ways to
|
|
36
|
+
[run Meilisearch](https://www.meilisearch.com/docs/learn/getting_started/installation), pick the
|
|
37
|
+
one that works best for your use case and then start the server. As an example, to use Docker:
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
docker pull getmeili/meilisearch:latest
|
|
41
|
+
docker run -it --rm -p 7700:7700 getmeili/meilisearch:latest ./meilisearch --master-key=masterKey
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Quickstart
|
|
45
|
+
|
|
46
|
+
The examples below add two documents to a `books` index and then search it. Note that
|
|
47
|
+
`client.index("books")` creates an index instance but does not make a network call, so with the
|
|
48
|
+
`AsyncClient` it does not need to be awaited.
|
|
49
|
+
|
|
50
|
+
### AsyncClient
|
|
51
|
+
|
|
52
|
+
```py
|
|
53
|
+
import asyncio
|
|
54
|
+
|
|
55
|
+
from meilisearch_python_sdk import AsyncClient
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
async def main() -> None:
|
|
59
|
+
async with AsyncClient("http://127.0.0.1:7700", "masterKey") as client:
|
|
60
|
+
index = client.index("books")
|
|
61
|
+
|
|
62
|
+
documents = [
|
|
63
|
+
{"id": 1, "title": "Ready Player One"},
|
|
64
|
+
{"id": 42, "title": "The Hitchhiker's Guide to the Galaxy"},
|
|
65
|
+
]
|
|
66
|
+
|
|
67
|
+
task = await index.add_documents(documents)
|
|
68
|
+
await client.wait_for_task(task.task_uid)
|
|
69
|
+
|
|
70
|
+
result = await index.search("ready player")
|
|
71
|
+
print(result.hits)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
asyncio.run(main())
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Client
|
|
78
|
+
|
|
79
|
+
```py
|
|
80
|
+
from meilisearch_python_sdk import Client
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
with Client("http://127.0.0.1:7700", "masterKey") as client:
|
|
84
|
+
index = client.index("books")
|
|
85
|
+
|
|
86
|
+
documents = [
|
|
87
|
+
{"id": 1, "title": "Ready Player One"},
|
|
88
|
+
{"id": 42, "title": "The Hitchhiker's Guide to the Galaxy"},
|
|
89
|
+
]
|
|
90
|
+
|
|
91
|
+
task = index.add_documents(documents)
|
|
92
|
+
client.wait_for_task(task.task_uid)
|
|
93
|
+
|
|
94
|
+
result = index.search("ready player")
|
|
95
|
+
print(result.hits)
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Waiting on tasks
|
|
99
|
+
|
|
100
|
+
Meilisearch processes writes asynchronously, so methods that modify data return a
|
|
101
|
+
[`TaskInfo`](models_task.md) instead of the result of the write. The `task_uid` on it can be used
|
|
102
|
+
to wait for the write to finish, or to check on its status later.
|
|
103
|
+
|
|
104
|
+
```py
|
|
105
|
+
task = index.add_documents([{"id": 1, "title": "Ready Player One"}])
|
|
106
|
+
result = client.wait_for_task(task.task_uid)
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
If you would rather check the status yourself instead of blocking, use `get_task`.
|
|
110
|
+
|
|
111
|
+
```py
|
|
112
|
+
task = index.add_documents([{"id": 1, "title": "Ready Player One"}])
|
|
113
|
+
status = client.get_task(task.task_uid)
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
The `AsyncClient` provides the same methods as awaitables.
|
|
117
|
+
|
|
118
|
+
## Search results
|
|
119
|
+
|
|
120
|
+
Searching returns a [`SearchResults`](models_search.md) object. The matching documents are in
|
|
121
|
+
`hits`, and the remaining fields describe the search that was run.
|
|
122
|
+
|
|
123
|
+
```py
|
|
124
|
+
SearchResults(
|
|
125
|
+
hits=[
|
|
126
|
+
{
|
|
127
|
+
"id": 1,
|
|
128
|
+
"title": "Ready Player One",
|
|
129
|
+
},
|
|
130
|
+
],
|
|
131
|
+
offset=0,
|
|
132
|
+
limit=20,
|
|
133
|
+
estimated_total_hits=1,
|
|
134
|
+
processing_time_ms=1,
|
|
135
|
+
query="ready player",
|
|
136
|
+
facet_distribution=None,
|
|
137
|
+
facet_stats=None,
|
|
138
|
+
total_pages=None,
|
|
139
|
+
total_hits=None,
|
|
140
|
+
page=None,
|
|
141
|
+
hits_per_page=None,
|
|
142
|
+
semantic_hit_count=None,
|
|
143
|
+
query_vector=None,
|
|
144
|
+
performance_details=None,
|
|
145
|
+
)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Custom search
|
|
149
|
+
|
|
150
|
+
`search` accepts the Meilisearch
|
|
151
|
+
[search parameters](https://www.meilisearch.com/docs/reference/api/search/search-with-post) as
|
|
152
|
+
keyword arguments. For example, to highlight the matching terms in the title and only return books
|
|
153
|
+
with an `id` above 10:
|
|
154
|
+
|
|
155
|
+
```py
|
|
156
|
+
index.search(
|
|
157
|
+
"guide",
|
|
158
|
+
attributes_to_highlight=["title"],
|
|
159
|
+
filter="id > 10",
|
|
160
|
+
)
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
The highlighted values are added to each hit in a `_formatted` key.
|
|
164
|
+
|
|
165
|
+
```py
|
|
166
|
+
SearchResults(
|
|
167
|
+
hits=[
|
|
168
|
+
{
|
|
169
|
+
"id": 42,
|
|
170
|
+
"title": "The Hitchhiker's Guide to the Galaxy",
|
|
171
|
+
"_formatted": {
|
|
172
|
+
"id": "42",
|
|
173
|
+
"title": "The Hitchhiker's <em>Guide</em> to the Galaxy",
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
],
|
|
177
|
+
offset=0,
|
|
178
|
+
limit=20,
|
|
179
|
+
estimated_total_hits=1,
|
|
180
|
+
processing_time_ms=5,
|
|
181
|
+
query="guide",
|
|
182
|
+
facet_distribution=None,
|
|
183
|
+
facet_stats=None,
|
|
184
|
+
total_pages=None,
|
|
185
|
+
total_hits=None,
|
|
186
|
+
page=None,
|
|
187
|
+
hits_per_page=None,
|
|
188
|
+
semantic_hit_count=None,
|
|
189
|
+
query_vector=None,
|
|
190
|
+
performance_details=None,
|
|
191
|
+
)
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Note that filtering only works on attributes that have been added to the index's filterable
|
|
195
|
+
attributes first, otherwise Meilisearch returns an error.
|
|
196
|
+
|
|
197
|
+
```py
|
|
198
|
+
task = index.update_filterable_attributes(["id"])
|
|
199
|
+
client.wait_for_task(task.task_uid)
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
See the [settings models](models_settings.md) for the rest of the settings that can be updated.
|
|
203
|
+
|
|
204
|
+
## Where to go next
|
|
205
|
+
|
|
206
|
+
- [AsyncClient](async_client_api.md) and [Client](client_api.md) for the server level methods,
|
|
207
|
+
such as managing indexes, API keys, and tasks.
|
|
208
|
+
- [AsyncIndex](async_index_api.md) and [Index](index_api.md) for the methods that work with
|
|
209
|
+
documents, searching, and index settings.
|
|
210
|
+
- [Search models](models_search.md), [settings models](models_settings.md),
|
|
211
|
+
[index models](models_index.md), [task models](models_task.md), and
|
|
212
|
+
[client models](models_client.md) for the objects the methods accept and return.
|
|
213
|
+
- [Errors](errors_api.md) for the exceptions the SDK raises.
|
|
214
|
+
- [Plugins](plugins.md) for extending the behavior of the index methods.
|
|
215
|
+
- [JSON Handler](json_handler.md) for controlling JSON serialization, including using orjson.
|
|
216
|
+
- [Pydantic](pydantic.md) for deserializing your documents into your own Pydantic models.
|
|
217
|
+
- [Decorators](decorators_api.md) for the helpers provided for working with Meilisearch.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
## Client Models
|
|
2
|
+
|
|
3
|
+
These are the models returned by, and passed to, the methods on the `AsyncClient` and `Client`
|
|
4
|
+
that work at the server level rather than on a single index. This covers API keys, the network
|
|
5
|
+
configuration used for remote federated search, webhooks, and the health and version information
|
|
6
|
+
for the server.
|
|
7
|
+
|
|
8
|
+
## Client Models API
|
|
9
|
+
|
|
10
|
+
::: meilisearch_python_sdk.models.client
|
|
11
|
+
|
|
12
|
+
## Webhook Models API
|
|
13
|
+
|
|
14
|
+
::: meilisearch_python_sdk.models.webhook
|
|
15
|
+
|
|
16
|
+
## Health Models API
|
|
17
|
+
|
|
18
|
+
::: meilisearch_python_sdk.models.health
|
|
19
|
+
|
|
20
|
+
## Version Models API
|
|
21
|
+
|
|
22
|
+
::: meilisearch_python_sdk.models.version
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
## Index Models
|
|
2
|
+
|
|
3
|
+
These are the models that describe indexes and the documents in them. `IndexInfo` and `IndexStats`
|
|
4
|
+
are returned by the index information methods, the `Field` models describe how an attribute is
|
|
5
|
+
configured, and `DocumentsInfo` is returned when getting multiple documents.
|
|
6
|
+
|
|
7
|
+
## Index Models API
|
|
8
|
+
|
|
9
|
+
::: meilisearch_python_sdk.models.index
|
|
10
|
+
|
|
11
|
+
## Document Models API
|
|
12
|
+
|
|
13
|
+
::: meilisearch_python_sdk.models.documents
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
## Search Models
|
|
2
|
+
|
|
3
|
+
These are the models used by the search methods. `search` returns a `SearchResults` object,
|
|
4
|
+
`facet_search` returns a `FacetSearchResults` object, and `search_similar_documents` returns a
|
|
5
|
+
`SimilarSearchResults` object. `Hybrid`, `Personalize`, and the `Federation` models are passed
|
|
6
|
+
into the search methods to control how the search is run.
|
|
7
|
+
|
|
8
|
+
## Search Models API
|
|
9
|
+
|
|
10
|
+
::: meilisearch_python_sdk.models.search
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
## Settings Models
|
|
2
|
+
|
|
3
|
+
These are the models used when getting and updating index settings. `MeilisearchSettings` holds
|
|
4
|
+
all of the settings for an index and is what `get_settings` returns and `update_settings` accepts.
|
|
5
|
+
The remaining models are the values used within it, for example the embedder models are used to
|
|
6
|
+
configure vector search.
|
|
7
|
+
|
|
8
|
+
## Settings Models API
|
|
9
|
+
|
|
10
|
+
::: meilisearch_python_sdk.models.settings
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
## Task Models
|
|
2
|
+
|
|
3
|
+
Meilisearch processes writes asynchronously, so methods that modify data return a `TaskInfo`
|
|
4
|
+
rather than the result of the write. The `task_uid` from that `TaskInfo` can be used to look up
|
|
5
|
+
a `TaskResult` to find out whether the write succeeded. Batches group the tasks Meilisearch
|
|
6
|
+
processed together.
|
|
7
|
+
|
|
8
|
+
## Task Models API
|
|
9
|
+
|
|
10
|
+
::: meilisearch_python_sdk.models.task
|
|
11
|
+
|
|
12
|
+
## Batch Models API
|
|
13
|
+
|
|
14
|
+
::: meilisearch_python_sdk.models.batch
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
VERSION = "7.5.1"
|
{meilisearch_python_sdk-7.4.1 → meilisearch_python_sdk-7.5.1}/meilisearch_python_sdk/models/index.py
RENAMED
|
@@ -24,6 +24,8 @@ class IndexStats(CamelBase):
|
|
|
24
24
|
is_indexing: bool
|
|
25
25
|
field_distribution: dict[str, int]
|
|
26
26
|
internal_database_sizes: JsonDict | None = None
|
|
27
|
+
index_size: int | str | None = None
|
|
28
|
+
used_index_size: int | str | None = None
|
|
27
29
|
|
|
28
30
|
|
|
29
31
|
class FieldsFilter(CamelBase):
|
|
@@ -35,12 +35,31 @@ nav:
|
|
|
35
35
|
- AsyncIndex: async_index_api.md
|
|
36
36
|
- Index: index_api.md
|
|
37
37
|
- Decorators: decorators_api.md
|
|
38
|
+
- Errors: errors_api.md
|
|
39
|
+
- Models:
|
|
40
|
+
- Search: models_search.md
|
|
41
|
+
- Settings: models_settings.md
|
|
42
|
+
- Index: models_index.md
|
|
43
|
+
- Tasks: models_task.md
|
|
44
|
+
- Client: models_client.md
|
|
38
45
|
- Plugins: plugins.md
|
|
39
46
|
- JSON Handler: json_handler.md
|
|
40
47
|
- Pydantic: pydantic.md
|
|
41
48
|
|
|
42
49
|
plugins:
|
|
43
|
-
- mkdocstrings
|
|
50
|
+
- mkdocstrings:
|
|
51
|
+
handlers:
|
|
52
|
+
python:
|
|
53
|
+
options:
|
|
54
|
+
show_if_no_docstring: true
|
|
55
|
+
show_bases: true
|
|
56
|
+
show_signature_annotations: true
|
|
57
|
+
separate_signature: true
|
|
58
|
+
docstring_section_style: list
|
|
59
|
+
members_order: source
|
|
60
|
+
show_root_heading: true
|
|
61
|
+
show_symbol_type_heading: true
|
|
62
|
+
show_symbol_type_toc: true
|
|
44
63
|
- search
|
|
45
64
|
|
|
46
65
|
extra_javascript:
|
|
@@ -21,7 +21,7 @@ hooks = [
|
|
|
21
21
|
|
|
22
22
|
[[repos]]
|
|
23
23
|
repo = "https://github.com/facebook/pyrefly-pre-commit"
|
|
24
|
-
rev = "1.
|
|
24
|
+
rev = "1.2.0"
|
|
25
25
|
hooks = [
|
|
26
26
|
{
|
|
27
27
|
id = "pyrefly-check",
|
|
@@ -34,7 +34,7 @@ hooks = [
|
|
|
34
34
|
|
|
35
35
|
[[repos]]
|
|
36
36
|
repo = "https://github.com/astral-sh/ruff-pre-commit"
|
|
37
|
-
rev = "v0.16.
|
|
37
|
+
rev = "v0.16.4"
|
|
38
38
|
hooks = [
|
|
39
39
|
{
|
|
40
40
|
id = "ruff-check",
|
|
@@ -47,7 +47,7 @@ hooks = [
|
|
|
47
47
|
|
|
48
48
|
[[repos]]
|
|
49
49
|
repo = "https://github.com/rvben/rumdl-pre-commit"
|
|
50
|
-
rev = "v0.2.
|
|
50
|
+
rev = "v0.2.60"
|
|
51
51
|
hooks = [
|
|
52
52
|
{ id = "rumdl-fmt" }
|
|
53
53
|
]
|
|
@@ -37,16 +37,16 @@ all = ["orjson"]
|
|
|
37
37
|
[dependency-groups]
|
|
38
38
|
dev = [
|
|
39
39
|
"mkdocstrings[python]==1.0.6",
|
|
40
|
-
"pyrefly==1.
|
|
40
|
+
"pyrefly==1.2.0",
|
|
41
41
|
"pytest==9.1.1",
|
|
42
42
|
"pytest-cov==7.1.0",
|
|
43
43
|
"pytest-asyncio==1.4.0",
|
|
44
44
|
"pytest-xdist==3.8.0",
|
|
45
|
-
"prek==0.4.
|
|
46
|
-
"ruff==0.16.
|
|
45
|
+
"prek==0.4.14",
|
|
46
|
+
"ruff==0.16.4",
|
|
47
47
|
"types-aiofiles==25.1.0.20260518",
|
|
48
48
|
"typing-extensions==4.16.0",
|
|
49
|
-
"zensical==0.0.
|
|
49
|
+
"zensical==0.0.57",
|
|
50
50
|
]
|
|
51
51
|
|
|
52
52
|
[tool.hatch.version]
|
|
@@ -119,6 +119,8 @@ async def test_get_stats(async_empty_index, small_movies):
|
|
|
119
119
|
|
|
120
120
|
assert response.number_of_documents == 30
|
|
121
121
|
assert response.internal_database_sizes is None
|
|
122
|
+
assert response.index_size is not None
|
|
123
|
+
assert response.used_index_size is not None
|
|
122
124
|
|
|
123
125
|
|
|
124
126
|
@pytest.mark.parametrize("size_format", (None, "raw", "human"))
|
|
@@ -111,6 +111,8 @@ def test_get_stats(empty_index, small_movies):
|
|
|
111
111
|
|
|
112
112
|
assert response.number_of_documents == 30
|
|
113
113
|
assert response.internal_database_sizes is None
|
|
114
|
+
assert response.index_size is not None
|
|
115
|
+
assert response.used_index_size is not None
|
|
114
116
|
|
|
115
117
|
|
|
116
118
|
@pytest.mark.parametrize("size_format", (None, "raw", "human"))
|