Simplify Elasticsearch —
Amplify Productivity
Elastro turns Elasticsearch into a high-velocity developer tool that replaces verbose REST calls with focused Python constructs and a unified CLI. Now teams can build, test, and automate faster.
1from elastro import ElasticsearchClient, DocumentManager2from elastro.advanced import QueryBuilder3 4# Initialize and connect5client = ElasticsearchClient()6client.connect()7doc_manager = DocumentManager(client)8 9# Build queries with QueryBuilder10query_builder = QueryBuilder()11bool_query = query_builder.bool()12bool_query.must(QueryBuilder().match("name", "laptop"))13bool_query.must(QueryBuilder().range("price", gte=500, lte=2000))14query = query_builder.build()15 16results = doc_manager.search("products", query)17print(f"Found {results['hits']['total']['value']} products!")from elastro import ElasticsearchClient, DocumentManager
from elastro.advanced import QueryBuilder
# Initialize and connect
client = ElasticsearchClient()
client.connect()
doc_manager = DocumentManager(client)
# Build queries with QueryBuilder
query_builder = QueryBuilder()
bool_query = query_builder.bool()
bool_query.must(QueryBuilder().match("name", "laptop"))
bool_query.must(QueryBuilder().range("price", gte=500, lte=2000))
query = query_builder.build()
results = doc_manager.search("products", query)
print(f"Found {results['hits']['total']['value']} products!")Features that make Elasticsearch feel effortless
From index management to complex aggregations, Elastro provides a complete toolkit for Python developers working with Elasticsearch.
Index Management
Create, update, and delete indices with intuitive methods. No more complex JSON mappings.
Powerful Query Builder
Build complex queries with a fluent, chainable API. Match, filter, range, and more.
CLI & API Combined
Use the command-line for quick operations or integrate seamlessly via Python API.
Advanced Aggregations
Powerful aggregation builder for analytics, metrics, and data visualization.
Cluster Health Checks
Score findings with collectors and rules, dry-run fixes, rollback snapshots, and --fail-on CI gates.
Type-Safe with Pydantic
Built-in validation and type safety using Pydantic models for reliable data handling.
Smart Ingest Engine
Client-side data processing, format conversion (CSV, SQL, NDJSON), and pre-flight schema validation.
Local GUI & ES|QL
Launch a local web GUI with elastro gui, and run or build ES|QL queries from the CLI.
Write cleaner code, faster
See how Elastro transforms verbose Elasticsearch interactions into elegant, readable Python code.
1from elasticsearch import Elasticsearch2 3es = Elasticsearch(['http://localhost:9200'])4 5# Complex nested dictionary structure6query = {7 "query": {8 "bool": {9 "must": [10 {"match": {"name": "laptop"}},11 {"range": {12 "price": {13 "gte": 500,14 "lte": 200015 }16 }}17 ]18 }19 },20 "sort": [{"rating": {"order": "desc"}}],21 "size": 1022}23 24results = es.search(index="products", body=query)❌ Verbose • ❌ Error-prone • ❌ Hard to maintain
1from elastro import ElasticsearchClient, DocumentManager2from elastro.advanced import QueryBuilder3 4client = ElasticsearchClient()5client.connect()6doc_manager = DocumentManager(client)7 8# Clean, builder API9query_builder = QueryBuilder()10bool_query = query_builder.bool()11bool_query.must(QueryBuilder().match("name", "laptop"))12bool_query.must(QueryBuilder().range("price", gte=500, lte=2000))13query = query_builder.build()14 15results = doc_manager.search(16 "products",17 query,18 {"sort": [{"rating": {"order": "desc"}}], "size": 10}19)✓ Readable • ✓ Type-safe • ✓ Maintainable
Get started in one command
Install Elastro and start simplifying your Elasticsearch operations immediately.
$ pip install elastro-clientPython 3.10–3.13 · MIT license · PyPI package elastro-client
Quick Start Example
1from elastro import ElasticsearchClient, IndexManager, DocumentManager2from elastro.advanced import QueryBuilder3 4# Connect to your Elasticsearch cluster5client = ElasticsearchClient(6 hosts=["http://localhost:9200"]7)8client.connect()9 10# Create managers11index_manager = IndexManager(client)12doc_manager = DocumentManager(client)13 14# Create an index with mappings15index_manager.create(16 "my_index",17 mappings={18 "properties": {19 "title": {"type": "text"},20 "views": {"type": "integer"}21 }22 }23)24 25# Index a document26doc_manager.index(27 "my_index",28 id="1",29 document={"title": "Hello Elastro!", "views": 100}30)31 32# Search with QueryBuilder33query_builder = QueryBuilder()34query_builder.match_all()35query = query_builder.build()36results = doc_manager.search("my_index", query)37print(results["hits"]["hits"])Frequently asked questions
Install, licensing, support, and how Elastro compares to the raw Elasticsearch client.
How do I install Elastro?
Install the Python package with pip: pip install elastro-client. Elastro requires Python 3.10–3.13. After install you get both the Python SDK (from elastro import …) and the elastro CLI for cluster operations.
How does Elastro compare to the official Elasticsearch Python client?
The official client exposes Elasticsearch’s REST API as low-level calls. Elastro wraps that surface with a fluent, type-safe Python SDK (QueryBuilder, IndexManager, DocumentManager) plus a unified CLI for indices, documents, snapshots, and restoration. Use Elastro when you want fewer verbose REST payloads and day-to-day cluster workflows in one tool; you can still use the official client alongside it when you need raw API access.
What license is Elastro under?
Elastro is MIT-licensed open source from Fremen Labs. You can use, modify, and redistribute it freely under the MIT terms. The package is published on PyPI as elastro-client and the source is on GitHub at Fremen-Labs/elastro.
Where can I get support for Elastro?
Open an issue or discussion on the Fremen Labs GitHub repository (Fremen-Labs/elastro), check the docs at elastro.fremenlabs.com/docs, and review release notes on GitHub. Community support is via GitHub; commercial inquiries can go through Fremen Labs at fremenlabs.com.
What can the Elastro CLI do?
The elastro CLI covers common Elasticsearch operations without hand-writing REST: config init, index create/manage, document index and search, snapshot create/restore (including an interactive restoration wizard), and related cluster workflows. Pair it with the Python SDK when you want the same capabilities in scripts and apps.
Does Elastro require a cloud subscription or SaaS?
No. Elastro is a local SDK and CLI that connects to Elasticsearch clusters you already run—self-hosted, Elastic Cloud, or elsewhere. There is no Elastro SaaS dependency; install from PyPI and point it at your hosts.