# OpenSearch Client Java & Python APIs

**URL:** <https://forum.opensearch.org/t/opensearch-client-java-python-apis/5639>\
**Category:** OpenDistro\
**Created:** [April 16, 2021, 12:17am UTC](https://forum.opensearch.org/t/opensearch-client-java-python-apis/5639 "2021-04-16T00:17:00Z")\
**Posts on this page:** 12\
**Page:** 2

<div class="post-metadata">

**Author:** ![searchymcsearchface](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/searchymcsearchface/32/868_2.png) [@searchymcsearchface](https://forum.opensearch.org/u/searchymcsearchface)\
**Post date:** [June 11, 2021, 1:12pm UTC](https://forum.opensearch.org/t/opensearch-client-java-python-apis/5639/21 "2021-06-11T13:12:37Z")

</div>

That looks like a great list. A few things to consider:

1. Keep an eye on the [project roadmap](https://github.com/orgs/opensearch-project/projects/1). The project uses semantic versioning, so no breaking changes are expected in 1.x but at 2.0 you’ll start to see some breaking changes (as an example, `master` → `main` or whatever the new term ends up being).

1. The OpenSeach plugins could probably have an native API in the client
2. I’m not super familiar with this aspect of the python client, but having extensibility for additional plugins would be really helpful.

---

<div class="post-metadata">

**Author:** ![aparo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/aparo/32/224_2.png) [@aparo](https://forum.opensearch.org/u/aparo)\
**Post date:** [June 11, 2021, 4:51pm UTC](https://forum.opensearch.org/t/opensearch-client-java-python-apis/5639/22 "2021-06-11T16:51:19Z")

</div>

I’m try to do many of them in my client fork [[GitHub - aparo/opensearch-client-generator: OpenDistro Client code generator to be used with Elasticsearch](https://github.com/aparo/opensearch-client-generator)].  
I removed xpack stuff.  
I had a working typed AST in scala to be used to generate code i different languages.  
I want:

- target python 3.6 or above.
- Asyncio by default (with tips to call old python blocking style code)

I hope to be able to work on it on night/spare time ;-(

---

<div class="post-metadata">

**Author:** ![erickg](https://avatars.discourse-cdn.com/v4/letter/e/d78d45/32.png) [@erickg](https://forum.opensearch.org/u/erickg)\
**Post date:** [June 11, 2021, 6:49pm UTC](https://forum.opensearch.org/t/opensearch-client-java-python-apis/5639/23 "2021-06-11T18:49:57Z")

</div>

Hmm, maybe I can wait for a client build from you. I can check what features or transport layer are missing from the generated client.

@searchymcsearchface Most of the client code is generated from a set of spec files from the upstream build.

> 1. The OpenSeach plugins could probably have an native API in the client
> 2. I’m not super familiar with this aspect of the python client, but having extensibility for additional plugins would be really helpful.

As long as the spec is generated somewhere, a generator can generate client code from those spec. I am not sure how the spec is generated or written. This seems belong to OpenSearch repo.

> 1. Keep an eye on the [project roadmap](https://github.com/orgs/opensearch-project/projects/1). The project uses semantic versioning, so no breaking changes are expected in 1.x but at 2.0 you’ll start to see some breaking changes (as an example, `master` → `main` or whatever the new term ends up being).

I think @aparo and I both try not to break compatibility to talk to OpenSearch cluster. But we want to ask users to change their code using the new client library. As of how much change users have to make, that can be discussed. All in all, elasticsearch-py 7.x should be able to talk with OpenSearch since day 1. It sounds like a good enough compromise.

---

<div class="post-metadata">

**Author:** ![searchymcsearchface](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/searchymcsearchface/32/868_2.png) [@searchymcsearchface](https://forum.opensearch.org/u/searchymcsearchface)\
**Post date:** [June 11, 2021, 7:06pm UTC](https://forum.opensearch.org/t/opensearch-client-java-python-apis/5639/24 "2021-06-11T19:06:46Z")

</div>

Plus one to Asyncio!

---

<div class="post-metadata">

**Author:** ![lnielsen](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/lnielsen/32/1786_2.png) [@lnielsen](https://forum.opensearch.org/u/lnielsen)\
**Post date:** [July 20, 2021, 1:10pm UTC](https://forum.opensearch.org/t/opensearch-client-java-python-apis/5639/25 "2021-07-20T13:10:42Z")

</div>

Is there anyone looking into also migrating the [Elasticsearch DSL](https://github.com/elastic/elasticsearch-dsl-py) Python library yet?

The Elasticsearch Python client just got a product check built-in, that will even prevent v7.14+ from being used with e.g. the 7.10 oss-distribution, hence forcing people to use 7.11 and thereby Elastic License v2…

---

<div class="post-metadata">

**Author:** ![jkowall](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/jkowall/32/1063_2.png) [@jkowall](https://forum.opensearch.org/u/jkowall)\
**Post date:** [July 20, 2021, 3:56pm UTC](https://forum.opensearch.org/t/opensearch-client-java-python-apis/5639/26 "2021-07-20T15:56:36Z")

</div>

Can you send a link to the PR that breaks it?

---

<div class="post-metadata">

**Author:** ![lnielsen](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/lnielsen/32/1786_2.png) [@lnielsen](https://forum.opensearch.org/u/lnielsen)\
**Post date:** [July 21, 2021, 12:08am UTC](https://forum.opensearch.org/t/opensearch-client-java-python-apis/5639/27 "2021-07-21T00:08:29Z")

</div>

Here’s the related PRs and issues:

- [Verify connection to Elasticsearch by sethmlarson · Pull Request #1623 · elastic/elasticsearch-py · GitHub](https://github.com/elastic/elasticsearch-py/pull/1623)
- [UnsupportedProductError is raised when connecting to OSS-only Elasticsearch distributions · Issue #1639 · elastic/elasticsearch-py · GitHub](https://github.com/elastic/elasticsearch-py/issues/1639)

---

<div class="post-metadata">

**Author:** ![lornajane](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/lornajane/32/1004_2.png) [@lornajane](https://forum.opensearch.org/u/lornajane)\
**Post date:** [July 21, 2021, 8:26am UTC](https://forum.opensearch.org/t/opensearch-client-java-python-apis/5639/28 "2021-07-21T08:26:15Z")

</div>

The NodeJS library has the same “feature” [[Backport 7.x] Verify connection to Elasticsearch by github-actions[bot] · Pull Request #1497 · elastic/elasticsearch-js · GitHub](https://github.com/elastic/elasticsearch-js/pull/1497)

---

<div class="post-metadata">

**Author:** ![searchymcsearchface](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/searchymcsearchface/32/868_2.png) [@searchymcsearchface](https://forum.opensearch.org/u/searchymcsearchface)\
**Post date:** [July 21, 2021, 1:23pm UTC](https://forum.opensearch.org/t/opensearch-client-java-python-apis/5639/29 "2021-07-21T13:23:04Z")

</div>

Thanks for calling these out. 😑

---

<div class="post-metadata">

**Author:** ![tony](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@tony](https://forum.opensearch.org/u/tony)\
**Post date:** [August 11, 2021, 1:09pm UTC](https://forum.opensearch.org/t/opensearch-client-java-python-apis/5639/30 "2021-08-11T13:09:12Z")

</div>

Hi,

Has there been any work on a python [GitHub - elastic/elasticsearch-py: Official Elasticsearch client library for Python](https://github.com/elastic/elasticsearch-py) yet?  
I either need to pull the previous version before the ‘license check’ or move to a new lib.

Thanks,

Tony.

---

<div class="post-metadata">

**Author:** ![searchymcsearchface](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/searchymcsearchface/32/868_2.png) [@searchymcsearchface](https://forum.opensearch.org/u/searchymcsearchface)\
**Post date:** [August 11, 2021, 1:16pm UTC](https://forum.opensearch.org/t/opensearch-client-java-python-apis/5639/31 "2021-08-11T13:16:58Z")

</div>

Yep. Work is happening but it’s going to a few weeks until the client libs are public (renaming and updating license headers requires both engineering and legal review). Yesterday the first non-AWS committer was invited to a client lib, which should help the velocity.

Until then use the client version right before the check was implemented (the highest 7.13.x usually) - see the documentation [Compatibility - OpenSearch documentation](https://opensearch.org/docs/clients/index/) .

---

<div class="post-metadata">

**Author:** ![vamshin](https://avatars.discourse-cdn.com/v4/letter/v/c5a1d2/32.png) [@vamshin](https://forum.opensearch.org/u/vamshin)\
**Post date:** [October 14, 2021, 5:59am UTC](https://forum.opensearch.org/t/opensearch-client-java-python-apis/5639/32 "2021-10-14T05:59:38Z")

</div>

Python clients (dsl and low level) have been released

> [@Opensearch-py-dsl is now available on GitHub!](https://forum.opensearch.org/t/opensearch-py-dsl-is-now-available-on-github/7287):
>
> This is a direct replacement for the [elasticsearch-dsl-py](https://github.com/elastic/elasticsearch-dsl-py). You can get the beta version on GitHub today: Please evaluate and provide feedback - in the coming weeks this feedback will be used by the team to put together a GA release to pypi.

repos

> **[GitHub - opensearch-project/opensearch-dsl-py: High level Python client for...](https://github.com/opensearch-project/opensearch-dsl-py)**
>
> High level Python client for OpenSearch (deprecated, moved to opensearch-py) - GitHub - opensearch-project/opensearch-dsl-py: High level Python client for OpenSearch (deprecated, moved to opensearc...

> **[GitHub - opensearch-project/opensearch-py: Python Client for OpenSearch](https://github.com/opensearch-project/opensearch-py)**
>
> Python Client for OpenSearch. Contribute to opensearch-project/opensearch-py development by creating an account on GitHub.

[Previous page](https://forum.opensearch.org/t/opensearch-client-java-python-apis/5639.md?page=1)
