elasticsearch9
Python client for Elasticsearch
What it is and what it does
elasticsearch9 is the official Python client library for Elasticsearch, maintained by Elastic. It provides a high-level interface to interact with Elasticsearch clusters, handling the low-level HTTP communication, connection pooling, node discovery, and load balancing automatically. The client translates Python data types to JSON, manages persistent connections with automatic retry logic, and supports TLS and HTTP authentication out of the box.
Typical usage involves creating a client instance pointing to your Elasticsearch cluster, then calling methods to index documents, search, update, delete, or manage indices. The library is thread-safe and designed to be pluggable—you can customize connection strategies, node selection, and other behaviors. It works with current Python versions (3.10 through 3.14) and is forward-compatible with later minor versions of Elasticsearch.
Use it for:
- Index and search documents in an Elasticsearch cluster from a Python application
- Build a search interface or analytics dashboard that queries Elasticsearch data
- Manage index lifecycle operations (create, update, delete indices) programmatically
- Implement full-text search, faceting, and aggregations in a Python backend
- Migrate or bulk-load data into Elasticsearch from Python scripts
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Official Python client for Elasticsearch that handles connection management, node discovery, load balancing, and idiomatically translates Python data types to and from JSON for cluster operations.
Yes. This is the official, actively maintained client with low install friction, permissive licensing, no known vulnerabilities, and broad Python version support. Install it if you need to interact with Elasticsearch from Python—it is the standard choice for this task.
Install
elasticsearch9 on PyPI
pip
pip install elasticsearch9uv
uv add elasticsearch9poetry
poetry add elasticsearch9Installing elasticsearch9
Before you install
Low friction install with five runtime dependencies (anyio, elastic-transport, python-dateutil, sniffio, typing-extensions). Actively maintained with a release 10 days ago; supports current Python versions (3.10–3.14).
License in practice
Licensed under Apache 2.0 (permissive). You can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install elasticsearch9
from elasticsearch9 import Elasticsearch
client = Elasticsearch(["http://localhost:9200"])
result = client.search(index="my_index", query={"match_all": {}})
Requires Python 3.10 or later. Elasticsearch server must be running and accessible at the configured host and port.
Verify before relying
- Whether elasticsearch9 is a separate major version branch or an alias for the main elasticsearch package
- Performance characteristics and connection pooling behavior under high concurrency
- Exact feature parity between elasticsearch9 and Elasticsearch 9.x server versions
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — anyio, elastic-transport, python-dateutil, sniffio, typing-extensions |
| Maintenance | actively maintained — 10 days since the last release |
| First released | |
| Downloads | 172,836/month — #10,322 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: elasticsearch9-9.5.0-py3-none-any.whl
Keywords: REST, client, elastic, elasticsearch9, index, kibana, mapping, search
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
elasticsearch7Official Python client for Elasticsearch that…
permissive · top 15,000 on PyPI
es-clientBuilds and validates Elasticsearch client…
permissive · top 15,000 on PyPI
elastic-transportProvides shared HTTP transport classes and…
permissive · top 1,000 on PyPI
elasticsearch5Low-level Python client for Elasticsearch 5.x…
permissive · top 15,000 on PyPI
elasticsearch8-dslA high-level Python query builder for…
permissive · top 15,000 on PyPI
elasticsearch-dslProvides a high-level Python API for building…
permissive · top 5,000 on PyPI
elasticsearch6Low-level Python client for Elasticsearch that…
permissive · top 15,000 on PyPI
elasticsearch-curatorManages Elasticsearch indices and snapshots…
permissive · top 15,000 on PyPI
pysolrpysolr is a lightweight Python client for…
permissive · top 15,000 on PyPI