Transport classes and utilities shared among Python Elastic client libraries
Project description
elastic-transport-python
Transport classes and utilities shared among Python Elastic client libraries
This library was lifted from elasticsearch-py
and then transformed to be used across all Elastic services
rather than only Elasticsearch.
User Guide
For almost all use-cases you should not need this library. The below use-cases are the common ones:
Creating your own Connection Class
If you need to have custom behavior for a Connection
you can subclass the
base connection class you want and then pass the class in via connection_class
:
from elastic_transport import Urllib3HttpConnection
from elastic_enterprise_search import EnterpriseSearch
class CustomHttpConnection(Urllib3HttpConnection):
... # Custom HTTP behavior
# Create the Client with 'connection_class' defined
client = EnterpriseSearch(
...,
connection_class=CustomHttpConnection
)
The above also works for ConnectionPool
(via connection_pool_class
) and Transport
(via transport_class
).
Connection Classes
elastic-transport-python
supports two HTTP client libraries:
Urllib3HttpConnection
This is the default connection class. This connection class uses urllib3` to issue requests. Read more about urllib3 on Read the Docs.
RequestsHttpConnection
This connection class requires the Requests library to be installed to use:
$ python -m pip install requests
This class is often useful when using libraries that integrate with Requests. Read more about Requests on Read the Docs.
License
elastic-transport-python
is available under the Apache-2.0 license.
For more details see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for elastic-transport-0.1.0.dev2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3258ca98fb44189ac5eea3cd6f26c3cd67e3bcce7dab7baf285c259f59aca7c |
|
MD5 | 2398007114bab33ed72ea7d74e432755 |
|
BLAKE2b-256 | 27927be7e4181ad75e7f2d34323f34adfe1a2f0dd5990f9930d636be6c5720ff |
Hashes for elastic_transport-0.1.0.dev2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c35a2acf17b7d49ae0509b01af3a866836771d2789152b06ab186881e51f4573 |
|
MD5 | 1c5a425e695572aaaba1d085ad46fa70 |
|
BLAKE2b-256 | 59816b8697121cb8e2ebcd30abcb41813866c9bcfc10f561cbf65d814058b1b1 |