{"id":15152140,"url":"https://github.com/elastic/elasticsearch-py-async","last_synced_at":"2025-10-20T16:10:22.282Z","repository":{"id":5813194,"uuid":"53985669","full_name":"elastic/elasticsearch-py-async","owner":"elastic","description":"Backend for elasticsearch-py based on python's asyncio module.","archived":true,"fork":false,"pushed_at":"2022-03-01T03:45:19.000Z","size":52,"stargazers_count":280,"open_issues_count":0,"forks_count":72,"subscribers_count":360,"default_branch":"master","last_synced_at":"2025-01-19T16:54:24.209Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elastic.png","metadata":{"files":{"readme":"README","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}},"created_at":"2016-03-15T23:22:55.000Z","updated_at":"2024-11-28T16:32:25.000Z","dependencies_parsed_at":"2022-08-06T19:00:53.539Z","dependency_job_id":null,"html_url":"https://github.com/elastic/elasticsearch-py-async","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Felasticsearch-py-async","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Felasticsearch-py-async/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Felasticsearch-py-async/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Felasticsearch-py-async/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elastic","download_url":"https://codeload.github.com/elastic/elasticsearch-py-async/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234669967,"owners_count":18869114,"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":[],"created_at":"2024-09-26T15:42:47.314Z","updated_at":"2025-09-29T23:31:06.267Z","avatar_url":"https://github.com/elastic.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Python Elasticsearch Async Client\n=================================\n\n**NOTE: This repository is deprecated, do not use for Elasticsearch 7.x or later.**\n\n`See this issue about the deprecation for more information \u003chttps://github.com/elastic/elasticsearch-py-async/issues/81\u003e`_.\n\nWhat is this library?\n---------------------\n\nThis is an adapter for `elasticsearch-py`_ providing a transport layer based on\nPython's `asyncio`_ module. All API calls now return a future wrapping the\nresponse.\n\nSniffing (when requested) is also done via a scheduled coroutine.\n\nExample for python 3.5+\n\n.. code-block:: python\n\n    import asyncio\n    from elasticsearch_async import AsyncElasticsearch\n\n    client = AsyncElasticsearch(hosts=['localhost', 'other-host'])\n\n    async def print_info():\n        info = await client.info()\n        print(info)\n\n    loop = asyncio.get_event_loop()\n    loop.run_until_complete(print_info())\n    loop.run_until_complete(client.transport.close())\n    loop.close()\n\nExample for python 3.4\n\n.. code-block:: python\n\n    import asyncio\n    from elasticsearch_async import AsyncElasticsearch\n    hosts = ['localhost', 'other-host']\n\n    async def print_info():\n        async with AsyncElasticsearch(hosts=hosts) as client:\n              print(await client.info())\n\n    loop = asyncio.get_event_loop()\n    loop.run_until_complete(print_info())\n    loop.close()\n\n\nExample with SSL Context\n\n.. code-block:: python\n\n    import asyncio\n    from elasticsearch_async import AsyncElasticsearch\n    from elasticsearch.connection.http_urllib3 import create_ssl_context\n\n    context = create_ssl_context(cafile=\"/certs/ca/ca.crt\")\n\n    client = AsyncElasticsearch(\n        hosts=['elasticsearch-xpack'],\n        ssl_context=context,\n        http_auth=('elastic', 'changeme')\n    )\n\n    @asyncio.coroutine\n    def print_info():\n        info = yield from client.info()\n        print(info)\n\n    loop = asyncio.get_event_loop()\n    loop.run_until_complete(print_info())\n    loop.run_until_complete(client.transport.close())\n    loop.close()\n\n\n\n``AsyncElasticsearch`` introduces one extra parameter ``loop`` which can be\nused to pass in an event loop you wish the client to use. By default\n``asyncio.get_event_loop()`` will be used.\n\n.. _elasticsearch-py: http://elasticsearch-py.rtfd.org/\n.. _asyncio: https://docs.python.org/3/library/asyncio.html\n\nInstallation\n------------\n\n``elasticsearch-async`` is available via PyPI so you can install it using pip\n\n.. code-block:: bash\n\n    pip install elasticsearch-async\n\n\nLicense\n-------\n\nCopyright 2015 Elasticsearch\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felastic%2Felasticsearch-py-async","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felastic%2Felasticsearch-py-async","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felastic%2Felasticsearch-py-async/lists"}