{"id":13721471,"url":"https://github.com/meilisearch/meilisearch-python","last_synced_at":"2025-05-07T13:33:04.024Z","repository":{"id":37489393,"uuid":"225885766","full_name":"meilisearch/meilisearch-python","owner":"meilisearch","description":"Python wrapper for the Meilisearch API","archived":false,"fork":false,"pushed_at":"2025-05-01T04:43:28.000Z","size":9311,"stargazers_count":504,"open_issues_count":21,"forks_count":90,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-05-04T04:09:36.949Z","etag":null,"topics":["client","meilisearch","sdk"],"latest_commit_sha":null,"homepage":"https://meilisearch.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/meilisearch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-04T14:26:31.000Z","updated_at":"2025-05-03T17:40:38.000Z","dependencies_parsed_at":"2022-07-14T04:50:33.277Z","dependency_job_id":"22936d14-4c8d-45ef-acf4-70da7d8d4638","html_url":"https://github.com/meilisearch/meilisearch-python","commit_stats":{"total_commits":1193,"total_committers":68,"mean_commits":"17.544117647058822","dds":0.8239731768650461,"last_synced_commit":"1a5272161d1abbadbe04805c46309f3b43dfb74e"},"previous_names":[],"tags_count":59,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meilisearch%2Fmeilisearch-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meilisearch%2Fmeilisearch-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meilisearch%2Fmeilisearch-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meilisearch%2Fmeilisearch-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meilisearch","download_url":"https://codeload.github.com/meilisearch/meilisearch-python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252887057,"owners_count":21819838,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["client","meilisearch","sdk"],"created_at":"2024-08-03T01:01:17.503Z","updated_at":"2025-05-07T13:33:04.007Z","avatar_url":"https://github.com/meilisearch.png","language":"Python","funding_links":[],"categories":["Integrations"],"sub_categories":["Official Integrations"],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/meilisearch/integration-guides/main/assets/logos/meilisearch_python.svg\" alt=\"Meilisearch-Python\" width=\"200\" height=\"200\" /\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eMeilisearch Python\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003e\n  \u003ca href=\"https://github.com/meilisearch/meilisearch\"\u003eMeilisearch\u003c/a\u003e |\n  \u003ca href=\"https://www.meilisearch.com/cloud?utm_campaign=oss\u0026utm_source=github\u0026utm_medium=meilisearch-python\"\u003eMeilisearch Cloud\u003c/a\u003e |\n  \u003ca href=\"https://www.meilisearch.com/docs\"\u003eDocumentation\u003c/a\u003e |\n  \u003ca href=\"https://discord.meilisearch.com\"\u003eDiscord\u003c/a\u003e |\n  \u003ca href=\"https://roadmap.meilisearch.com/tabs/1-under-consideration\"\u003eRoadmap\u003c/a\u003e |\n  \u003ca href=\"https://www.meilisearch.com\"\u003eWebsite\u003c/a\u003e |\n  \u003ca href=\"https://www.meilisearch.com/docs/faq\"\u003eFAQ\u003c/a\u003e\n\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://badge.fury.io/py/meilisearch\"\u003e\u003cimg src=\"https://badge.fury.io/py/meilisearch.svg\" alt=\"PyPI version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/meilisearch/meilisearch-python/actions\"\u003e\u003cimg src=\"https://github.com/meilisearch/meilisearch-python/workflows/Tests/badge.svg\" alt=\"Test Status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/meilisearch/meilisearch-python/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-informational\" alt=\"License\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://ms-bors.herokuapp.com/repositories/57\"\u003e\u003cimg src=\"https://bors.tech/images/badge_small.svg\" alt=\"Bors enabled\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e⚡ The Meilisearch API client written for Python 🐍\u003c/p\u003e\n\n**Meilisearch Python** is the Meilisearch API client for Python developers.\n\n**Meilisearch** is an open-source search engine. [Learn more about Meilisearch.](https://github.com/meilisearch/meilisearch)\n\n## Table of Contents \u003c!-- omit in TOC --\u003e\n\n- [📖 Documentation](#-documentation)\n- [🔧 Installation](#-installation)\n- [🚀 Getting started](#-getting-started)\n- [🤖 Compatibility with Meilisearch](#-compatibility-with-meilisearch)\n- [💡 Learn more](#-learn-more)\n- [⚙️ Contributing](#️-contributing)\n\n## 📖 Documentation\n\nTo learn more about Meilisearch Python, refer to the in-depth [Meilisearch Python documentation](https://meilisearch.github.io/meilisearch-python/). To learn more about Meilisearch in general, refer to our [documentation](https://www.meilisearch.com/docs/learn/getting_started/quick_start) or our [API reference](https://www.meilisearch.com/docs/reference/api/overview).\n\n## 🔧 Installation\n\n**Note**: Python 3.8+ is required.\n\nWith `pip3` in command line:\n\n```bash\npip3 install meilisearch\n```\n\n### Run Meilisearch \u003c!-- omit in toc --\u003e\n\n⚡️ **Launch, scale, and streamline in minutes with Meilisearch Cloud**—no maintenance, no commitment, cancel anytime. [Try it free now](https://cloud.meilisearch.com/login?utm_campaign=oss\u0026utm_source=github\u0026utm_medium=meilisearch-python).\n\n🪨  Prefer to self-host? [Download and deploy](https://www.meilisearch.com/docs/learn/self_hosted/getting_started_with_self_hosted_meilisearch?utm_campaign=oss\u0026utm_source=github\u0026utm_medium=meilisearch-python) our fast, open-source search engine on your own infrastructure.\n\n## 🚀 Getting started\n\n#### Add Documents \u003c!-- omit in toc --\u003e\n\n```python\nimport meilisearch\n\nclient = meilisearch.Client('http://127.0.0.1:7700', 'masterKey')\n\n# An index is where the documents are stored.\nindex = client.index('movies')\n\ndocuments = [\n      { 'id': 1, 'title': 'Carol', 'genres': ['Romance', 'Drama'] },\n      { 'id': 2, 'title': 'Wonder Woman', 'genres': ['Action', 'Adventure'] },\n      { 'id': 3, 'title': 'Life of Pi', 'genres': ['Adventure', 'Drama'] },\n      { 'id': 4, 'title': 'Mad Max: Fury Road', 'genres': ['Adventure', 'Science Fiction'] },\n      { 'id': 5, 'title': 'Moana', 'genres': ['Fantasy', 'Action']},\n      { 'id': 6, 'title': 'Philadelphia', 'genres': ['Drama'] },\n]\n\n# If the index 'movies' does not exist, Meilisearch creates it when you first add the documents.\nindex.add_documents(documents) # =\u003e { \"uid\": 0 }\n```\n\nWith the task `uid`, you can check the status (`enqueued`, `canceled`, `processing`, `succeeded` or `failed`) of your documents addition using the [task](https://www.meilisearch.com/docs/reference/api/tasks#get-tasks).\n\n#### Basic Search \u003c!-- omit in toc --\u003e\n\n```python\n# Meilisearch is typo-tolerant:\nindex.search('caorl')\n```\n\nOutput:\n\n```json\n{\n  \"hits\": [\n    {\n      \"id\": 1,\n      \"title\": \"Carol\",\n      \"genre\": [\"Romance\", \"Drama\"]\n    }\n  ],\n  \"offset\": 0,\n  \"limit\": 20,\n  \"processingTimeMs\": 1,\n  \"query\": \"caorl\"\n}\n```\n\n#### Custom Search \u003c!-- omit in toc --\u003e\n\nAll the supported options are described in the [search parameters](https://www.meilisearch.com/docs/reference/api/search#search-parameters)\n\n```python\nindex.search(\n  'phil',\n  {\n    'attributesToHighlight': ['*'],\n  }\n)\n```\n\nJSON output:\n\n```json\n{\n  \"hits\": [\n    {\n      \"id\": 6,\n      \"title\": \"Philadelphia\",\n      \"_formatted\": {\n        \"id\": 6,\n        \"title\": \"\u003cem\u003ePhil\u003c/em\u003eadelphia\",\n        \"genre\": [\"Drama\"]\n      }\n    }\n  ],\n  \"offset\": 0,\n  \"limit\": 20,\n  \"processingTimeMs\": 0,\n  \"query\": \"phil\"\n}\n```\n\n#### Custom Search With Filters \u003c!-- omit in toc --\u003e\n\nIf you want to enable filtering, you must add your attributes to the `filterableAttributes` index setting.\n\n```py\nindex.update_filterable_attributes([\n  'id',\n  'genres'\n])\n```\n\n#### Custom Serializer for documents \u003c!-- omit in toc --\u003e\n\nIf your documents contain fields that the Python JSON serializer does not know how to handle you\ncan use your own custom serializer.\n\n```py\nfrom datetime import datetime\nfrom json import JSONEncoder\nfrom uuid import uuid4\n\n\nclass CustomEncoder(JSONEncoder):\n    def default(self, o):\n        if isinstance(o, (UUID, datetime)):\n            return str(o)\n\n        # Let the base class default method raise the TypeError\n        return super().default(o)\n\n\ndocuments = [\n    {\"id\": uuid4(), \"title\": \"test 1\", \"when\": datetime.now()},\n    {\"id\": uuid4(), \"title\": \"Test 2\", \"when\": datetime.now()},\n]\nindex.add_documents(documents, serializer=CustomEncoder)\n```\n\nYou only need to perform this operation once.\n\nNote that Meilisearch will rebuild your index whenever you update `filterableAttributes`. Depending on the size of your dataset, this might take time. You can track the process using the [task](https://www.meilisearch.com/docs/reference/api/tasks#get-tasks).\n\nThen, you can perform the search:\n\n```py\nindex.search(\n  'wonder',\n  {\n    'filter': ['id \u003e 1 AND genres = Action']\n  }\n)\n```\n\n```json\n{\n  \"hits\": [\n    {\n      \"id\": 2,\n      \"title\": \"Wonder Woman\",\n      \"genres\": [\"Action\", \"Adventure\"]\n    }\n  ],\n  \"offset\": 0,\n  \"limit\": 20,\n  \"estimatedTotalHits\": 1,\n  \"processingTimeMs\": 0,\n  \"query\": \"wonder\"\n}\n```\n\n## 🤖 Compatibility with Meilisearch\n\nThis package guarantees compatibility with [version v1.2 and above of Meilisearch](https://github.com/meilisearch/meilisearch/releases/latest), but some features may not be present. Please check the [issues](https://github.com/meilisearch/meilisearch-python/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22+label%3Aenhancement) for more info.\n\n## 💡 Learn more\n\nThe following sections in our main documentation website may interest you:\n\n- **Manipulate documents**: see the [API references](https://www.meilisearch.com/docs/reference/api/documents) or read more about [documents](https://www.meilisearch.com/docs/learn/core_concepts/documents).\n- **Search**: see the [API references](https://www.meilisearch.com/docs/reference/api/search).\n- **Manage the indexes**: see the [API references](https://www.meilisearch.com/docs/reference/api/indexes) or read more about [indexes](https://www.meilisearch.com/docs/learn/core_concepts/indexes).\n- **Configure the index settings**: see the [API references](https://www.meilisearch.com/docs/reference/api/settings) or follow our guide on [settings parameters](https://www.meilisearch.com/docs/learn/configuration/settings).\n\n## ⚙️ Contributing\n\nAny new contribution is more than welcome in this project!\n\nIf you want to know more about the development workflow or want to contribute, please visit our [contributing guidelines](/CONTRIBUTING.md) for detailed instructions!\n\n\u003chr\u003e\n\n**Meilisearch** provides and maintains many **SDKs and Integration tools** like this one. We want to provide everyone with an **amazing search experience for any kind of project**. If you want to contribute, make suggestions, or just know what's going on right now, visit us in the [integration-guides](https://github.com/meilisearch/integration-guides) repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeilisearch%2Fmeilisearch-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeilisearch%2Fmeilisearch-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeilisearch%2Fmeilisearch-python/lists"}