Skip to main content

"Elasticsearch Client builder, complete with schema validation, and AWS boto-based authentication"

Project description

You may wonder why this even exists, as at first glance it doesn’t seem to make anything any easier than just using elasticsearch.Elasticsearch() to build a client connection. I needed to be able to reuse the more complex schema validation bits I was employing, namely:

  • master_only detection
  • AWS IAM credential collection via boto3.session.Session
  • Elasticsearch version checking and validation, and the option to skip this.
  • Configuration value validation, including file paths for SSL certificates, meaning:
    • No unknown keys or unacceptable parameter values are accepted
    • Acceptable values and ranges are established–and easy to amend, if necessary.

So, if you don’t need these, then this library probably isn’t what you’re looking for. If you want these features, then you’ve come to the right place.

Example Usage

from es_client import Builder

config = {
    'elasticsearch': {
        'master_only': True,
        'client': {
            'hosts': '',
            'use_ssl': True,
            'ca_certs': '/etc/elasticsearch/certs/ca.crt',
            'username': 'joe_user',
            'password': 'password',
            'timeout': 60,

client = Builder(config).client

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for es-client, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size es_client-1.0.1.tar.gz (16.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page