diff --git a/.github/Dockerfile b/.github/Dockerfile index 039d691..a914e9b 100644 --- a/.github/Dockerfile +++ b/.github/Dockerfile @@ -4,7 +4,7 @@ FROM python:${PYTHON_VERSION} WORKDIR /code/elasticsearch-serverless-python RUN mkdir -p /code/elasticsearch-serverless-python/build -COPY pyproject.toml README.rst . +COPY pyproject.toml README.md . RUN python -m pip install \ -U --no-cache-dir \ --disable-pip-version-check \ diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5cfd15a..a311242 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -34,10 +34,8 @@ jobs: - name: "Check packages" run: | - python -m pip install -U pip setuptools wheel build twine rstcheck + python -m pip install -U pip setuptools wheel build twine python -m build - # Our Python example shows a REPL and is not valid Python - rstcheck --ignore-languages python README.rst python -m twine check dist/* docs: diff --git a/README.md b/README.md new file mode 100644 index 0000000..1b121fc --- /dev/null +++ b/README.md @@ -0,0 +1,56 @@ +# Elasticsearch Serverless Python Client + +
+ +> [!WARNING] +> 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. + +## Features + +* Translating basic Python data types to and from JSON +* Configurable automatic discovery of cluster nodes +* Persistent connections +* Load balancing (with pluggable selection strategy) across available nodes +* Failed connection penalization (time based - failed connections won't be + retried until a timeout is reached) +* Support for TLS and HTTP authentication +* Thread safety across requests +* Pluggable architecture +* Helper functions for idiomatically using APIs together + +## Quick Start + + +```python +# Import the client from the 'elasticsearch' module +# Import the client from the 'elasticsearch' module +>>> from elasticsearch_serverless import Elasticsearch + +# Instantiate a client instance +>>> client = Elasticsearch("http://localhost:9200") + +# Call an API, in this example `info()` +>>> resp = client.info() + +# View the result +>>> resp +{ +"name" : "instance-name", +"cluster_name" : "cluster-name", +"cluster_uuid" : "cluster-uuid", +"version" : { + "number" : "7.14.0", + ... +}, +"tagline" : "You know, for Search" +} +``` + +## License + +This software is licensed under the [Apache License 2.0](./LICENSE). See [NOTICE](./NOTICE). diff --git a/README.rst b/README.rst deleted file mode 100644 index 7bffe47..0000000 --- a/README.rst +++ /dev/null @@ -1,103 +0,0 @@ -Elasticsearch Serverless Python Client -====================================== - -.. image:: https://img.shields.io/pypi/v/elasticsearch-serverless - :target: https://pypi.org/project/elasticsearch-serverless - -.. image:: https://img.shields.io/conda/vn/conda-forge/elasticsearch-serverless?color=blue - :target: https://anaconda.org/conda-forge/elasticsearch-serverless - -.. image:: https://static.pepy.tech/badge/elasticsearch-serverless - :target: https://pepy.tech/project/elasticsearch-serverless?versions=* - -.. image:: https://clients-ci.elastic.co/job/elastic+elasticsearch-serverless-python+main/badge/icon - :target: https://clients-ci.elastic.co/job/elastic+elasticsearch-serverless-python+main - -.. image:: https://readthedocs.org/projects/elasticsearch-serverless-python/badge/?version=latest&style=flat - :target: https://elasticsearch-serverless-python.readthedocs.io - -*The official Python client for Elasticsearch Serverless.* - - -Features --------- - -* Translating basic Python data types to and from JSON -* Configurable automatic discovery of cluster nodes -* Persistent connections -* Load balancing (with pluggable selection strategy) across available nodes -* Failed connection penalization (time based - failed connections won't be - retried until a timeout is reached) -* Support for TLS and HTTP authentication -* Thread safety across requests -* Pluggable architecture -* Helper functions for idiomatically using APIs together - - -Installation ------------- - -Install the ``elasticsearch-serverless`` package with `pip -