Elasticsearch Python Client

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

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

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
94 /100 Excellent
Development Activity 88
Maintenance 92
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
89%
Apache 2.0

Apache Airflow

Data Engineering

46,995

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 89%
Updated 4 days ago
TypeScript
50%
Other

Dify

AI Development · Design Tools · Developer Tools

157,364

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

View details
92
Repo Health
85
Technical
66
Dependency
Built with
TypeScript 50%
Python 47%
Updated 4 days ago
Python
64%
Other

Keep

Automation · Devops · Monitoring

12,359

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
89
Repo Health
79
Technical
66
Dependency
Built with
Python 64%
TypeScript 36%
Updated 1 weeks ago
Python
69%
MIT

Langflow

AI Agents · AI Development

155,319

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 69%
TypeScript 22%
Updated 4 days ago
C++
66%
Other

Memgraph

AI Development · Databases

4,581

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

View details
90
Repo Health
79
Technical
69
Dependency
Built with
C++ 66%
Python 18%
Updated 5 days ago
Python
37%
Other

Open WebUI

AI Agents · AI Assistants

153,390

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

View details
91
Repo Health
75
Technical
66
Dependency
Built with
Python 37%
Svelte 34%
JavaScript 21%
Updated 4 days ago
TypeScript
55%
Other

OpenReplay

Analytics

12,911

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
90
Repo Health
77
Technical
66
Dependency
Built with
TypeScript 55%
Go 13%
Updated 1 weeks ago
Python
67%
Apache 2.0

SurfSense

AI Assistants · Search

16,270

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

View details
87
Repo Health
71
Technical
66
Dependency
Built with
Python 67%
TypeScript 30%
Updated 6 days ago
Python
94%
Apache 2.0

SWIRL

Data Engineering · Databases · Search

3,047

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

View details
62
Repo Health
83
Technical
65
Dependency
Built with
Python 94%
Updated 6 days 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