Elasticsearch Python Client
The official Python client for querying, indexing, and managing an Elasticsearch cluster
Repository Health
Technical Analysis
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
Apache Airflow
Data Engineering
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.
Dify
No Code Platforms · AI Development · Developer Tools
Visual LLM workflow platform with RAG pipelines, agent capabilities, and model management for building production AI applications.
Keep
Devops · Automation · Monitoring
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.
Langflow
AI Agents · AI Development
Build, test, and deploy AI agents and RAG workflows visually with native API and MCP server export.
Memgraph
Databases · AI Development
High-performance in-memory graph database for AI context and real-time analytics
Open WebUI
AI Assistants · AI Agents
The extensible, privacy-first AI platform that runs Ollama, OpenAI, and any LLM backend behind a polished, feature-packed web interface.
OpenReplay
Analytics
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.
SurfSense
Search · AI Assistants
The open-source, unlimited NotebookLM alternative with real-time collaboration, a desktop app, and no vendor lock-in.
SWIRL
Search · Databases · Data Engineering
Federated AI search and RAG across 100+ enterprise sources—no data extraction, no vector database required.