meilisearch-python-sdk 3.3.0__tar.gz → 3.5.0__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.
Potentially problematic release.
This version of meilisearch-python-sdk might be problematic. Click here for more details.
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/.github/workflows/nightly_testing.yml +5 -2
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/.github/workflows/pypi_publish.yaml +3 -1
- meilisearch_python_sdk-3.5.0/.github/workflows/testing.yaml +260 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/.gitignore +2 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/.pre-commit-config.yaml +2 -2
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/CONTRIBUTING.md +1 -1
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/PKG-INFO +2 -2
- meilisearch_python_sdk-3.5.0/codecov.yml +6 -0
- meilisearch_python_sdk-3.5.0/docker-compose.https.yml +12 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/examples/add_documents_in_batches.py +2 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/examples/async_add_documents_decorator.py +5 -2
- meilisearch_python_sdk-3.5.0/examples/async_add_documents_in_batches.py +34 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/examples/async_documents_and_search_results.py +2 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/examples/async_search_tracker.py +21 -6
- meilisearch_python_sdk-3.5.0/examples/async_update_settings.py +43 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/examples/documents_and_search_results.py +2 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/examples/orjson_example.py +11 -2
- meilisearch_python_sdk-3.5.0/examples/pyproject.toml +4 -0
- meilisearch_python_sdk-3.5.0/examples/requirements.txt +4 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/examples/search_tracker.py +22 -7
- meilisearch_python_sdk-3.5.0/examples/tests/conftest.py +56 -0
- meilisearch_python_sdk-3.5.0/examples/tests/test_async_examples.py +53 -0
- meilisearch_python_sdk-3.5.0/examples/tests/test_examples.py +47 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/examples/ujson_example.py +11 -2
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/examples/update_settings.py +20 -10
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/justfile +34 -2
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/meilisearch_python_sdk/_client.py +13 -6
- meilisearch_python_sdk-3.5.0/meilisearch_python_sdk/_version.py +1 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/meilisearch_python_sdk/decorators.py +10 -2
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/meilisearch_python_sdk/index.py +138 -4
- meilisearch_python_sdk-3.5.0/meilisearch_python_sdk/py.typed +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/pyproject.toml +7 -5
- meilisearch_python_sdk-3.5.0/tests/__init__.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/tests/conftest.py +73 -28
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/tests/test_async_client.py +25 -22
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/tests/test_async_documents.py +102 -1
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/tests/test_async_search.py +7 -4
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/tests/test_client.py +25 -23
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/tests/test_decorators.py +8 -3
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/tests/test_search.py +9 -4
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/uv.lock +280 -225
- meilisearch_python_sdk-3.3.0/.github/workflows/testing.yaml +0 -135
- meilisearch_python_sdk-3.3.0/codecov.yml +0 -6
- meilisearch_python_sdk-3.3.0/examples/async_add_documents_in_batches.py +0 -24
- meilisearch_python_sdk-3.3.0/examples/async_update_settings.py +0 -32
- meilisearch_python_sdk-3.3.0/examples/requirements.txt +0 -2
- meilisearch_python_sdk-3.3.0/meilisearch_python_sdk/_version.py +0 -1
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/.github/FUNDING.yml +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/.github/dependabot.yaml +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/.github/release-draft-template.yaml +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/.github/workflows/release-drafter.yaml +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/LICENSE +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/README.md +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/assets/add_in_batches.png +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/assets/searches.png +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/benchmark/run_benchmark.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/datasets/small_movies.json +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/docker-compose.yml +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/docs/.nojekyll +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/docs/CNAME +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/docs/async_client_api.md +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/docs/async_index_api.md +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/docs/client_api.md +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/docs/css/custom.css +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/docs/decorators_api.md +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/docs/index.md +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/docs/index_api.md +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/docs/js/umami.js +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/docs/json_handler.md +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/docs/plugins.md +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/docs/pydantic.md +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/examples/.gitignore +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/examples/README.md +0 -0
- {meilisearch_python_sdk-3.3.0/meilisearch_python_sdk/models → meilisearch_python_sdk-3.5.0/examples}/__init__.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/examples/add_documents_decorator.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/examples/fastapi_example.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0/examples}/tests/__init__.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/meilisearch_python_sdk/__init__.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/meilisearch_python_sdk/_http_requests.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/meilisearch_python_sdk/_task.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/meilisearch_python_sdk/_utils.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/meilisearch_python_sdk/errors.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/meilisearch_python_sdk/json_handler.py +0 -0
- /meilisearch_python_sdk-3.3.0/meilisearch_python_sdk/py.typed → /meilisearch_python_sdk-3.5.0/meilisearch_python_sdk/models/__init__.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/meilisearch_python_sdk/models/client.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/meilisearch_python_sdk/models/documents.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/meilisearch_python_sdk/models/health.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/meilisearch_python_sdk/models/index.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/meilisearch_python_sdk/models/search.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/meilisearch_python_sdk/models/settings.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/meilisearch_python_sdk/models/task.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/meilisearch_python_sdk/models/version.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/meilisearch_python_sdk/plugins.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/meilisearch_python_sdk/types.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/mkdocs.yaml +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/tests/test_async_index.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/tests/test_async_index_plugins.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/tests/test_documents.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/tests/test_errors.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/tests/test_index.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/tests/test_index_plugins.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/tests/test_utils.py +0 -0
- {meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/tests/test_version.py +0 -0
{meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/.github/workflows/nightly_testing.yml
RENAMED
|
@@ -4,6 +4,9 @@ on:
|
|
|
4
4
|
schedule:
|
|
5
5
|
# Set with UTC time
|
|
6
6
|
- cron: "0 5 * * *"
|
|
7
|
+
env:
|
|
8
|
+
UV_CACHE_DIR: /tmp/.uv-cache
|
|
9
|
+
PYTHON_VERSION: "3.12"
|
|
7
10
|
jobs:
|
|
8
11
|
random-test-order:
|
|
9
12
|
strategy:
|
|
@@ -18,7 +21,7 @@ jobs:
|
|
|
18
21
|
- name: Set up Python
|
|
19
22
|
uses: actions/setup-python@v5
|
|
20
23
|
with:
|
|
21
|
-
python-version:
|
|
24
|
+
python-version: ${{ env.PYTHON_VERSION }}
|
|
22
25
|
- name: Restore uv cache
|
|
23
26
|
uses: actions/cache@v4
|
|
24
27
|
with:
|
|
@@ -30,7 +33,7 @@ jobs:
|
|
|
30
33
|
- name: Install Dependencies
|
|
31
34
|
run: |
|
|
32
35
|
just install
|
|
33
|
-
uv
|
|
36
|
+
uv pip install pytest-randomly
|
|
34
37
|
- name: Test with pytest in random order
|
|
35
38
|
run: just test-ci
|
|
36
39
|
- name: Minimize uv cache
|
{meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/.github/workflows/pypi_publish.yaml
RENAMED
|
@@ -3,6 +3,8 @@ on:
|
|
|
3
3
|
release:
|
|
4
4
|
types:
|
|
5
5
|
- published
|
|
6
|
+
env:
|
|
7
|
+
PYTHON_VERSION: "3.12"
|
|
6
8
|
jobs:
|
|
7
9
|
deploy:
|
|
8
10
|
runs-on: ubuntu-latest
|
|
@@ -13,7 +15,7 @@ jobs:
|
|
|
13
15
|
- name: Set up Python
|
|
14
16
|
uses: actions/setup-python@v5
|
|
15
17
|
with:
|
|
16
|
-
python-version:
|
|
18
|
+
python-version: ${{ env.PYTHON_VERSION }}
|
|
17
19
|
- name: Install Dependencies
|
|
18
20
|
run: uv sync --frozen --all-extras
|
|
19
21
|
- name: Build and publish package
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
name: Testing
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
env:
|
|
9
|
+
UV_CACHE_DIR: /tmp/.uv-cache
|
|
10
|
+
PYTHON_VERSION: "3.9"
|
|
11
|
+
jobs:
|
|
12
|
+
linting:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
- name: install Just
|
|
17
|
+
uses: taiki-e/install-action@just
|
|
18
|
+
- name: Install uv
|
|
19
|
+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
20
|
+
- name: Set up Python
|
|
21
|
+
uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: ${{ env.PYTHON_VERSION }}
|
|
24
|
+
- name: Restore uv cache
|
|
25
|
+
uses: actions/cache@v4
|
|
26
|
+
with:
|
|
27
|
+
path: ${{ env.UV_CACHE_DIR }}
|
|
28
|
+
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
|
|
29
|
+
restore-keys: |
|
|
30
|
+
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
|
|
31
|
+
uv-${{ runner.os }}
|
|
32
|
+
- name: Install Dependencies
|
|
33
|
+
run: just install
|
|
34
|
+
- name: mypy check
|
|
35
|
+
run: just mypy
|
|
36
|
+
- name: Minimize uv cache
|
|
37
|
+
run: uv cache prune --ci
|
|
38
|
+
|
|
39
|
+
parallel-testing:
|
|
40
|
+
strategy:
|
|
41
|
+
fail-fast: false
|
|
42
|
+
matrix:
|
|
43
|
+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13-dev"]
|
|
44
|
+
runs-on: ubuntu-latest
|
|
45
|
+
steps:
|
|
46
|
+
- uses: actions/checkout@v4
|
|
47
|
+
- name: install Just
|
|
48
|
+
uses: taiki-e/install-action@just
|
|
49
|
+
- name: Install uv
|
|
50
|
+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
51
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
52
|
+
uses: actions/setup-python@v5
|
|
53
|
+
with:
|
|
54
|
+
python-version: ${{ matrix.python-version }}
|
|
55
|
+
- name: Restore uv cache
|
|
56
|
+
uses: actions/cache@v4
|
|
57
|
+
with:
|
|
58
|
+
path: ${{ env.UV_CACHE_DIR }}
|
|
59
|
+
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
|
|
60
|
+
restore-keys: |
|
|
61
|
+
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
|
|
62
|
+
uv-${{ runner.os }}
|
|
63
|
+
- name: Install Dependencies
|
|
64
|
+
run: just install
|
|
65
|
+
- name: Test with pytest
|
|
66
|
+
run: just test-parallel-ci
|
|
67
|
+
- name: Upload coverage
|
|
68
|
+
uses: codecov/codecov-action@v4
|
|
69
|
+
with:
|
|
70
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
71
|
+
fail_ci_if_error: true
|
|
72
|
+
- name: Minimize uv cache
|
|
73
|
+
run: uv cache prune --ci
|
|
74
|
+
|
|
75
|
+
parallel-testing-http2:
|
|
76
|
+
strategy:
|
|
77
|
+
fail-fast: false
|
|
78
|
+
matrix:
|
|
79
|
+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13-dev"]
|
|
80
|
+
runs-on: ubuntu-latest
|
|
81
|
+
steps:
|
|
82
|
+
- uses: actions/checkout@v4
|
|
83
|
+
- name: install Just
|
|
84
|
+
uses: taiki-e/install-action@just
|
|
85
|
+
- name: Install uv
|
|
86
|
+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
87
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
88
|
+
uses: actions/setup-python@v5
|
|
89
|
+
with:
|
|
90
|
+
python-version: ${{ matrix.python-version }}
|
|
91
|
+
- name: Restore uv cache
|
|
92
|
+
uses: actions/cache@v4
|
|
93
|
+
with:
|
|
94
|
+
path: ${{ env.UV_CACHE_DIR }}
|
|
95
|
+
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
|
|
96
|
+
restore-keys: |
|
|
97
|
+
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
|
|
98
|
+
uv-${{ runner.os }}
|
|
99
|
+
- name: Install Dependencies
|
|
100
|
+
run: just install
|
|
101
|
+
- name: Install truststore
|
|
102
|
+
if: ${{ ! startsWith(matrix.python-version, '3.9') }}
|
|
103
|
+
run: uv pip install truststore
|
|
104
|
+
- name: Install ssl requirements
|
|
105
|
+
run: |
|
|
106
|
+
sudo apt-get update
|
|
107
|
+
sudo apt-get install -y libnss3-tools build-essential gcc
|
|
108
|
+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
|
109
|
+
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
|
|
110
|
+
brew install mkcert
|
|
111
|
+
mkcert -install
|
|
112
|
+
mkcert -key-file meilisearch.key -cert-file meilisearch.crt localhost 127.0.0.1 ::1
|
|
113
|
+
- name: Test with pytest
|
|
114
|
+
run: just test-parallel-ci-http2
|
|
115
|
+
- name: Upload coverage
|
|
116
|
+
uses: codecov/codecov-action@v4
|
|
117
|
+
with:
|
|
118
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
119
|
+
fail_ci_if_error: true
|
|
120
|
+
- name: Minimize uv cache
|
|
121
|
+
run: uv cache prune --ci
|
|
122
|
+
|
|
123
|
+
no-parallel-testing:
|
|
124
|
+
strategy:
|
|
125
|
+
fail-fast: false
|
|
126
|
+
matrix:
|
|
127
|
+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13-dev"]
|
|
128
|
+
runs-on: ubuntu-latest
|
|
129
|
+
steps:
|
|
130
|
+
- uses: actions/checkout@v4
|
|
131
|
+
- name: install Just
|
|
132
|
+
uses: taiki-e/install-action@just
|
|
133
|
+
- name: Install uv
|
|
134
|
+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
135
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
136
|
+
uses: actions/setup-python@v5
|
|
137
|
+
with:
|
|
138
|
+
python-version: ${{ matrix.python-version }}
|
|
139
|
+
- name: Restore uv cache
|
|
140
|
+
uses: actions/cache@v4
|
|
141
|
+
with:
|
|
142
|
+
path: ${{ env.UV_CACHE_DIR }}
|
|
143
|
+
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
|
|
144
|
+
restore-keys: |
|
|
145
|
+
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
|
|
146
|
+
uv-${{ runner.os }}
|
|
147
|
+
- name: Install Dependencies
|
|
148
|
+
run: just install
|
|
149
|
+
- name: Test with pytest
|
|
150
|
+
run: just test-no-parallel-ci
|
|
151
|
+
- name: Upload coverage
|
|
152
|
+
uses: codecov/codecov-action@v4
|
|
153
|
+
with:
|
|
154
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
155
|
+
fail_ci_if_error: true
|
|
156
|
+
- name: Minimize uv cache
|
|
157
|
+
run: uv cache prune --ci
|
|
158
|
+
|
|
159
|
+
no-parallel-testing-http2:
|
|
160
|
+
strategy:
|
|
161
|
+
fail-fast: false
|
|
162
|
+
matrix:
|
|
163
|
+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13-dev"]
|
|
164
|
+
runs-on: ubuntu-latest
|
|
165
|
+
steps:
|
|
166
|
+
- uses: actions/checkout@v4
|
|
167
|
+
- name: install Just
|
|
168
|
+
uses: taiki-e/install-action@just
|
|
169
|
+
- name: Install uv
|
|
170
|
+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
171
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
172
|
+
uses: actions/setup-python@v5
|
|
173
|
+
with:
|
|
174
|
+
python-version: ${{ matrix.python-version }}
|
|
175
|
+
- name: Restore uv cache
|
|
176
|
+
uses: actions/cache@v4
|
|
177
|
+
with:
|
|
178
|
+
path: ${{ env.UV_CACHE_DIR }}
|
|
179
|
+
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
|
|
180
|
+
restore-keys: |
|
|
181
|
+
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
|
|
182
|
+
uv-${{ runner.os }}
|
|
183
|
+
- name: Install Dependencies
|
|
184
|
+
run: just install
|
|
185
|
+
- name: Install truststore
|
|
186
|
+
if: ${{ ! startsWith(matrix.python-version, '3.9') }}
|
|
187
|
+
run: uv pip install truststore
|
|
188
|
+
- name: Install ssl requirements
|
|
189
|
+
run: |
|
|
190
|
+
sudo apt-get update
|
|
191
|
+
sudo apt-get install -y libnss3-tools build-essential gcc
|
|
192
|
+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
|
193
|
+
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
|
|
194
|
+
brew install mkcert
|
|
195
|
+
mkcert -install
|
|
196
|
+
mkcert -key-file meilisearch.key -cert-file meilisearch.crt localhost 127.0.0.1 ::1
|
|
197
|
+
- name: Test with pytest
|
|
198
|
+
run: just test-no-parallel-ci-http2
|
|
199
|
+
- name: Upload coverage
|
|
200
|
+
uses: codecov/codecov-action@v4
|
|
201
|
+
with:
|
|
202
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
203
|
+
fail_ci_if_error: true
|
|
204
|
+
- name: Minimize uv cache
|
|
205
|
+
run: uv cache prune --ci
|
|
206
|
+
example-testing:
|
|
207
|
+
strategy:
|
|
208
|
+
fail-fast: false
|
|
209
|
+
matrix:
|
|
210
|
+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13-dev"]
|
|
211
|
+
runs-on: ubuntu-latest
|
|
212
|
+
steps:
|
|
213
|
+
- uses: actions/checkout@v4
|
|
214
|
+
- name: install Just
|
|
215
|
+
uses: taiki-e/install-action@just
|
|
216
|
+
- name: Install uv
|
|
217
|
+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
218
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
219
|
+
uses: actions/setup-python@v5
|
|
220
|
+
with:
|
|
221
|
+
python-version: ${{ matrix.python-version }}
|
|
222
|
+
- name: Restore uv cache
|
|
223
|
+
uses: actions/cache@v4
|
|
224
|
+
with:
|
|
225
|
+
path: ${{ env.UV_CACHE_DIR }}
|
|
226
|
+
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
|
|
227
|
+
restore-keys: |
|
|
228
|
+
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
|
|
229
|
+
uv-${{ runner.os }}
|
|
230
|
+
- name: Test with pytest
|
|
231
|
+
run: just test-examples-ci
|
|
232
|
+
- name: Minimize uv cache
|
|
233
|
+
run: uv cache prune --ci
|
|
234
|
+
|
|
235
|
+
docs:
|
|
236
|
+
runs-on: ubuntu-latest
|
|
237
|
+
steps:
|
|
238
|
+
- uses: actions/checkout@v4
|
|
239
|
+
- name: install Just
|
|
240
|
+
uses: taiki-e/install-action@just
|
|
241
|
+
- name: Install uv
|
|
242
|
+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
243
|
+
- name: Set up Python
|
|
244
|
+
uses: actions/setup-python@v5
|
|
245
|
+
with:
|
|
246
|
+
python-version: "3.11"
|
|
247
|
+
- name: Restore uv cache
|
|
248
|
+
uses: actions/cache@v4
|
|
249
|
+
with:
|
|
250
|
+
path: ${{ env.UV_CACHE_DIR }}
|
|
251
|
+
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
|
|
252
|
+
restore-keys: |
|
|
253
|
+
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
|
|
254
|
+
uv-${{ runner.os }}
|
|
255
|
+
- name: Install Dependencies
|
|
256
|
+
run: just install
|
|
257
|
+
- name: Test Docs Build
|
|
258
|
+
run: just build-docs
|
|
259
|
+
- name: Minimize uv cache
|
|
260
|
+
run: uv cache prune --ci
|
|
@@ -9,12 +9,12 @@ repos:
|
|
|
9
9
|
- id: end-of-file-fixer
|
|
10
10
|
- id: trailing-whitespace
|
|
11
11
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
12
|
-
rev: v1.11.
|
|
12
|
+
rev: v1.11.2
|
|
13
13
|
hooks:
|
|
14
14
|
- id: mypy
|
|
15
15
|
additional_dependencies: [pydantic, types-aiofiles, types-ujson]
|
|
16
16
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
17
|
-
rev: v0.6.
|
|
17
|
+
rev: v0.6.5
|
|
18
18
|
hooks:
|
|
19
19
|
- id: ruff
|
|
20
20
|
args: [--fix, --exit-non-zero-on-fix]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: meilisearch-python-sdk
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.5.0
|
|
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
|
|
@@ -42,7 +42,7 @@ Requires-Python: >=3.9
|
|
|
42
42
|
Requires-Dist: aiofiles>=0.7
|
|
43
43
|
Requires-Dist: camel-converter>=1.0.0
|
|
44
44
|
Requires-Dist: eval-type-backport>=0.2.0; python_version < '3.10'
|
|
45
|
-
Requires-Dist: httpx>=0.17
|
|
45
|
+
Requires-Dist: httpx[http2]>=0.17
|
|
46
46
|
Requires-Dist: pydantic>=2.0.0
|
|
47
47
|
Requires-Dist: pyjwt>=2.3.0
|
|
48
48
|
Provides-Extra: all
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
services:
|
|
2
|
+
meilisearch:
|
|
3
|
+
image: getmeili/meilisearch:latest
|
|
4
|
+
ports:
|
|
5
|
+
- "7700:7700"
|
|
6
|
+
environment:
|
|
7
|
+
- MEILI_MASTER_KEY=masterKey
|
|
8
|
+
- MEILI_NO_ANALYTICS=true
|
|
9
|
+
volumes:
|
|
10
|
+
- ./meilisearch.key:/meilisearch.key
|
|
11
|
+
- ./meilisearch.crt:/meilisearch.crt
|
|
12
|
+
command: ["meilisearch", "--ssl-cert-path", "/meilisearch.crt", "--ssl-key-path", "/meilisearch.key"]
|
|
@@ -2,6 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import asyncio
|
|
4
4
|
import json
|
|
5
|
+
from pathlib import Path
|
|
5
6
|
from typing import Any
|
|
6
7
|
|
|
7
8
|
import aiofiles
|
|
@@ -14,8 +15,10 @@ from meilisearch_python_sdk.decorators import ConnectionInfo, async_add_document
|
|
|
14
15
|
index_name="movies",
|
|
15
16
|
connection_info=ConnectionInfo(url="http://127.0.0.1:7700", api_key="masterKey"),
|
|
16
17
|
)
|
|
17
|
-
async def load_documents(
|
|
18
|
-
|
|
18
|
+
async def load_documents(
|
|
19
|
+
file_path: Path | str = "../datasets/small_movies.json",
|
|
20
|
+
) -> list[dict[str, Any]]:
|
|
21
|
+
async with aiofiles.open(file_path) as f:
|
|
19
22
|
data = await f.read()
|
|
20
23
|
documents = json.loads(data)
|
|
21
24
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import asyncio
|
|
4
|
+
import json
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
import aiofiles
|
|
8
|
+
|
|
9
|
+
from meilisearch_python_sdk import AsyncClient, AsyncIndex
|
|
10
|
+
from meilisearch_python_sdk.models.task import TaskInfo
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
async def add_documents_in_batches(
|
|
14
|
+
index: AsyncIndex, file_path: Path | str = "../datasets/small_movies.json"
|
|
15
|
+
) -> list[TaskInfo]:
|
|
16
|
+
async with aiofiles.open(file_path) as f:
|
|
17
|
+
data = await f.read()
|
|
18
|
+
documents = json.loads(data)
|
|
19
|
+
|
|
20
|
+
# Meilisearch prefers larger batch sizes so set this as large as you can.
|
|
21
|
+
return await index.add_documents_in_batches(documents, primary_key="id", batch_size=1000)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
async def main() -> int:
|
|
25
|
+
async with AsyncClient("http://127.0.0.1:7700", "masterKey") as client:
|
|
26
|
+
index = await client.create_index("movies", primary_key="id")
|
|
27
|
+
|
|
28
|
+
await add_documents_in_batches(index)
|
|
29
|
+
|
|
30
|
+
return 0
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
if __name__ == "__main__":
|
|
34
|
+
raise SystemExit(asyncio.run(main()))
|
{meilisearch_python_sdk-3.3.0 → meilisearch_python_sdk-3.5.0}/examples/async_search_tracker.py
RENAMED
|
@@ -1,12 +1,18 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
1
3
|
import asyncio
|
|
2
4
|
import json
|
|
3
5
|
import sqlite3
|
|
6
|
+
from pathlib import Path
|
|
4
7
|
from typing import Any
|
|
5
8
|
|
|
6
9
|
import aiofiles
|
|
7
10
|
|
|
8
|
-
from meilisearch_python_sdk import AsyncClient
|
|
11
|
+
from meilisearch_python_sdk import AsyncClient, AsyncIndex
|
|
12
|
+
from meilisearch_python_sdk.models.search import SearchResults
|
|
13
|
+
from meilisearch_python_sdk.models.task import TaskInfo
|
|
9
14
|
from meilisearch_python_sdk.plugins import AsyncEvent, AsyncIndexPlugins
|
|
15
|
+
from meilisearch_python_sdk.types import JsonDict
|
|
10
16
|
|
|
11
17
|
|
|
12
18
|
class SearchTrackerPlugin:
|
|
@@ -14,8 +20,8 @@ class SearchTrackerPlugin:
|
|
|
14
20
|
POST_EVENT = False
|
|
15
21
|
PRE_EVENT = False
|
|
16
22
|
|
|
17
|
-
def __init__(self) -> None:
|
|
18
|
-
self.conn = sqlite3.Connection(
|
|
23
|
+
def __init__(self, db_path: Path | str = "search_tracker.db") -> None:
|
|
24
|
+
self.conn = sqlite3.Connection(db_path)
|
|
19
25
|
self.create_table()
|
|
20
26
|
|
|
21
27
|
def create_table(self) -> None:
|
|
@@ -43,15 +49,24 @@ class SearchTrackerPlugin:
|
|
|
43
49
|
cursor.close()
|
|
44
50
|
|
|
45
51
|
|
|
46
|
-
async def
|
|
47
|
-
|
|
52
|
+
async def add_documents(
|
|
53
|
+
index: AsyncIndex, file_path: Path | str = "../datasets/small_movies.json"
|
|
54
|
+
) -> TaskInfo:
|
|
55
|
+
async with aiofiles.open(file_path) as f:
|
|
48
56
|
data = await f.read()
|
|
49
57
|
documents = json.loads(data)
|
|
58
|
+
return await index.add_documents(documents)
|
|
59
|
+
|
|
50
60
|
|
|
61
|
+
async def search(index: AsyncIndex, query: str) -> SearchResults[JsonDict]:
|
|
62
|
+
return await index.search(query)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
async def main() -> int:
|
|
51
66
|
async with AsyncClient("http://127.0.0.1:7700", "masterKey") as client:
|
|
52
67
|
plugins = AsyncIndexPlugins(search_plugins=(SearchTrackerPlugin(),))
|
|
53
68
|
index = await client.create_index("movies", primary_key="id", plugins=plugins)
|
|
54
|
-
task = await
|
|
69
|
+
task = await add_documents(index)
|
|
55
70
|
await client.wait_for_task(task.task_uid)
|
|
56
71
|
result = await index.search("Cars")
|
|
57
72
|
print(result) # noqa: T201
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import asyncio
|
|
4
|
+
import json
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
import aiofiles
|
|
8
|
+
|
|
9
|
+
from meilisearch_python_sdk import AsyncClient, AsyncIndex
|
|
10
|
+
from meilisearch_python_sdk.models.settings import MeilisearchSettings
|
|
11
|
+
from meilisearch_python_sdk.models.task import TaskInfo
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
async def add_documents(
|
|
15
|
+
index: AsyncIndex, file_path: Path | str = "../datasets/small_movies.json"
|
|
16
|
+
) -> TaskInfo:
|
|
17
|
+
async with aiofiles.open(file_path) as f:
|
|
18
|
+
data = await f.read()
|
|
19
|
+
documents = json.loads(data)
|
|
20
|
+
|
|
21
|
+
return await index.add_documents(documents)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
async def update_settings(index: AsyncIndex) -> TaskInfo:
|
|
25
|
+
settings = MeilisearchSettings(
|
|
26
|
+
filterable_attributes=["genre"], searchable_attributes=["title", "genre", "overview"]
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
return await index.update_settings(settings)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
async def main() -> int:
|
|
33
|
+
async with AsyncClient("http://127.0.0.1:7700", "masterKey") as client:
|
|
34
|
+
index = await client.create_index("movies", primary_key="id")
|
|
35
|
+
task = await update_settings(index)
|
|
36
|
+
await client.wait_for_task(task.task_uid)
|
|
37
|
+
await add_documents(index)
|
|
38
|
+
|
|
39
|
+
return 0
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
if __name__ == "__main__":
|
|
43
|
+
raise SystemExit(asyncio.run(main()))
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
1
5
|
from meilisearch_python_sdk import Client
|
|
2
6
|
from meilisearch_python_sdk.json_handler import OrjsonHandler
|
|
7
|
+
from meilisearch_python_sdk.models.task import TaskInfo
|
|
3
8
|
|
|
4
9
|
|
|
5
|
-
def
|
|
10
|
+
def add_documents(file_path: Path | str = "../datasets/small_movies.json") -> TaskInfo:
|
|
6
11
|
client = Client("http://127.0.0.1:7700", "masterKey", json_handler=OrjsonHandler())
|
|
7
12
|
index = client.create_index("movies", primary_key="id")
|
|
8
|
-
index.add_documents_from_file(
|
|
13
|
+
return index.add_documents_from_file(file_path)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def main() -> int:
|
|
17
|
+
add_documents()
|
|
9
18
|
|
|
10
19
|
return 0
|
|
11
20
|
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
1
3
|
import json
|
|
2
4
|
import sqlite3
|
|
5
|
+
from pathlib import Path
|
|
3
6
|
from typing import Any
|
|
4
7
|
|
|
5
|
-
from meilisearch_python_sdk import Client
|
|
8
|
+
from meilisearch_python_sdk import Client, Index
|
|
9
|
+
from meilisearch_python_sdk.models.search import SearchResults
|
|
10
|
+
from meilisearch_python_sdk.models.task import TaskInfo
|
|
6
11
|
from meilisearch_python_sdk.plugins import Event, IndexPlugins
|
|
12
|
+
from meilisearch_python_sdk.types import JsonDict
|
|
7
13
|
|
|
8
14
|
|
|
9
15
|
class SearchTrackerPlugin:
|
|
10
16
|
POST_EVENT = False
|
|
11
17
|
PRE_EVENT = True # Specifies the plugin should be run before the search
|
|
12
18
|
|
|
13
|
-
def __init__(self) -> None:
|
|
14
|
-
self.conn = sqlite3.Connection(
|
|
19
|
+
def __init__(self, db_path: Path | str = "search_tracker.db") -> None:
|
|
20
|
+
self.conn = sqlite3.Connection(db_path)
|
|
15
21
|
self.create_table()
|
|
16
22
|
|
|
17
23
|
def create_table(self) -> None:
|
|
@@ -34,16 +40,25 @@ class SearchTrackerPlugin:
|
|
|
34
40
|
cursor.close()
|
|
35
41
|
|
|
36
42
|
|
|
37
|
-
def
|
|
38
|
-
|
|
43
|
+
def add_documents(
|
|
44
|
+
index: Index, file_path: Path | str = "../datasets/small_movies.json"
|
|
45
|
+
) -> TaskInfo:
|
|
46
|
+
with open(file_path) as f:
|
|
39
47
|
documents = json.load(f)
|
|
48
|
+
return index.add_documents(documents)
|
|
49
|
+
|
|
40
50
|
|
|
51
|
+
def search(index: Index, query: str) -> SearchResults[JsonDict]:
|
|
52
|
+
return index.search(query)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def main() -> int:
|
|
41
56
|
client = Client("http://127.0.0.1:7700", "masterKey")
|
|
42
57
|
plugins = IndexPlugins(search_plugins=(SearchTrackerPlugin(),))
|
|
43
58
|
index = client.create_index("movies", primary_key="id", plugins=plugins)
|
|
44
|
-
task =
|
|
59
|
+
task = add_documents(index)
|
|
45
60
|
client.wait_for_task(task.task_uid)
|
|
46
|
-
result =
|
|
61
|
+
result = search(index, "Cars")
|
|
47
62
|
print(result) # noqa: T201
|
|
48
63
|
|
|
49
64
|
return 0
|