meilisearch-python-sdk 3.5.0__py3-none-any.whl → 3.5.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.

@@ -74,7 +74,6 @@ class BaseClient:
74
74
  """Generates a JWT token to use for searching.
75
75
 
76
76
  Args:
77
-
78
77
  search_rules: Contains restrictions to use for the token. The default rules used for
79
78
  the API key used for signing can be used by setting searchRules to ["*"]. If "indexes"
80
79
  is included it must be equal to or more restrictive than the key used to generate the
@@ -84,17 +83,14 @@ class BaseClient:
84
83
  shoud be a UTC time in the future. Default = None.
85
84
 
86
85
  Returns:
87
-
88
86
  A JWT token
89
87
 
90
88
  Raises:
91
-
92
89
  InvalidRestriction: If the restrictions are less strict than the permissions allowed
93
90
  in the API key.
94
91
  KeyNotFoundError: If no API search key is found.
95
92
 
96
93
  Examples:
97
-
98
94
  Async:
99
95
 
100
96
  >>> from datetime import datetime, timedelta, timezone
@@ -155,7 +151,6 @@ class AsyncClient(BaseClient):
155
151
  """Class initializer.
156
152
 
157
153
  Args:
158
-
159
154
  url: The url to the Meilisearch API (ex: http://localhost:7700)
160
155
  api_key: The optional API key for Meilisearch. Defaults to None.
161
156
  timeout: The amount of time in seconds that the client will wait for a response before
@@ -200,16 +195,13 @@ class AsyncClient(BaseClient):
200
195
  """Trigger the creation of a Meilisearch dump.
201
196
 
202
197
  Returns:
203
-
204
198
  The details of the task.
205
199
 
206
200
  Raises:
207
-
208
201
  MeilisearchCommunicationError: If there was an error communicating with the server.
209
202
  MeilisearchApiError: If the Meilisearch API returned an error.
210
203
 
211
204
  Examples:
212
-
213
205
  >>> from meilisearch_python_sdk import AsyncClient
214
206
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
215
207
  >>> await client.create_dump()
@@ -232,7 +224,6 @@ class AsyncClient(BaseClient):
232
224
  """Creates a new index.
233
225
 
234
226
  Args:
235
-
236
227
  uid: The index's unique identifier.
237
228
  primary_key: The primary key of the documents. Defaults to None.
238
229
  settings: Settings for the index. The settings can also be updated independently of
@@ -251,16 +242,13 @@ class AsyncClient(BaseClient):
251
242
  JsonDict
252
243
 
253
244
  Returns:
254
-
255
245
  An instance of AsyncIndex containing the information of the newly created index.
256
246
 
257
247
  Raises:
258
-
259
248
  MeilisearchCommunicationError: If there was an error communicating with the server.
260
249
  MeilisearchApiError: If the Meilisearch API returned an error.
261
250
 
262
251
  Examples:
263
-
264
252
  >>> from meilisearch_python_sdk import AsyncClient
265
253
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
266
254
  >>> index = await client.create_index("movies")
@@ -281,16 +269,13 @@ class AsyncClient(BaseClient):
281
269
  """Trigger the creation of a Meilisearch snapshot.
282
270
 
283
271
  Returns:
284
-
285
272
  The details of the task.
286
273
 
287
274
  Raises:
288
-
289
275
  MeilisearchCommunicationError: If there was an error communicating with the server.
290
276
  MeilisearchApiError: If the Meilisearch API returned an error.
291
277
 
292
278
  Examples:
293
-
294
279
  >>> from meilisearch_python_sdk import AsyncClient
295
280
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
296
281
  >>> await client.create_snapshot()
@@ -303,20 +288,16 @@ class AsyncClient(BaseClient):
303
288
  """Deletes an index if it already exists.
304
289
 
305
290
  Args:
306
-
307
291
  uid: The index's unique identifier.
308
292
 
309
293
  Returns:
310
-
311
294
  True if an index was deleted for False if not.
312
295
 
313
296
  Raises:
314
-
315
297
  MeilisearchCommunicationError: If there was an error communicating with the server.
316
298
  MeilisearchApiError: If the Meilisearch API returned an error.
317
299
 
318
300
  Examples:
319
-
320
301
  >>> from meilisearch_python_sdk import AsyncClient
321
302
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
322
303
  >>> await client.delete_index_if_exists()
@@ -331,24 +312,21 @@ class AsyncClient(BaseClient):
331
312
  self, *, offset: int | None = None, limit: int | None = None
332
313
  ) -> list[AsyncIndex] | None:
333
314
  """Get all indexes.
334
- Args:
335
315
 
316
+ Args:
336
317
  offset: Number of indexes to skip. The default of None will use the Meilisearch
337
318
  default.
338
319
  limit: Number of indexes to return. The default of None will use the Meilisearch
339
320
  default.
340
321
 
341
322
  Returns:
342
-
343
323
  A list of all indexes.
344
324
 
345
325
  Raises:
346
-
347
326
  MeilisearchCommunicationError: If there was an error communicating with the server.
348
327
  MeilisearchApiError: If the Meilisearch API returned an error.
349
328
 
350
329
  Examples:
351
-
352
330
  >>> from meilisearch_python_sdk import AsyncClient
353
331
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
354
332
  >>> indexes = await client.get_indexes()
@@ -375,20 +353,16 @@ class AsyncClient(BaseClient):
375
353
  """Gets a single index based on the uid of the index.
376
354
 
377
355
  Args:
378
-
379
356
  uid: The index's unique identifier.
380
357
 
381
358
  Returns:
382
-
383
359
  An AsyncIndex instance containing the information of the fetched index.
384
360
 
385
361
  Raises:
386
-
387
362
  MeilisearchCommunicationError: If there was an error communicating with the server.
388
363
  MeilisearchApiError: If the Meilisearch API returned an error.
389
364
 
390
365
  Examples:
391
-
392
366
  >>> from meilisearch_python_sdk import AsyncClient
393
367
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
394
368
  >>> index = await client.get_index()
@@ -401,21 +375,17 @@ class AsyncClient(BaseClient):
401
375
  Because no network call is made this method is not awaitable.
402
376
 
403
377
  Args:
404
-
405
378
  uid: The index's unique identifier.
406
379
  plugins: Optional plugins can be provided to extend functionality.
407
380
 
408
381
  Returns:
409
-
410
382
  An AsyncIndex instance.
411
383
 
412
384
  Raises:
413
-
414
385
  MeilisearchCommunicationError: If there was an error communicating with the server.
415
386
  MeilisearchApiError: If the Meilisearch API returned an error.
416
387
 
417
388
  Examples:
418
-
419
389
  >>> from meilisearch_python_sdk import AsyncClient
420
390
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
421
391
  >>> index = client.index("movies")
@@ -428,17 +398,14 @@ class AsyncClient(BaseClient):
428
398
  """Get stats for all indexes.
429
399
 
430
400
  Returns:
431
-
432
401
  Information about database size and all indexes.
433
402
  https://docs.meilisearch.com/reference/api/stats.html
434
403
 
435
404
  Raises:
436
-
437
405
  MeilisearchCommunicationError: If there was an error communicating with the server.
438
406
  MeilisearchApiError: If the Meilisearch API returned an error.
439
407
 
440
- Examples:
441
-
408
+ Examples
442
409
  >>> from meilisearch_python_sdk import AsyncClient
443
410
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
444
411
  >>> stats = await client.get_all_stats()
@@ -458,7 +425,6 @@ class AsyncClient(BaseClient):
458
425
  """Get an index, or create it if it doesn't exist.
459
426
 
460
427
  Args:
461
-
462
428
  uid: The index's unique identifier.
463
429
  primary_key: The primary key of the documents. Defaults to None.
464
430
  plugins: Optional plugins can be provided to extend functionality.
@@ -466,17 +432,14 @@ class AsyncClient(BaseClient):
466
432
  JsonDict
467
433
 
468
434
  Returns:
469
-
470
435
  An instance of AsyncIndex containing the information of the retrieved or newly created index.
471
436
 
472
437
  Raises:
473
-
474
438
  MeilisearchCommunicationError: If there was an error communicating with the server.
475
439
  MeilisearchApiError: If the Meilisearch API returned an error.MeilisearchTimeoutError: If the connection times out.
476
440
  MeilisearchTimeoutError: If the connection times out.
477
441
 
478
- Examples:
479
-
442
+ Examples
480
443
  >>> from meilisearch_python_sdk import AsyncClient
481
444
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
482
445
  >>> index = await client.get_or_create_index("movies")
@@ -495,21 +458,17 @@ class AsyncClient(BaseClient):
495
458
  """Creates a new API key.
496
459
 
497
460
  Args:
498
-
499
461
  key: The information to use in creating the key. Note that if an expires_at value
500
462
  is included it should be in UTC time.
501
463
 
502
464
  Returns:
503
-
504
465
  The new API key.
505
466
 
506
467
  Raises:
507
-
508
468
  MeilisearchCommunicationError: If there was an error communicating with the server.
509
469
  MeilisearchApiError: If the Meilisearch API returned an error.
510
470
 
511
- Examples:
512
-
471
+ Examples
513
472
  >>> from meilisearch_python_sdk import AsyncClient
514
473
  >>> from meilissearch_async_client.models.client import KeyCreate
515
474
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
@@ -530,20 +489,16 @@ class AsyncClient(BaseClient):
530
489
  """Deletes an API key.
531
490
 
532
491
  Args:
533
-
534
492
  key: The key or uid to delete.
535
493
 
536
494
  Returns:
537
-
538
495
  The Response status code. 204 signifies a successful delete.
539
496
 
540
497
  Raises:
541
-
542
498
  MeilisearchCommunicationError: If there was an error communicating with the server.
543
499
  MeilisearchApiError: If the Meilisearch API returned an error.
544
500
 
545
- Examples:
546
-
501
+ Examples
547
502
  >>> from meilisearch_python_sdk import AsyncClient
548
503
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
549
504
  >>> await client.delete_key("abc123")
@@ -553,24 +508,21 @@ class AsyncClient(BaseClient):
553
508
 
554
509
  async def get_keys(self, *, offset: int | None = None, limit: int | None = None) -> KeySearch:
555
510
  """Gets the Meilisearch API keys.
556
- Args:
557
511
 
512
+ Args:
558
513
  offset: Number of indexes to skip. The default of None will use the Meilisearch
559
514
  default.
560
515
  limit: Number of indexes to return. The default of None will use the Meilisearch
561
516
  default.
562
517
 
563
518
  Returns:
564
-
565
519
  API keys.
566
520
 
567
521
  Raises:
568
-
569
522
  MeilisearchCommunicationError: If there was an error communicating with the server.
570
523
  MeilisearchApiError: If the Meilisearch API returned an error.
571
524
 
572
- Examples:
573
-
525
+ Examples
574
526
  from meilisearch_python_sdk import AsyncClient
575
527
  async with AsyncClient("http://localhost.com", "masterKey") as client:
576
528
  keys = await client.get_keys()
@@ -584,20 +536,16 @@ class AsyncClient(BaseClient):
584
536
  """Gets information about a specific API key.
585
537
 
586
538
  Args:
587
-
588
539
  key: The key for which to retrieve the information.
589
540
 
590
541
  Returns:
591
-
592
542
  The API key, or `None` if the key is not found.
593
543
 
594
544
  Raises:
595
-
596
545
  MeilisearchCommunicationError: If there was an error communicating with the server.
597
546
  MeilisearchApiError: If the Meilisearch API returned an error.
598
547
 
599
- Examples:
600
-
548
+ Examples
601
549
  >>> from meilisearch_python_sdk import AsyncClient
602
550
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
603
551
  >>> keys = await client.get_key("abc123")
@@ -610,21 +558,17 @@ class AsyncClient(BaseClient):
610
558
  """Update an API key.
611
559
 
612
560
  Args:
613
-
614
561
  key: The information to use in updating the key. Note that if an expires_at value
615
562
  is included it should be in UTC time.
616
563
 
617
564
  Returns:
618
-
619
565
  The updated API key.
620
566
 
621
567
  Raises:
622
-
623
568
  MeilisearchCommunicationError: If there was an error communicating with the server.
624
569
  MeilisearchApiError: If the Meilisearch API returned an error.
625
570
 
626
- Examples:
627
-
571
+ Examples
628
572
  >>> from meilisearch_python_sdk import AsyncClient
629
573
  >>> from meilissearch_async_client.models.client import KeyUpdate
630
574
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
@@ -649,7 +593,6 @@ class AsyncClient(BaseClient):
649
593
  """Multi-index search.
650
594
 
651
595
  Args:
652
-
653
596
  queries: List of SearchParameters
654
597
  federation: If included a single search result with hits built from all queries will
655
598
  be returned. This parameter can only be used with Meilisearch >= v1.10.0. Defaults
@@ -658,16 +601,13 @@ class AsyncClient(BaseClient):
658
601
  JsonDict
659
602
 
660
603
  Returns:
661
-
662
604
  Results of the search
663
605
 
664
606
  Raises:
665
-
666
607
  MeilisearchCommunicationError: If there was an error communicating with the server.
667
608
  MeilisearchApiError: If the Meilisearch API returned an error.
668
609
 
669
- Examples:
670
-
610
+ Examples
671
611
  >>> from meilisearch_python_sdk import AsyncClient
672
612
  >>> from meilisearch_python_sdk.models.search import SearchParams
673
613
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
@@ -706,20 +646,16 @@ class AsyncClient(BaseClient):
706
646
  """Gets the index and returns all the index information rather than an AsyncIndex instance.
707
647
 
708
648
  Args:
709
-
710
649
  uid: The index's unique identifier.
711
650
 
712
651
  Returns:
713
-
714
652
  Index information rather than an AsyncIndex instance.
715
653
 
716
654
  Raises:
717
-
718
655
  MeilisearchCommunicationError: If there was an error communicating with the server.
719
656
  MeilisearchApiError: If the Meilisearch API returned an error.
720
657
 
721
- Examples:
722
-
658
+ Examples
723
659
  >>> from meilisearch_python_sdk import AsyncClient
724
660
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
725
661
  >>> index = await client.get_raw_index("movies")
@@ -735,8 +671,8 @@ class AsyncClient(BaseClient):
735
671
  self, *, offset: int | None = None, limit: int | None = None
736
672
  ) -> list[IndexInfo] | None:
737
673
  """Gets all the indexes.
738
- Args:
739
674
 
675
+ Args:
740
676
  offset: Number of indexes to skip. The default of None will use the Meilisearch
741
677
  default.
742
678
  limit: Number of indexes to return. The default of None will use the Meilisearch
@@ -745,16 +681,13 @@ class AsyncClient(BaseClient):
745
681
  Returns all the index information rather than an AsyncIndex instance.
746
682
 
747
683
  Returns:
748
-
749
684
  A list of the Index information rather than an AsyncIndex instances.
750
685
 
751
686
  Raises:
752
-
753
687
  MeilisearchCommunicationError: If there was an error communicating with the server.
754
688
  MeilisearchApiError: If the Meilisearch API returned an error.
755
689
 
756
- Examples:
757
-
690
+ Examples
758
691
  >>> from meilisearch_python_sdk import AsyncClient
759
692
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
760
693
  >>> index = await client.get_raw_indexes()
@@ -771,16 +704,13 @@ class AsyncClient(BaseClient):
771
704
  """Get the Meilisearch version.
772
705
 
773
706
  Returns:
774
-
775
707
  Information about the version of Meilisearch.
776
708
 
777
709
  Raises:
778
-
779
710
  MeilisearchCommunicationError: If there was an error communicating with the server.
780
711
  MeilisearchApiError: If the Meilisearch API returned an error.
781
712
 
782
- Examples:
783
-
713
+ Examples
784
714
  >>> from meilisearch_python_sdk import AsyncClient
785
715
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
786
716
  >>> version = await client.get_version()
@@ -793,16 +723,13 @@ class AsyncClient(BaseClient):
793
723
  """Get health of the Meilisearch server.
794
724
 
795
725
  Returns:
796
-
797
726
  The status of the Meilisearch server.
798
727
 
799
728
  Raises:
800
-
801
729
  MeilisearchCommunicationError: If there was an error communicating with the server.
802
730
  MeilisearchApiError: If the Meilisearch API returned an error.
803
731
 
804
- Examples:
805
-
732
+ Examples
806
733
  >>> from meilisearch_python_sdk import AsyncClient
807
734
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
808
735
  >>> health = await client.get_health()
@@ -815,20 +742,16 @@ class AsyncClient(BaseClient):
815
742
  """Swap two indexes.
816
743
 
817
744
  Args:
818
-
819
745
  indexes: A list of tuples, each tuple should contain the indexes to swap.
820
746
 
821
747
  Returns:
822
-
823
748
  The details of the task.
824
749
 
825
750
  Raises:
826
-
827
751
  MeilisearchCommunicationError: If there was an error communicating with the server.
828
752
  MeilisearchApiError: If the Meilisearch API returned an error.
829
753
 
830
- Examples:
831
-
754
+ Examples
832
755
  >>> from meilisearch_python_sdk import AsyncClient
833
756
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
834
757
  >>> index = await client.swap_indexes([("index_a", "index_b")])
@@ -855,7 +778,6 @@ class AsyncClient(BaseClient):
855
778
  Defaults to cancelling all tasks.
856
779
 
857
780
  Args:
858
-
859
781
  uids: A list of task UIDs to cancel.
860
782
  index_uids: A list of index UIDs for which to cancel tasks.
861
783
  statuses: A list of statuses to cancel.
@@ -866,17 +788,14 @@ class AsyncClient(BaseClient):
866
788
  after_finished_at: Cancel tasks that were finished after the specified date time.
867
789
 
868
790
  Returns:
869
-
870
791
  The details of the task
871
792
 
872
793
  Raises:
873
-
874
794
  MeilisearchCommunicationError: If there was an error communicating with the server.
875
795
  MeilisearchApiError: If the Meilisearch API returned an error.
876
796
  MeilisearchTimeoutError: If the connection times out.
877
797
 
878
- Examples:
879
-
798
+ Examples
880
799
  >>> from meilisearch_python_sdk import AsyncClient
881
800
  >>>
882
801
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
@@ -898,21 +817,17 @@ class AsyncClient(BaseClient):
898
817
  """Get a single task from it's task id.
899
818
 
900
819
  Args:
901
-
902
820
  task_id: Identifier of the task to retrieve.
903
821
 
904
822
  Returns:
905
-
906
823
  Results of a task.
907
824
 
908
825
  Raises:
909
-
910
826
  MeilisearchCommunicationError: If there was an error communicating with the server.
911
827
  MeilisearchApiError: If the Meilisearch API returned an error.
912
828
  MeilisearchTimeoutError: If the connection times out.
913
829
 
914
- Examples:
915
-
830
+ Examples
916
831
  >>> from meilisearch_python_sdk import AsyncClient
917
832
  >>> from meilisearch_python_sdk.task import get_task
918
833
  >>>
@@ -938,7 +853,6 @@ class AsyncClient(BaseClient):
938
853
  Defaults to deleting all tasks.
939
854
 
940
855
  Args:
941
-
942
856
  uids: A list of task UIDs to delete.
943
857
  index_uids: A list of index UIDs for which to delete tasks.
944
858
  statuses: A list of statuses to delete.
@@ -949,17 +863,14 @@ class AsyncClient(BaseClient):
949
863
  after_finished_at: Delete tasks that were finished after the specified date time.
950
864
 
951
865
  Returns:
952
-
953
866
  The details of the task
954
867
 
955
868
  Raises:
956
-
957
869
  MeilisearchCommunicationError: If there was an error communicating with the server.
958
870
  MeilisearchApiError: If the Meilisearch API returned an error.
959
871
  MeilisearchTimeoutError: If the connection times out.
960
872
 
961
- Examples:
962
-
873
+ Examples
963
874
  >>> from meilisearch_python_sdk import AsyncClient
964
875
  >>> from meilisearch_python_sdk.task import delete_tasks
965
876
  >>>
@@ -987,23 +898,19 @@ class AsyncClient(BaseClient):
987
898
  """Get multiple tasks.
988
899
 
989
900
  Args:
990
-
991
901
  index_ids: A list of index UIDs for which to get the tasks. If provided this will get the
992
902
  tasks only for the specified indexes, if not all tasks will be returned. Default = None
993
903
  types: Specify specific task types to retrieve. Default = None
994
904
 
995
905
  Returns:
996
-
997
906
  Task statuses.
998
907
 
999
908
  Raises:
1000
-
1001
909
  MeilisearchCommunicationError: If there was an error communicating with the server.
1002
910
  MeilisearchApiError: If the Meilisearch API returned an error.
1003
911
  MeilisearchTimeoutError: If the connection times out.
1004
912
 
1005
- Examples:
1006
-
913
+ Examples
1007
914
  >>> from meilisearch_python_sdk import AsyncClient
1008
915
  >>>
1009
916
  >>> async with AsyncClient("http://localhost.com", "masterKey") as client:
@@ -1022,7 +929,6 @@ class AsyncClient(BaseClient):
1022
929
  """Wait until Meilisearch processes a task, and get its status.
1023
930
 
1024
931
  Args:
1025
-
1026
932
  task_id: Identifier of the task to retrieve.
1027
933
  timeout_in_ms: Amount of time in milliseconds to wait before raising a
1028
934
  MeilisearchTimeoutError. `None` can also be passed to wait indefinitely. Be aware that
@@ -1032,18 +938,15 @@ class AsyncClient(BaseClient):
1032
938
  has a failed status. Defaults to False.
1033
939
 
1034
940
  Returns:
1035
-
1036
941
  Details of the processed update status.
1037
942
 
1038
943
  Raises:
1039
-
1040
944
  MeilisearchCommunicationError: If there was an error communicating with the server.
1041
945
  MeilisearchApiError: If the Meilisearch API returned an error.
1042
946
  MeilisearchTimeoutError: If the connection times out.
1043
947
  MeilisearchTaskFailedError: If `raise_for_status` is `True` and a task has a failed status.
1044
948
 
1045
- Examples:
1046
-
949
+ Examples
1047
950
  >>> from meilisearch_python_sdk import AsyncClient
1048
951
  >>> >>> documents = [
1049
952
  >>> {"id": 1, "title": "Movie 1", "genre": "comedy"},
@@ -1080,7 +983,6 @@ class Client(BaseClient):
1080
983
  """Class initializer.
1081
984
 
1082
985
  Args:
1083
-
1084
986
  url: The url to the Meilisearch API (ex: http://localhost:7700)
1085
987
  api_key: The optional API key for Meilisearch. Defaults to None.
1086
988
  timeout: The amount of time in seconds that the client will wait for a response before
@@ -1108,16 +1010,13 @@ class Client(BaseClient):
1108
1010
  """Trigger the creation of a Meilisearch dump.
1109
1011
 
1110
1012
  Returns:
1111
-
1112
1013
  The details of the task.
1113
1014
 
1114
1015
  Raises:
1115
-
1116
1016
  MeilisearchCommunicationError: If there was an error communicating with the server.
1117
1017
  MeilisearchApiError: If the Meilisearch API returned an error.
1118
1018
 
1119
- Examples:
1120
-
1019
+ Examples
1121
1020
  >>> from meilisearch_python_sdk import Client
1122
1021
  >>> client = Client("http://localhost.com", "masterKey")
1123
1022
  >>> client.create_dump()
@@ -1140,7 +1039,6 @@ class Client(BaseClient):
1140
1039
  """Creates a new index.
1141
1040
 
1142
1041
  Args:
1143
-
1144
1042
  uid: The index's unique identifier.
1145
1043
  primary_key: The primary key of the documents. Defaults to None.
1146
1044
  settings: Settings for the index. The settings can also be updated independently of
@@ -1159,16 +1057,13 @@ class Client(BaseClient):
1159
1057
  JsonDict
1160
1058
 
1161
1059
  Returns:
1162
-
1163
1060
  An instance of Index containing the information of the newly created index.
1164
1061
 
1165
1062
  Raises:
1166
-
1167
1063
  MeilisearchCommunicationError: If there was an error communicating with the server.
1168
1064
  MeilisearchApiError: If the Meilisearch API returned an error.
1169
1065
 
1170
- Examples:
1171
-
1066
+ Examples
1172
1067
  >>> from meilisearch_python_sdk import Client
1173
1068
  >>> client = Client("http://localhost.com", "masterKey")
1174
1069
  >>> index = client.create_index("movies")
@@ -1189,16 +1084,13 @@ class Client(BaseClient):
1189
1084
  """Trigger the creation of a Meilisearch snapshot.
1190
1085
 
1191
1086
  Returns:
1192
-
1193
1087
  The details of the task.
1194
1088
 
1195
1089
  Raises:
1196
-
1197
1090
  MeilisearchCommunicationError: If there was an error communicating with the server.
1198
1091
  MeilisearchApiError: If the Meilisearch API returned an error.
1199
1092
 
1200
- Examples:
1201
-
1093
+ Examples
1202
1094
  >>> from meilisearch_python_sdk import Client
1203
1095
  >>> client = Client("http://localhost.com", "masterKey")
1204
1096
  >>> client.create_snapshot()
@@ -1211,20 +1103,16 @@ class Client(BaseClient):
1211
1103
  """Deletes an index if it already exists.
1212
1104
 
1213
1105
  Args:
1214
-
1215
1106
  uid: The index's unique identifier.
1216
1107
 
1217
1108
  Returns:
1218
-
1219
1109
  True if an index was deleted for False if not.
1220
1110
 
1221
1111
  Raises:
1222
-
1223
1112
  MeilisearchCommunicationError: If there was an error communicating with the server.
1224
1113
  MeilisearchApiError: If the Meilisearch API returned an error.
1225
1114
 
1226
- Examples:
1227
-
1115
+ Examples
1228
1116
  >>> from meilisearch_python_sdk import Client
1229
1117
  >>> client = Client("http://localhost.com", "masterKey")
1230
1118
  >>> client.delete_index_if_exists()
@@ -1240,23 +1128,19 @@ class Client(BaseClient):
1240
1128
  ) -> list[Index] | None:
1241
1129
  """Get all indexes.
1242
1130
  Args:
1243
-
1244
1131
  offset: Number of indexes to skip. The default of None will use the Meilisearch
1245
1132
  default.
1246
1133
  limit: Number of indexes to return. The default of None will use the Meilisearch
1247
1134
  default.
1248
1135
 
1249
1136
  Returns:
1250
-
1251
1137
  A list of all indexes.
1252
1138
 
1253
1139
  Raises:
1254
-
1255
1140
  MeilisearchCommunicationError: If there was an error communicating with the server.
1256
1141
  MeilisearchApiError: If the Meilisearch API returned an error.
1257
1142
 
1258
- Examples:
1259
-
1143
+ Examples
1260
1144
  >>> from meilisearch_python_sdk import Client
1261
1145
  >>> client = Client("http://localhost.com", "masterKey") as client:
1262
1146
  >>> indexes = client.get_indexes()
@@ -1283,20 +1167,16 @@ class Client(BaseClient):
1283
1167
  """Gets a single index based on the uid of the index.
1284
1168
 
1285
1169
  Args:
1286
-
1287
1170
  uid: The index's unique identifier.
1288
1171
 
1289
1172
  Returns:
1290
-
1291
1173
  An Index instance containing the information of the fetched index.
1292
1174
 
1293
1175
  Raises:
1294
-
1295
1176
  MeilisearchCommunicationError: If there was an error communicating with the server.
1296
1177
  MeilisearchApiError: If the Meilisearch API returned an error.
1297
1178
 
1298
- Examples:
1299
-
1179
+ Examples
1300
1180
  >>> from meilisearch_python_sdk import Client
1301
1181
  >>> client = Client("http://localhost.com", "masterKey")
1302
1182
  >>> index = client.get_index()
@@ -1307,21 +1187,17 @@ class Client(BaseClient):
1307
1187
  """Create a local reference to an index identified by UID, without making an HTTP call.
1308
1188
 
1309
1189
  Args:
1310
-
1311
1190
  uid: The index's unique identifier.
1312
1191
  plugins: Optional plugins can be provided to extend functionality.
1313
1192
 
1314
1193
  Returns:
1315
-
1316
1194
  An Index instance.
1317
1195
 
1318
1196
  Raises:
1319
-
1320
1197
  MeilisearchCommunicationError: If there was an error communicating with the server.
1321
1198
  MeilisearchApiError: If the Meilisearch API returned an error.
1322
1199
 
1323
- Examples:
1324
-
1200
+ Examples
1325
1201
  >>> from meilisearch_python_sdk import Client
1326
1202
  >>> client = Client("http://localhost.com", "masterKey")
1327
1203
  >>> index = client.index("movies")
@@ -1332,17 +1208,14 @@ class Client(BaseClient):
1332
1208
  """Get stats for all indexes.
1333
1209
 
1334
1210
  Returns:
1335
-
1336
1211
  Information about database size and all indexes.
1337
1212
  https://docs.meilisearch.com/reference/api/stats.html
1338
1213
 
1339
1214
  Raises:
1340
-
1341
1215
  MeilisearchCommunicationError: If there was an error communicating with the server.
1342
1216
  MeilisearchApiError: If the Meilisearch API returned an error.
1343
1217
 
1344
- Examples:
1345
-
1218
+ Examples
1346
1219
  >>> from meilisearch_python_sdk import Client
1347
1220
  >>> client = Client("http://localhost.com", "masterKey")
1348
1221
  >>> stats = client.get_all_stats()
@@ -1362,7 +1235,6 @@ class Client(BaseClient):
1362
1235
  """Get an index, or create it if it doesn't exist.
1363
1236
 
1364
1237
  Args:
1365
-
1366
1238
  uid: The index's unique identifier.
1367
1239
  primary_key: The primary key of the documents. Defaults to None.
1368
1240
  plugins: Optional plugins can be provided to extend functionality.
@@ -1370,17 +1242,14 @@ class Client(BaseClient):
1370
1242
  JsonDict
1371
1243
 
1372
1244
  Returns:
1373
-
1374
1245
  An instance of Index containing the information of the retrieved or newly created index.
1375
1246
 
1376
1247
  Raises:
1377
-
1378
1248
  MeilisearchCommunicationError: If there was an error communicating with the server.
1379
1249
  MeilisearchApiError: If the Meilisearch API returned an error.MeilisearchTimeoutError: If the connection times out.
1380
1250
  MeilisearchTimeoutError: If the connection times out.
1381
1251
 
1382
- Examples:
1383
-
1252
+ Examples
1384
1253
  >>> from meilisearch_python_sdk import Client
1385
1254
  >>> client = Client("http://localhost.com", "masterKey")
1386
1255
  >>> index = client.get_or_create_index("movies")
@@ -1399,21 +1268,17 @@ class Client(BaseClient):
1399
1268
  """Creates a new API key.
1400
1269
 
1401
1270
  Args:
1402
-
1403
1271
  key: The information to use in creating the key. Note that if an expires_at value
1404
1272
  is included it should be in UTC time.
1405
1273
 
1406
1274
  Returns:
1407
-
1408
1275
  The new API key.
1409
1276
 
1410
1277
  Raises:
1411
-
1412
1278
  MeilisearchCommunicationError: If there was an error communicating with the server.
1413
1279
  MeilisearchApiError: If the Meilisearch API returned an error.
1414
1280
 
1415
- Examples:
1416
-
1281
+ Examples
1417
1282
  >>> from meilisearch_python_sdk import Client
1418
1283
  >>> from meilissearch_async_client.models.client import KeyCreate
1419
1284
  >>> client = Client("http://localhost.com", "masterKey")
@@ -1434,20 +1299,16 @@ class Client(BaseClient):
1434
1299
  """Deletes an API key.
1435
1300
 
1436
1301
  Args:
1437
-
1438
1302
  key: The key or uid to delete.
1439
1303
 
1440
1304
  Returns:
1441
-
1442
1305
  The Response status code. 204 signifies a successful delete.
1443
1306
 
1444
1307
  Raises:
1445
-
1446
1308
  MeilisearchCommunicationError: If there was an error communicating with the server.
1447
1309
  MeilisearchApiError: If the Meilisearch API returned an error.
1448
1310
 
1449
- Examples:
1450
-
1311
+ Examples
1451
1312
  >>> from meilisearch_python_sdk import Client
1452
1313
  >>> client = Client("http://localhost.com", "masterKey")
1453
1314
  >>> client.delete_key("abc123")
@@ -1458,23 +1319,19 @@ class Client(BaseClient):
1458
1319
  def get_keys(self, *, offset: int | None = None, limit: int | None = None) -> KeySearch:
1459
1320
  """Gets the Meilisearch API keys.
1460
1321
  Args:
1461
-
1462
1322
  offset: Number of indexes to skip. The default of None will use the Meilisearch
1463
1323
  default.
1464
1324
  limit: Number of indexes to return. The default of None will use the Meilisearch
1465
1325
  default.
1466
1326
 
1467
1327
  Returns:
1468
-
1469
1328
  API keys.
1470
1329
 
1471
1330
  Raises:
1472
-
1473
1331
  MeilisearchCommunicationError: If there was an error communicating with the server.
1474
1332
  MeilisearchApiError: If the Meilisearch API returned an error.
1475
1333
 
1476
- Examples:
1477
-
1334
+ Examples
1478
1335
  >>> from meilisearch_python_sdk import Client
1479
1336
  >>> client = AsyncClient("http://localhost.com", "masterKey")
1480
1337
  >>> keys = client.get_keys()
@@ -1488,20 +1345,16 @@ class Client(BaseClient):
1488
1345
  """Gets information about a specific API key.
1489
1346
 
1490
1347
  Args:
1491
-
1492
1348
  key: The key for which to retrieve the information.
1493
1349
 
1494
1350
  Returns:
1495
-
1496
1351
  The API key, or `None` if the key is not found.
1497
1352
 
1498
1353
  Raises:
1499
-
1500
1354
  MeilisearchCommunicationError: If there was an error communicating with the server.
1501
1355
  MeilisearchApiError: If the Meilisearch API returned an error.
1502
1356
 
1503
- Examples:
1504
-
1357
+ Examples
1505
1358
  >>> from meilisearch_python_sdk import Client
1506
1359
  >>> client = Client("http://localhost.com", "masterKey")
1507
1360
  >>> keys = client.get_key("abc123")
@@ -1514,21 +1367,17 @@ class Client(BaseClient):
1514
1367
  """Update an API key.
1515
1368
 
1516
1369
  Args:
1517
-
1518
1370
  key: The information to use in updating the key. Note that if an expires_at value
1519
1371
  is included it should be in UTC time.
1520
1372
 
1521
1373
  Returns:
1522
-
1523
1374
  The updated API key.
1524
1375
 
1525
1376
  Raises:
1526
-
1527
1377
  MeilisearchCommunicationError: If there was an error communicating with the server.
1528
1378
  MeilisearchApiError: If the Meilisearch API returned an error.
1529
1379
 
1530
- Examples:
1531
-
1380
+ Examples
1532
1381
  >>> from meilisearch_python_sdk import Client
1533
1382
  >>> from meilissearch_async_client.models.client import KeyUpdate
1534
1383
  >>> client = Client("http://localhost.com", "masterKey")
@@ -1553,7 +1402,6 @@ class Client(BaseClient):
1553
1402
  """Multi-index search.
1554
1403
 
1555
1404
  Args:
1556
-
1557
1405
  queries: List of SearchParameters
1558
1406
  federation: If included a single search result with hits built from all queries will
1559
1407
  be returned. This parameter can only be used with Meilisearch >= v1.10.0. Defaults
@@ -1562,16 +1410,13 @@ class Client(BaseClient):
1562
1410
  JsonDict
1563
1411
 
1564
1412
  Returns:
1565
-
1566
1413
  Results of the search
1567
1414
 
1568
1415
  Raises:
1569
-
1570
1416
  MeilisearchCommunicationError: If there was an error communicating with the server.
1571
1417
  MeilisearchApiError: If the Meilisearch API returned an error.
1572
1418
 
1573
- Examples:
1574
-
1419
+ Examples
1575
1420
  >>> from meilisearch_python_sdk import Client
1576
1421
  >>> from meilisearch_python_sdk.models.search import SearchParams
1577
1422
  >>> client = Client("http://localhost.com", "masterKey")
@@ -1610,20 +1455,16 @@ class Client(BaseClient):
1610
1455
  """Gets the index and returns all the index information rather than an Index instance.
1611
1456
 
1612
1457
  Args:
1613
-
1614
1458
  uid: The index's unique identifier.
1615
1459
 
1616
1460
  Returns:
1617
-
1618
1461
  Index information rather than an Index instance.
1619
1462
 
1620
1463
  Raises:
1621
-
1622
1464
  MeilisearchCommunicationError: If there was an error communicating with the server.
1623
1465
  MeilisearchApiError: If the Meilisearch API returned an error.
1624
1466
 
1625
- Examples:
1626
-
1467
+ Examples
1627
1468
  >>> from meilisearch_python_sdk import Client
1628
1469
  >>> client = Client("http://localhost.com", "masterKey")
1629
1470
  >>> index = client.get_raw_index("movies")
@@ -1640,7 +1481,6 @@ class Client(BaseClient):
1640
1481
  ) -> list[IndexInfo] | None:
1641
1482
  """Gets all the indexes.
1642
1483
  Args:
1643
-
1644
1484
  offset: Number of indexes to skip. The default of None will use the Meilisearch
1645
1485
  default.
1646
1486
  limit: Number of indexes to return. The default of None will use the Meilisearch
@@ -1649,16 +1489,13 @@ class Client(BaseClient):
1649
1489
  Returns all the index information rather than an AsyncIndex instance.
1650
1490
 
1651
1491
  Returns:
1652
-
1653
1492
  A list of the Index information rather than an AsyncIndex instances.
1654
1493
 
1655
1494
  Raises:
1656
-
1657
1495
  MeilisearchCommunicationError: If there was an error communicating with the server.
1658
1496
  MeilisearchApiError: If the Meilisearch API returned an error.
1659
1497
 
1660
- Examples:
1661
-
1498
+ Examples
1662
1499
  >>> from meilisearch_python_sdk import Client
1663
1500
  >>> client = Client("http://localhost.com", "masterKey")
1664
1501
  >>> index = client.get_raw_indexes()
@@ -1675,16 +1512,13 @@ class Client(BaseClient):
1675
1512
  """Get the Meilisearch version.
1676
1513
 
1677
1514
  Returns:
1678
-
1679
1515
  Information about the version of Meilisearch.
1680
1516
 
1681
1517
  Raises:
1682
-
1683
1518
  MeilisearchCommunicationError: If there was an error communicating with the server.
1684
1519
  MeilisearchApiError: If the Meilisearch API returned an error.
1685
1520
 
1686
- Examples:
1687
-
1521
+ Examples
1688
1522
  >>> from meilisearch_python_sdk import Client
1689
1523
  >>> client = Client("http://localhost.com", "masterKey")
1690
1524
  >>> version = client.get_version()
@@ -1697,16 +1531,13 @@ class Client(BaseClient):
1697
1531
  """Get health of the Meilisearch server.
1698
1532
 
1699
1533
  Returns:
1700
-
1701
1534
  The status of the Meilisearch server.
1702
1535
 
1703
1536
  Raises:
1704
-
1705
1537
  MeilisearchCommunicationError: If there was an error communicating with the server.
1706
1538
  MeilisearchApiError: If the Meilisearch API returned an error.
1707
1539
 
1708
- Examples:
1709
-
1540
+ Examples
1710
1541
  >>> from meilisearch_python_sdk import Client
1711
1542
  >>> client = Client("http://localhost.com", "masterKey")
1712
1543
  >>> health = client.get_health()
@@ -1719,20 +1550,16 @@ class Client(BaseClient):
1719
1550
  """Swap two indexes.
1720
1551
 
1721
1552
  Args:
1722
-
1723
1553
  indexes: A list of tuples, each tuple should contain the indexes to swap.
1724
1554
 
1725
1555
  Returns:
1726
-
1727
1556
  The details of the task.
1728
1557
 
1729
1558
  Raises:
1730
-
1731
1559
  MeilisearchCommunicationError: If there was an error communicating with the server.
1732
1560
  MeilisearchApiError: If the Meilisearch API returned an error.
1733
1561
 
1734
- Examples:
1735
-
1562
+ Examples
1736
1563
  >>> from meilisearch_python_sdk import Client
1737
1564
  >>> client = Client("http://localhost.com", "masterKey")
1738
1565
  >>> index = client.swap_indexes([("index_a", "index_b")])
@@ -1759,7 +1586,6 @@ class Client(BaseClient):
1759
1586
  Defaults to cancelling all tasks.
1760
1587
 
1761
1588
  Args:
1762
-
1763
1589
  uids: A list of task UIDs to cancel.
1764
1590
  index_uids: A list of index UIDs for which to cancel tasks.
1765
1591
  statuses: A list of statuses to cancel.
@@ -1770,17 +1596,14 @@ class Client(BaseClient):
1770
1596
  after_finished_at: Cancel tasks that were finished after the specified date time.
1771
1597
 
1772
1598
  Returns:
1773
-
1774
1599
  The details of the task
1775
1600
 
1776
1601
  Raises:
1777
-
1778
1602
  MeilisearchCommunicationError: If there was an error communicating with the server.
1779
1603
  MeilisearchApiError: If the Meilisearch API returned an error.
1780
1604
  MeilisearchTimeoutError: If the connection times out.
1781
1605
 
1782
- Examples:
1783
-
1606
+ Examples
1784
1607
  >>> from meilisearch_python_sdk import Client
1785
1608
  >>> from meilisearch_python_sdk.task import cancel_tasks
1786
1609
  >>>
@@ -1816,7 +1639,6 @@ class Client(BaseClient):
1816
1639
  Defaults to deleting all tasks.
1817
1640
 
1818
1641
  Args:
1819
-
1820
1642
  uids: A list of task UIDs to delete.
1821
1643
  index_uids: A list of index UIDs for which to delete tasks.
1822
1644
  statuses: A list of statuses to delete.
@@ -1827,17 +1649,14 @@ class Client(BaseClient):
1827
1649
  after_finished_at: Delete tasks that were finished after the specified date time.
1828
1650
 
1829
1651
  Returns:
1830
-
1831
1652
  The details of the task
1832
1653
 
1833
1654
  Raises:
1834
-
1835
1655
  MeilisearchCommunicationError: If there was an error communicating with the server.
1836
1656
  MeilisearchApiError: If the Meilisearch API returned an error.
1837
1657
  MeilisearchTimeoutError: If the connection times out.
1838
1658
 
1839
- Examples:
1840
-
1659
+ Examples
1841
1660
  >>> from meilisearch_python_sdk import Client
1842
1661
  >>>
1843
1662
  >>> client = Client("http://localhost.com", "masterKey")
@@ -1859,21 +1678,17 @@ class Client(BaseClient):
1859
1678
  """Get a single task from it's task id.
1860
1679
 
1861
1680
  Args:
1862
-
1863
1681
  task_id: Identifier of the task to retrieve.
1864
1682
 
1865
1683
  Returns:
1866
-
1867
1684
  Results of a task.
1868
1685
 
1869
1686
  Raises:
1870
-
1871
1687
  MeilisearchCommunicationError: If there was an error communicating with the server.
1872
1688
  MeilisearchApiError: If the Meilisearch API returned an error.
1873
1689
  MeilisearchTimeoutError: If the connection times out.
1874
1690
 
1875
- Examples:
1876
-
1691
+ Examples
1877
1692
  >>> from meilisearch_python_sdk import Client
1878
1693
  >>>
1879
1694
  >>> client = AsyncClient("http://localhost.com", "masterKey")
@@ -1890,23 +1705,19 @@ class Client(BaseClient):
1890
1705
  """Get multiple tasks.
1891
1706
 
1892
1707
  Args:
1893
-
1894
1708
  index_ids: A list of index UIDs for which to get the tasks. If provided this will get the
1895
1709
  tasks only for the specified indexes, if not all tasks will be returned. Default = None
1896
1710
  types: Specify specific task types to retrieve. Default = None
1897
1711
 
1898
1712
  Returns:
1899
-
1900
1713
  Task statuses.
1901
1714
 
1902
1715
  Raises:
1903
-
1904
1716
  MeilisearchCommunicationError: If there was an error communicating with the server.
1905
1717
  MeilisearchApiError: If the Meilisearch API returned an error.
1906
1718
  MeilisearchTimeoutError: If the connection times out.
1907
1719
 
1908
- Examples:
1909
-
1720
+ Examples
1910
1721
  >>> from meilisearch_python_sdk import Client
1911
1722
  >>>
1912
1723
  >>> client = Client("http://localhost.com", "masterKey")
@@ -1925,8 +1736,6 @@ class Client(BaseClient):
1925
1736
  """Wait until Meilisearch processes a task, and get its status.
1926
1737
 
1927
1738
  Args:
1928
-
1929
- client: An httpx HttpxClient or meilisearch_python_sdk Client instance.
1930
1739
  task_id: Identifier of the task to retrieve.
1931
1740
  timeout_in_ms: Amount of time in milliseconds to wait before raising a
1932
1741
  MeilisearchTimeoutError. `None` can also be passed to wait indefinitely. Be aware that
@@ -1936,18 +1745,15 @@ class Client(BaseClient):
1936
1745
  has a failed status. Defaults to False.
1937
1746
 
1938
1747
  Returns:
1939
-
1940
1748
  Details of the processed update status.
1941
1749
 
1942
1750
  Raises:
1943
-
1944
1751
  MeilisearchCommunicationError: If there was an error communicating with the server.
1945
1752
  MeilisearchApiError: If the Meilisearch API returned an error.
1946
1753
  MeilisearchTimeoutError: If the connection times out.
1947
1754
  MeilisearchTaskFailedError: If `raise_for_status` is `True` and a task has a failed status.
1948
1755
 
1949
- Examples:
1950
-
1756
+ Examples
1951
1757
  >>> from meilisearch_python_sdk import Client
1952
1758
  >>> >>> documents = [
1953
1759
  >>> {"id": 1, "title": "Movie 1", "genre": "comedy"},