Skip to content

pyapp-org/pyapp.elasticsearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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