|
| 1 | +# Elasticsearch Serverless Python Client |
| 2 | + |
| 3 | +<p align="center"> |
| 4 | + <a href="https://pypi.org/project/elasticsearch"><img alt="PyPI Version" src="https://img.shields.io/pypi/v/elasticsearch" /></a> |
| 5 | + <a href="https://pypi.org/project/elasticsearch"><img alt="Python Versions" src="https://img.shields.io/pypi/pyversions/elasticsearch" /></a> |
| 6 | + <a href="https://pepy.tech/project/elasticsearch?versions=*"><img alt="Downloads" src="https://static.pepy.tech/badge/elasticsearch" /></a> |
| 7 | + <a href="https://elasticsearch-py.readthedocs.io"><img alt="Documentation Status" src="https://readthedocs.org/projects/elasticsearch-py/badge/?version=latest" /></a> |
| 8 | +</p> |
| 9 | + |
| 10 | +> [!WARNING] |
| 11 | +> Starting with the release of the Elastic Stack 9.0.0, this client will be discontinued. Instead, you can use the latest version of the [Elasticsearch Python Client](https://github.com/elastic/elasticsearch-py) to build your Elasticsearch Serverless Python applications. |
| 12 | +
|
| 13 | +## Features |
| 14 | + |
| 15 | +* Translating basic Python data types to and from JSON |
| 16 | +* Configurable automatic discovery of cluster nodes |
| 17 | +* Persistent connections |
| 18 | +* Load balancing (with pluggable selection strategy) across available nodes |
| 19 | +* Failed connection penalization (time based - failed connections won't be |
| 20 | + retried until a timeout is reached) |
| 21 | +* Support for TLS and HTTP authentication |
| 22 | +* Thread safety across requests |
| 23 | +* Pluggable architecture |
| 24 | +* Helper functions for idiomatically using APIs together |
| 25 | + |
| 26 | +## Quick Start |
| 27 | + |
| 28 | + |
| 29 | +```python |
| 30 | +# Import the client from the 'elasticsearch' module |
| 31 | +# Import the client from the 'elasticsearch' module |
| 32 | +>>> from elasticsearch_serverless import Elasticsearch |
| 33 | + |
| 34 | +# Instantiate a client instance |
| 35 | +>>> client = Elasticsearch("http://localhost:9200") |
| 36 | + |
| 37 | +# Call an API, in this example `info()` |
| 38 | +>>> resp = client.info() |
| 39 | + |
| 40 | +# View the result |
| 41 | +>>> resp |
| 42 | +{ |
| 43 | +"name" : "instance-name", |
| 44 | +"cluster_name" : "cluster-name", |
| 45 | +"cluster_uuid" : "cluster-uuid", |
| 46 | +"version" : { |
| 47 | + "number" : "7.14.0", |
| 48 | + ... |
| 49 | +}, |
| 50 | +"tagline" : "You know, for Search" |
| 51 | +} |
| 52 | +``` |
| 53 | + |
| 54 | +## License |
| 55 | + |
| 56 | +This software is licensed under the [Apache License 2.0](./LICENSE). See [NOTICE](./NOTICE). |
0 commit comments