On this page
Overview
elasticsearch-py is the official Python client for Elasticsearch. It handles JSON conversion, persistent connections, node discovery, load balancing, failure backoff, TLS and authentication, plus helpers for Elasticsearch APIs.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Call Elasticsearch APIs for indices, documents, and search
The client exposes index creation, document indexing, retrieval, update, deletion, search, and other Elasticsearch APIs while translating standard Python values to and from JSON.
Sources: [2]
Manage node discovery, persistent connections, load balancing, and TLS
It provides automatic node discovery, persistent connections, configurable load balancing, failed-node penalties, TLS and HTTP authentication, and thread-safe request handling.
Sources: [2]
Best fit
Fits Python services using Elasticsearch for search and analytics
It is the natural choice for applications that execute full-text search, document queries, log analysis, or analytics directly against Elasticsearch while keeping cluster connectivity and API compatibility in the official client.
Sources: [2]
Before adoption
elasticsearch-py 9.5.1 requires Python 3.10+; respect client/server major compatibility
Version 9.5.1 requires Python 3.10 or newer. Clients are forward compatible across later minor server releases, but new server features require the corresponding client version. For major upgrades, upgrade Elasticsearch first and the Python client second.
Official sources
- [1]elastic/elasticsearch-py — GitHub repository(2026-10-06)
- [2]elasticsearch-py 9.5.1 — README(2026-10-06)
- [3]elasticsearch-py 9.5.1 — pyproject.toml(2026-10-06)
- [4]elasticsearch-py 9.5.1 release(2026-10-06)
- [5]elasticsearch-py Apache-2.0 license(2026-10-06)
Supplemental curator note
The dedicated client handles cluster topology and version compatibility more directly than a generic HTTP client. Respect major upgrade order and pin timeout, retry, and TLS behavior to production requirements.
Try it in 3 steps
- 1
Install elasticsearch-py 9.5.1
Pin the reviewed official Python client. Python 3.10 or newer is required.
python -m pip install "elasticsearch==9.5.1" - 2
Set a test Elasticsearch endpoint
Point this at localhost or another Elasticsearch environment that is safe for verification. Do not commit credentials when authentication is required.
export ELASTICSEARCH_URL='http://127.0.0.1:9200' - 3
Read cluster information
Call only the read-only info API to verify connectivity and the server version without modifying indices or documents.
python - <<'PY' import os from elasticsearch import Elasticsearch client = Elasticsearch(os.environ['ELASTICSEARCH_URL']) info = client.info() print(info['version']['number']) client.close() PY
Growth
Growth trends · Last 30 days
4,390 Stars
Trend data is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- client
- elasticsearch
- python
- search
- Stars
- 4,390
- Forks
- 1,222
- Watchers
- 390
- Open issues
- 62
- Contributors
- 204
- Owner type
- Organization
- Primary language
- Python
- License
- Apache-2.0
- Repository last updated
- Oct 5, 2026
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- OpenSearch13,816 Stars
3 shared tag(s) · 1 shared category(s)
Support distributed full-text, analytics, observability, and vector search
Java - redis-py13,648 Stars
2 shared tag(s) · 1 shared category(s) · Same language
use synchronous, asynchronous, and cluster Redis access through one Python client
Python - SQLAlchemy12,201 Stars
2 shared tag(s) · 1 shared category(s) · Same language
combine SQL expressions and ORM mapping in one Python data-access toolkit
Python - asyncpg8,098 Stars
2 shared tag(s) · 1 shared category(s) · Same language
access PostgreSQL directly from asyncio through a high-performance Python driver
Python - Baserow6,088 Stars
2 shared tag(s) · 1 shared category(s) · Same language
Connect spreadsheet-style business data to applications, automation, and dashboards
Python - Alembic4,431 Stars
2 shared tag(s) · 1 shared category(s) · Same language
track SQLAlchemy model changes as versioned database schema migrations
Python
Report incorrect information
Tell us if any listing information is incorrect or outdated.