skillfed

elasticsearch8-dsl

Python client for Elasticsearch

elasticsearch8-dsl v8.12.0 118.6K downloads/30d#12,111 on PyPI3,869
Permissive license Apache-2.0 Abandoned released

What it is and what it does

elasticsearch8-dsl is a Python wrapper around the official elasticsearch8 client that replaces verbose JSON dict-based query construction with a chainable, Pythonic API. Instead of manually nesting dictionaries to build bool queries, filters, and aggregations, you write method chains that the library translates to equivalent Elasticsearch JSON DSL. It also provides optional document mapping and persistence—you can define Python classes with typed fields that mirror Elasticsearch mappings, then save and retrieve documents as Python objects.

The library stays structurally close to Elasticsearch's native DSL terminology, so queries remain recognizable to anyone familiar with the JSON syntax. It includes a Search class for query building, aggregation support, and a Document base class for object-relational mapping. You can also convert between Search objects and raw dicts, allowing gradual migration from pure elasticsearch8 code.

Use it for:

  • Build complex Elasticsearch queries programmatically without manually constructing nested JSON dicts.
  • Define document schemas with typed fields and save/retrieve them as Python objects instead of raw dicts.
  • Add filters, aggregations, and query clauses dynamically to a search object before execution.
  • Migrate incrementally from elasticsearch8 by wrapping existing query dicts and modifying them via the DSL.
  • Implement custom document methods and lifecycle hooks for domain logic.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A high-level Python query builder for Elasticsearch that translates idiomatic Python expressions into Elasticsearch JSON DSL queries, plus optional document mapping and persistence.

No. The repository is archived and abandoned with no releases since 2024-01-19 and last commit on 2025-04-18. While the code is permissively licensed and currently has no known vulnerabilities, the lack of active development means security patches, compatibility fixes, and bug fixes will not be forthcoming. Use only if maintaining a legacy application already on this version.

Install

elasticsearch8-dsl on PyPI

pip

pip install elasticsearch8-dsl

uv

uv add elasticsearch8-dsl

poetry

poetry add elasticsearch8-dsl

Installing elasticsearch8-dsl

Before you install

Low install friction with only two runtime dependencies (python-dateutil and elasticsearch8). However, the repository is archived and marked abandoned, with the last commit on 2025-04-18 and no releases since 2024-01-19—maintenance has effectively stopped.

License in practice

Licensed under Apache-2.0 (permissive), allowing use in commercial and proprietary projects with minimal restrictions beyond attribution and liability disclaimers.

Quickstart

pip install elasticsearch8-dsl

from elasticsearch8_dsl import Search
from elasticsearch import Elasticsearch

client = Elasticsearch("https://localhost:9200")
s = Search(using=client, index="my-index").filter("term", category="search").query("match", title="python")
response = s.execute()

Requires a running Elasticsearch 8.x instance; the library version must match the major version of your Elasticsearch server.

Verify before relying

  • Whether the abandoned status and lack of recent releases pose a risk for future Elasticsearch server compatibility.
  • Whether security patches or bug fixes will be backported if vulnerabilities are discovered in dependencies.
  • Current production usage and whether alternatives are actively maintained.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.7)
Install friction low — pure-Python wheel
Runtime dependencies 2 — python-dateutil, elasticsearch8
Maintenance abandoned — 938 days since the last release
Last repo commit (repository archived)
First released
Downloads 118,614/month — #12,111 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: elasticsearch8_dsl-8.12.0-py3-none-any.whl

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Tags

elasticsearch query builder pythonelasticsearch dsl pythonelasticsearch orm pythonelasticsearch document mappingelasticsearch query abstractionelasticsearch python client wrapperelasticsearch aggregation builder
elasticsearchquery-builderorm

More Front-Ends packages