skillfed

elasticsearch9

Python client for Elasticsearch

elasticsearch9 v9.5.0 172.8K downloads/30d#10,322 on PyPI
Permissive license Apache-2.0 Active released

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 elasticsearch9

uv

uv add elasticsearch9

poetry

poetry add elasticsearch9

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Tags

elasticsearch python clientelasticsearch api wrappersearch engine client libraryelasticsearch cluster connectionelasticsearch document indexingelasticsearch query builderelasticsearch rest client
elasticsearchsearch-enginerest-client

More Database packages