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': '10.0.0.123',
'use_ssl': True,
'ca_certs': '/etc/elasticsearch/certs/ca.crt',
'username': 'joe_user',
'password': 'password',
'timeout': 60,
}
}
}
client = Builder(config).client
Metadata
Release files for es-client 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| es_client-1.0.0.tar.gz | 14.5 kB | Details |
Release files / es_client-1.0.0.tar.gz
| Download URL | es_client-1.0.0.tar.gz |
|---|---|
| Size | 14.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
36fc2922f75d1564f638b854476dbd484bc9bb931b61723744b97ecb0edf1066
|
|
BLAKE2b-256 checksum How to use checksums |
5d91fd98ce1771899307d26811fcf88cbdb791b9298df22726b2a818528d222c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |