Skip to content

Latest commit

 

History

History
76 lines (44 loc) · 1.66 KB

README.rst

File metadata and controls

76 lines (44 loc) · 1.66 KB

pyApp - Elastic Search

Let us handle the boring stuff!

Once you go Black...

Tests

Maintainability Test Coverage

This extension provides a Elasticsearch client object configured via pyApp settings.

Installation

Install with pip:

pip install pyApp-elasticsearch-py

For AsyncIO support either:

pip install pyApp-elasticsearch-py[async]

# - OR -

pip install pyApp-elasticsearch-py aiohttp

Add the ELASTICSEARCH block into your runtime settings file:

ELASTICSEARCH = {
    "default": {
        "host": "localhost",
    }
}

Note

In addition to the host any argument that can be provided to elasticsearch.Elasticsearch or elasticsearch.AsyncElasticsearch can be provided.

Usage

The following example creates an Elasticsearch client instance:

from pyapp_ext.elasticsearch import get_client

es = get_client()

Or an async Elasticsearch client instance:

from pyapp_ext.elasticsearch import get_async_client

es = get_async_client()

API