Elasticsearch Python Client

The official Python client for querying, indexing, and managing an Elasticsearch cluster

SDK
PyPI
v9.5.1
4,396 stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
90 /100 Excellent
Development Activity 80
Maintenance 84
Community 96
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
81 /100 Excellent
Architecture 87
Code Quality 90
Innovation 75
Learning Curve 72

The Elasticsearch Python client is Elastic’s official SDK for talking to an Elasticsearch cluster from Python. It wraps the full REST API surface in both synchronous and asyncio-based clients, adds connection pooling, retries, and sniffing, and layers a Django-ORM-like query DSL and an ES|QL helper on top of the raw request/response API so teams can index documents, run searches, and manage cluster state without hand-building HTTP calls.

What You Get

  • Full REST API coverage generated from Elasticsearch’s API specification, kept in lockstep with server versions
  • Both synchronous (Elasticsearch) and asyncio-based (AsyncElasticsearch) client classes
  • A Django-style query DSL module (elasticsearch.dsl) for building complex queries and mappings as Python objects
  • Built-in connection pooling, retry logic, node sniffing, and OpenTelemetry instrumentation
  • Bulk and streaming helpers for high-throughput indexing and scrolling through large result sets

Common Use Cases

  • Building full-text search features backed by an Elasticsearch cluster in a Python web application
  • Bulk-indexing large document sets with the client’s streaming bulk helpers
  • Running aggregations and analytics queries via the query DSL instead of raw JSON query bodies
  • Integrating async Elasticsearch access into asyncio-based services (FastAPI, aiohttp)

Under The Hood

Architecture - The client separates transport concerns (_sync/_async connection and transport modules handling pooling, retries, and node sniffing) from the generated API surface in client.py and the dsl subpackage, which compiles high-level query objects down to the same JSON request bodies the raw client sends, giving both a low-level and ORM-like access pattern against one transport layer. Tech Stack - Pure Python supporting 3.10 through 3.14 plus PyPy, with elastic-transport as its HTTP layer, built with hatchling, and OpenTelemetry hooks (_otel.py) baked in for tracing outgoing requests. Code Quality - test_elasticsearch/ mirrors both sync and async clients with dedicated test suites, CI runs against real Elasticsearch versions via noxfile.py, and the generated API bindings carry consistent type stubs (py.typed) across the whole package. API Design - The client mirrors Elasticsearch’s REST API naming almost one-to-one (e.g. client.search(), client.index()), making it easy to map official Elasticsearch documentation directly onto client calls, while the DSL module trades some of that directness for a more Pythonic, composable query-building experience.

Used by 9 apps in this directory

Python
88%
Apache 2.0

Apache Airflow

Data Engineering

47,402

Define, schedule, and monitor complex data workflows as Python code — with a powerful UI, 80+ provider integrations, and battle-tested scalability across thousands of production deployments.

View details
96
Repo Health
89
Technical
64
Dependency
Built with
Python 88%
Updated 1 weeks ago
Python
56%
Other

Dify

AI Development · Design Tools · Developer Tools

160,582

Visual LLM workflow platform with RAG pipelines, agent capabilities, and model management for building production AI applications.

View details
92
Repo Health
85
Technical
67
Dependency
Built with
Python 56%
TypeScript 41%
Updated 1 weeks ago
Python
64%
Other

Keep

Automation · Devops · Monitoring

12,499

The open-source AIOps and alert management platform that unifies 130+ monitoring tools into a single pane of glass with AI-powered correlation, deduplication, and workflow automation.

View details
87
Repo Health
79
Technical
66
Dependency
Built with
Python 64%
TypeScript 36%
Updated 1 weeks ago
Python
71%
MIT

Langflow

AI Agents · AI Development

156,397

Build, test, and deploy AI agents and RAG workflows visually with native API and MCP server export.

View details
90
Repo Health
85
Technical
65
Dependency
Built with
Python 71%
TypeScript 21%
Updated 1 weeks ago
C++
66%
Other

Memgraph

AI Development · Databases

4,653

High-performance in-memory graph database for AI context and real-time analytics

View details
90
Repo Health
79
Technical
66
Dependency
Built with
C++ 66%
Python 18%
Updated 1 weeks ago
Svelte
37%
Other

Open WebUI

AI Agents · AI Assistants

157,958

The extensible, privacy-first AI platform that runs Ollama, OpenAI, and any LLM backend behind a polished, feature-packed web interface.

View details
92
Repo Health
75
Technical
66
Dependency
Built with
Svelte 37%
Python 37%
JavaScript 17%
Updated 1 weeks ago
TypeScript
54%
Other

OpenReplay

Analytics

13,109

Self-hosted session replay and product analytics suite that lets you see exactly what users do on your web app — without sending data to third parties.

View details
91
Repo Health
77
Technical
66
Dependency
Built with
TypeScript 54%
Go 13%
Updated 1 weeks ago
Python
65%
Apache 2.0

SurfSense

AI Assistants · Search

16,796

The open-source, unlimited NotebookLM alternative with real-time collaboration, a desktop app, and no vendor lock-in.

View details
89
Repo Health
71
Technical
66
Dependency
Built with
Python 65%
TypeScript 29%
Updated 1 weeks ago
Python
94%
Apache 2.0

SWIRL

Data Engineering · Databases · Search

3,049

Federated AI search and RAG across 100+ enterprise sources—no data extraction, no vector database required.

View details
60
Repo Health
83
Technical
65
Dependency
Built with
Python 94%
Updated 2 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers