OSS TanbouSign in with GitHub

connect Python applications to Elasticsearch with the official client

OSS scale score 275.2OSS health 100
About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
4,390
Primary language
Python
License
Apache-2.0
Repository last updated
Oct 5, 2026
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.

Sources: [3][2][4]

Official sources

  1. [1]elastic/elasticsearch-py — GitHub repository(2026-10-06)
  2. [2]elasticsearch-py 9.5.1 — README(2026-10-06)
  3. [3]elasticsearch-py 9.5.1 — pyproject.toml(2026-10-06)
  4. [4]elasticsearch-py 9.5.1 release(2026-10-06)
  5. [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. 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. 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. 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
Check the official README

Growth

Growth trends · Last 30 days

4,390 Stars

Trend data is still being collected.

Built with

Categories and tags

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
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?