elasticsearch7
Python client for Elasticsearch
What it is and what it does
elasticsearch7 is the official Python client library for communicating with Elasticsearch clusters. It abstracts away the HTTP protocol layer, providing a Python API for cluster discovery, node selection, connection pooling, and authentication. The package handles automatic serialization of Python data types to JSON, manages persistent connections with load balancing across available nodes, and includes retry logic with connection penalization.
Developers use it to query, index, and manage documents in Elasticsearch from Python applications. The client supports both synchronous and asynchronous patterns (via optional extras), thread-safe concurrent requests, and pluggable components for customizing connection strategies and authentication. It's designed to work with Elasticsearch versions greater than or equal to the server's minor version.
Use it for:
- Building search functionality into web applications that index and query documents stored in Elasticsearch.
- Automating bulk indexing of data into Elasticsearch from Python ETL pipelines or data processing workflows.
- Monitoring and managing Elasticsearch cluster health and node status from Python applications.
- Integrating full-text search capabilities into Python backends without writing raw HTTP requests.
- Implementing real-time analytics dashboards that query Elasticsearch data through Python services.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Official Python client for Elasticsearch that handles connection management, load balancing, and API communication with Elasticsearch clusters.
Yes. This is the official, actively maintained client with low install friction, permissive licensing, no known vulnerabilities, and broad Python version support. It is the standard choice for any Python application that needs to communicate with Elasticsearch. Install it unless you have a specific reason to use an alternative client or are not using Elasticsearch.
Install
elasticsearch7 on PyPI
pip
pip install elasticsearch7uv
uv add elasticsearch7poetry
poetry add elasticsearch7Installing elasticsearch7
Before you install
Low install friction with only two lightweight runtime dependencies (urllib3, certifi). Actively maintained with recent commits and a large repository presence (4385 stars), indicating stable ongoing support.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; attribution and license inclusion required in distributions.
Quickstart
pip install elasticsearch7
from elasticsearch import Elasticsearch
client = Elasticsearch("http://localhost:9200")
resp = client.info()
Requires a running Elasticsearch server accessible at the specified host and port.
Verify before relying
- Whether async/await support is available via the [async] extra and what additional dependencies that requires.
- Specific version compatibility guarantees between this client and Elasticsearch server versions beyond 'forward compatible'.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,<4,>=2.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — urllib3, certifi |
| Maintenance | actively maintained — 214 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 211,769/month — #9,475 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: elasticsearch7-7.17.13-py2.py3-none-any.whl
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
elasticsearchOfficial Python client library for connecting…
permissive · top 1,000 on PyPI
elasticsearch9Official Python client for Elasticsearch that…
permissive · top 15,000 on PyPI
elasticsearch5Low-level Python client for Elasticsearch 5.x…
permissive · top 15,000 on PyPI
elasticsearch6Low-level Python client for Elasticsearch that…
permissive · top 15,000 on PyPI
elastic-transportProvides shared HTTP transport classes and…
permissive · top 1,000 on PyPI
es-clientBuilds and validates Elasticsearch client…
permissive · top 15,000 on PyPI
elasticsearch-dslProvides a high-level Python API for building…
permissive · top 5,000 on PyPI
elasticsearch8-dslA high-level Python query builder for…
permissive · top 15,000 on PyPI
elasticsearch-dbapiProvides DBAPI (PEP-249) and SQLAlchemy dialect…
permissive · top 5,000 on PyPI
elasticsearch-curatorManages Elasticsearch indices and snapshots…
permissive · top 15,000 on PyPI