|
1 | 1 | --- |
| 2 | +navigation_title: "Python" |
2 | 3 | mapped_pages: |
3 | 4 | - https://www.elastic.co/guide/en/elasticsearch/client/python-api/current/index.html |
4 | 5 | - https://www.elastic.co/guide/en/elasticsearch/client/python-api/current/overview.html |
5 | 6 | --- |
6 | 7 |
|
7 | | -# Python [overview] |
| 8 | +# {{es}} Python client [overview] |
8 | 9 |
|
9 | | -This documentation covers the [official Python client for {{es}](https://github.com/elastic/elasticsearch-py)}. The goal of the Python client is to provide common ground for all {{es}}-related code in Python. The client is designed to be unopinionated and extendable. |
| 10 | +This documentation covers the [official Python client for {{es}}](https://github.com/elastic/elasticsearch-py). The goal of the Python client is to provide common ground for all {{es}}-related code in Python. The client is designed to be unopinionated and extendable. |
10 | 11 |
|
11 | 12 | API reference documentation is provided on [Read the Docs](https://elasticsearch-py.readthedocs.io). |
12 | 13 |
|
13 | 14 |
|
14 | | -## Example use [_example_use] |
15 | | - |
16 | | -Here's a simple Python client use case: |
| 15 | +The following example shows a simple Python client use case: |
17 | 16 |
|
18 | 17 | ```python |
19 | 18 | >>> from datetime import datetime |
@@ -49,45 +48,38 @@ The client's features include: |
49 | 48 | The client also provides a convenient set of [helpers](client-helpers.md) for tasks like bulk indexing and reindexing. |
50 | 49 |
|
51 | 50 | ::::{tip} |
52 | | -For details on ingesting data into Elastic Cloud with Python, refer to [Ingest data with Python](docs-content://manage-data/ingest/ingesting-data-from-applications/ingest-data-with-python-on-elasticsearch-service.md). |
| 51 | +To get started, try this walkthrough: [Ingest data with Python](docs-content://manage-data/ingest/ingesting-data-from-applications/ingest-data-with-python-on-elasticsearch-service.md) |
53 | 52 | :::: |
54 | 53 |
|
55 | 54 | ### Elasticsearch Python DSL [_elasticsearch_python_dsl] |
56 | 55 |
|
57 | 56 | The [Python DSL module](../reference/elasticsearch-dsl.md) offers a convenient and idiomatic way to write and manipulate queries. |
58 | 57 |
|
| 58 | +## {{es}} version compatibility [_compatibility] |
59 | 59 |
|
60 | | -## Compatibility [_compatibility] |
61 | | - |
62 | | -Language clients are _forward compatible:_ each client version works with equivalent and later minor versions of {{es}} without breaking. |
| 60 | +Language clients are **forward compatible**: each client version works with equivalent and later minor versions of the **same or next major** version of {{es}}. For full compatibility, the client and {{es}} minor versions should match. |
63 | 61 |
|
64 | | -Compatibility does not imply full feature parity. New {{es}} features are supported only in equivalent client versions. For example, an 8.12 client fully supports {{es}} 8.12 features and works with 8.13 without breaking; however, it does not support new {{es}} 8.13 features. An 8.13 client fully supports {{es}} 8.13 features. |
| 62 | +| Client version | {{es}} `8.x` | {{es}} `9.x` | {{es}} `10.x` | |
| 63 | +|----------------|---------------------------------|---------------------------------|----------------------------------| |
| 64 | +| 9.x client| ❌ Not compatible with {{es}} 8.x | ✅ Compatible with {{es}} 9.x | ✅ Compatible with {{es}} 10.x | |
| 65 | +| 8.x client | ✅ Compatible with {{es}} 8.x | ✅ Compatible with {{es}} 9.x | ❌ Not compatible with {{es}} 10.x | |
65 | 66 |
|
66 | | -| Elasticsearch version | elasticsearch-py branch | |
67 | | -| --- | --- | |
68 | | -| main | main | |
69 | | -| 9.x | 9.x | |
70 | | -| 9.x | 8.x | |
71 | | -| 8.x | 8.x | |
| 67 | +Compatibility does not imply feature parity. New {{es}} features are supported only in equivalent client versions. For example, an 8.12 client fully supports {{es}} 8.12 features and works with 8.13 without breaking, but it does not support new {{es}} 8.13 features. An 8.13 client fully supports {{es}} 8.13 features. |
72 | 68 |
|
73 | | -{{es}} language clients are also _backward compatible_ across minor versions — with default distributions and without guarantees. |
| 69 | +{{es}} language clients are also **backward compatible** across minor versions — with default distributions and without guarantees. |
74 | 70 |
|
75 | 71 | ### Major version upgrades |
76 | 72 |
|
77 | 73 | :::{important} |
78 | | -To upgrade to a new major version, first upgrade {{es}}, then upgrade the Python client. |
| 74 | +To upgrade to a new major version, first [upgrade {{es}}](docs-content://deploy-manage/upgrade.md), then upgrade the Python client. |
79 | 75 | ::: |
80 | 76 |
|
81 | | -As of version 8.0, {{es}} offers a compatibility mode for smoother upgrades. In compatibility mode, you can upgrade your {{es}} cluster to the next major version while continuing to use your existing client during the transition. |
| 77 | +As of version 8.0, {{es}} offers a compatibility mode for smoother upgrades. In compatibility mode, you can upgrade your {{es}} cluster to the next major version while continuing to use your existing client during the transition. |
82 | 78 |
|
83 | | -For example, if you're upgrading {{es}} 8.x to {{es}} 9.x, you can continue to use the 8.x Python {{es}} client during the server migration, with the except of client [breaking changes](../release-notes/breaking-changes.md). |
| 79 | +For example, if you're upgrading {{es}} 8.x to {{es}} 9.x, you can continue to use the 8.x Python {{es}} client during and after the server upgrade, with the exception of [breaking changes](../release-notes/breaking-changes.md). |
84 | 80 |
|
85 | | -For details, refer to [REST API compatibility workflow](elasticsearch://reference/elasticsearch/rest-apis/compatibility.md#_rest_api_compatibility_workflow). |
| 81 | +To enable compatibility mode, set the environment variable `ELASTIC_CLIENT_APIVERSIONING` to `true`. For more details, refer to [{{es}} API compatibility](elasticsearch://reference/elasticsearch/rest-apis/compatibility.md). |
86 | 82 |
|
87 | 83 | :::{tip} |
88 | 84 | To support working with multiple client versions, the Python client is also released under the package names `elasticsearch8` and `elasticsearch9` (to prevent name collisions). |
89 | | -::: |
90 | | - |
91 | | -## Additional resources |
92 | | -- [Upgrade your deployment or cluster](docs-content://deploy-manage/upgrade.md) |
93 | | -- [Python client GitHub repo](https://github.com/elastic/elasticsearch-py) |
| 85 | +::: |
0 commit comments