meilisearch-python-sdk 4.9.0__py3-none-any.whl → 4.10.1__py3-none-any.whl

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.

@@ -812,11 +812,13 @@ class AsyncClient(BaseClient):
812
812
 
813
813
  return Health(**response.json())
814
814
 
815
- async def swap_indexes(self, indexes: list[tuple[str, str]]) -> TaskInfo:
815
+ async def swap_indexes(self, indexes: list[tuple[str, str]], rename: bool = False) -> TaskInfo:
816
816
  """Swap two indexes.
817
817
 
818
818
  Args:
819
819
  indexes: A list of tuples, each tuple should contain the indexes to swap.
820
+ rename: Use rename false if you are swapping two existing indexes. Use rename true if
821
+ the second index in your array does not exist. Default = False
820
822
 
821
823
  Returns:
822
824
  The details of the task.
@@ -830,7 +832,10 @@ class AsyncClient(BaseClient):
830
832
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
831
833
  >>> index = await client.swap_indexes([("index_a", "index_b")])
832
834
  """
833
- processed_indexes = [{"indexes": x} for x in indexes]
835
+ if rename:
836
+ processed_indexes = [{"indexes": x, "rename": True} for x in indexes]
837
+ else:
838
+ processed_indexes = [{"indexes": x} for x in indexes]
834
839
  response = await self._http_requests.post("swap-indexes", processed_indexes)
835
840
 
836
841
  return TaskInfo(**response.json())
@@ -1775,11 +1780,13 @@ class Client(BaseClient):
1775
1780
 
1776
1781
  return Health(**response.json())
1777
1782
 
1778
- def swap_indexes(self, indexes: list[tuple[str, str]]) -> TaskInfo:
1783
+ def swap_indexes(self, indexes: list[tuple[str, str]], rename: bool = False) -> TaskInfo:
1779
1784
  """Swap two indexes.
1780
1785
 
1781
1786
  Args:
1782
1787
  indexes: A list of tuples, each tuple should contain the indexes to swap.
1788
+ rename: Use rename false if you are swapping two existing indexes. Use rename true if
1789
+ the second index in your array does not exist. Default = False
1783
1790
 
1784
1791
  Returns:
1785
1792
  The details of the task.
@@ -1793,7 +1800,10 @@ class Client(BaseClient):
1793
1800
  >>> client = Client("http://localhost.com", "masterKey")
1794
1801
  >>> index = client.swap_indexes([("index_a", "index_b")])
1795
1802
  """
1796
- processed_indexes = [{"indexes": x} for x in indexes]
1803
+ if rename:
1804
+ processed_indexes = [{"indexes": x, "rename": True} for x in indexes]
1805
+ else:
1806
+ processed_indexes = [{"indexes": x} for x in indexes]
1797
1807
  response = self._http_requests.post("swap-indexes", processed_indexes)
1798
1808
 
1799
1809
  return TaskInfo(**response.json())
@@ -1 +1 @@
1
- VERSION = "4.9.0"
1
+ VERSION = "4.10.1"
@@ -3593,7 +3593,7 @@ class AsyncIndex(_BaseIndex):
3593
3593
 
3594
3594
  return TaskInfo(**response.json())
3595
3595
 
3596
- async def get_filterable_attributes(self) -> list[str] | list[FilterableAttributes] | None:
3596
+ async def get_filterable_attributes(self) -> list[str | FilterableAttributes] | None:
3597
3597
  """Get filterable attributes of the index.
3598
3598
 
3599
3599
  Returns:
@@ -3616,22 +3616,22 @@ class AsyncIndex(_BaseIndex):
3616
3616
 
3617
3617
  response_json = response.json()
3618
3618
 
3619
- if isinstance(response_json[0], str):
3620
- return response_json
3621
-
3622
- filterable_attributes = []
3619
+ filterable_attributes: list[str | FilterableAttributes] = []
3623
3620
  for r in response_json:
3624
- filterable_attributes.append(
3625
- FilterableAttributes(
3626
- attribute_patterns=r["attributePatterns"],
3627
- features=FilterableAttributeFeatures(**r["features"]),
3621
+ if isinstance(r, str):
3622
+ filterable_attributes.append(r)
3623
+ else:
3624
+ filterable_attributes.append(
3625
+ FilterableAttributes(
3626
+ attribute_patterns=r["attributePatterns"],
3627
+ features=FilterableAttributeFeatures(**r["features"]),
3628
+ )
3628
3629
  )
3629
- )
3630
3630
 
3631
3631
  return filterable_attributes
3632
3632
 
3633
3633
  async def update_filterable_attributes(
3634
- self, body: list[str] | list[FilterableAttributes], *, compress: bool = False
3634
+ self, body: list[str | FilterableAttributes], *, compress: bool = False
3635
3635
  ) -> TaskInfo:
3636
3636
  """Update filterable attributes of the index.
3637
3637
 
@@ -7224,7 +7224,7 @@ class Index(_BaseIndex):
7224
7224
 
7225
7225
  return TaskInfo(**response.json())
7226
7226
 
7227
- def get_filterable_attributes(self) -> list[str] | list[FilterableAttributes] | None:
7227
+ def get_filterable_attributes(self) -> list[str | FilterableAttributes] | None:
7228
7228
  """Get filterable attributes of the index.
7229
7229
 
7230
7230
  Returns:
@@ -7247,22 +7247,22 @@ class Index(_BaseIndex):
7247
7247
 
7248
7248
  response_json = response.json()
7249
7249
 
7250
- if isinstance(response_json[0], str):
7251
- return response_json
7252
-
7253
- filterable_attributes = []
7250
+ filterable_attributes: list[str | FilterableAttributes] = []
7254
7251
  for r in response_json:
7255
- filterable_attributes.append(
7256
- FilterableAttributes(
7257
- attribute_patterns=r["attributePatterns"],
7258
- features=FilterableAttributeFeatures(**r["features"]),
7252
+ if isinstance(r, str):
7253
+ filterable_attributes.append(r)
7254
+ else:
7255
+ filterable_attributes.append(
7256
+ FilterableAttributes(
7257
+ attribute_patterns=r["attributePatterns"],
7258
+ features=FilterableAttributeFeatures(**r["features"]),
7259
+ )
7259
7260
  )
7260
- )
7261
7261
 
7262
7262
  return filterable_attributes
7263
7263
 
7264
7264
  def update_filterable_attributes(
7265
- self, body: list[str] | list[FilterableAttributes], *, compress: bool = False
7265
+ self, body: list[str | FilterableAttributes], *, compress: bool = False
7266
7266
  ) -> TaskInfo:
7267
7267
  """Update filterable attributes of the index.
7268
7268
 
@@ -167,7 +167,7 @@ class MeilisearchSettings(CamelBase):
167
167
  synonyms: JsonDict | None = None
168
168
  stop_words: list[str] | None = None
169
169
  ranking_rules: list[str] | None = None
170
- filterable_attributes: list[str] | list[FilterableAttributes] | None = None
170
+ filterable_attributes: list[str | FilterableAttributes] | None = None
171
171
  distinct_attribute: str | None = None
172
172
  searchable_attributes: list[str] | None = None
173
173
  displayed_attributes: list[str] | None = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meilisearch-python-sdk
3
- Version: 4.9.0
3
+ Version: 4.10.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
@@ -1,13 +1,13 @@
1
1
  meilisearch_python_sdk/__init__.py,sha256=SB0Jlm6FwT13J9xasZKseZzTWBk0hkfe1CWyWmIIZnE,258
2
2
  meilisearch_python_sdk/_batch.py,sha256=Hbt-M8Lt8ZDZqcKToUMzUd5zvT-gku709er4pRlvXWk,5065
3
- meilisearch_python_sdk/_client.py,sha256=bsGEST8aBJVMsul-RIKWutCAVjKh8Gx0ReCuwvSL7oA,81093
3
+ meilisearch_python_sdk/_client.py,sha256=wwSNx0pKkVz3tMYw_Zk04C5DmjrqxjP0Hi6iD3l9RAI,81729
4
4
  meilisearch_python_sdk/_http_requests.py,sha256=O3M3n-t1jAKwccWowPbk-HPD3ExtHq8a3XhnZT5facs,6746
5
5
  meilisearch_python_sdk/_task.py,sha256=QgVcqMlZdURRS_oYpB_bTBa5dvT3Sp_-O0-s6TqAxHk,12485
6
6
  meilisearch_python_sdk/_utils.py,sha256=NoCDxJPhjABeuSxFTNCih585UDWdXEUBD_FvdgtScQw,1539
7
- meilisearch_python_sdk/_version.py,sha256=bmQkTABtlbDMSgjET7LUES-O4ujaN2we_yeOqP1woIA,18
7
+ meilisearch_python_sdk/_version.py,sha256=kGC5So1y0NX4r0HRyeDtOc_TKBMg8dz2_O2jpgV8a7k,19
8
8
  meilisearch_python_sdk/decorators.py,sha256=njMn40P-qOzKGGQLCDpsBKWyj2ai10s4XG4IUBSHoD4,8674
9
9
  meilisearch_python_sdk/errors.py,sha256=RNNHXtXLBiCVZaLM2MeKKs9RbRuE-SLRttiPeVAEXgA,2133
10
- meilisearch_python_sdk/index.py,sha256=1hKuVPQPH1bpQ_3DrnihpypMZk5ZZok0-pU3RjO0Sfo,349340
10
+ meilisearch_python_sdk/index.py,sha256=XxUgfOBUo6ClayI94I0AljGW4obam5hBIHeAz7d8f4Q,349474
11
11
  meilisearch_python_sdk/json_handler.py,sha256=c1rGKzYlE0dGfLygQjPqVUNfQkN1JvafBGmIx31JW8g,2044
12
12
  meilisearch_python_sdk/plugins.py,sha256=YySzTuVr4IrogTgrP8q-gZPsew8TwedopjWnTj5eV48,3607
13
13
  meilisearch_python_sdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -19,10 +19,10 @@ meilisearch_python_sdk/models/documents.py,sha256=eT3FHrPND-g2IzNRyOHQApTTJ1WbFc
19
19
  meilisearch_python_sdk/models/health.py,sha256=hvruti7ylsk7bAh8RPOhTPcRrjx6MPgdkDFX9vZ5Qks,95
20
20
  meilisearch_python_sdk/models/index.py,sha256=WLQOi3_HChko134FkRU1H3_cJjhHJCFclcx4oDBlqHU,1228
21
21
  meilisearch_python_sdk/models/search.py,sha256=U3ph1GW9Xkbw33pIlGDa7rlTGsdvqahjRJjPxUou8n8,3581
22
- meilisearch_python_sdk/models/settings.py,sha256=3UdJWbrXfTrwvzu3Gq-aY1fDmAejysSz7yRQ-7yXCwQ,5736
22
+ meilisearch_python_sdk/models/settings.py,sha256=eh0xnro4D_sj8ck2nifa3tBdf2_7RcZlAY_zQhfsY0s,5730
23
23
  meilisearch_python_sdk/models/task.py,sha256=JVYF46ylD-XwqVVNq2offhLOkljaGxPyRVuF6PwLOBU,2174
24
24
  meilisearch_python_sdk/models/version.py,sha256=YDu-aj5H-d6nSaWRTXzlwWghmZAoiknaw250UyEd48I,215
25
- meilisearch_python_sdk-4.9.0.dist-info/METADATA,sha256=eMfrNaOBiXcGZHYREUf0xUpS5oZjFbd9OjonqoqSQ_E,9763
26
- meilisearch_python_sdk-4.9.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
- meilisearch_python_sdk-4.9.0.dist-info/licenses/LICENSE,sha256=xVzevI1TrlKfM0plmJ7vfK1Muu0V9n-dGE8RnDrOFlM,1069
28
- meilisearch_python_sdk-4.9.0.dist-info/RECORD,,
25
+ meilisearch_python_sdk-4.10.1.dist-info/METADATA,sha256=NyLbpQvnUIOg-FrR8_X8IAGFZ3mpnlElcHXQpbh0f34,9764
26
+ meilisearch_python_sdk-4.10.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
+ meilisearch_python_sdk-4.10.1.dist-info/licenses/LICENSE,sha256=xVzevI1TrlKfM0plmJ7vfK1Muu0V9n-dGE8RnDrOFlM,1069
28
+ meilisearch_python_sdk-4.10.1.dist-info/RECORD,,