Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for asyncio in the official Python SDK #414

Open
icnahom opened this issue Mar 7, 2022 · 7 comments
Open

Support for asyncio in the official Python SDK #414

icnahom opened this issue Mar 7, 2022 · 7 comments
Labels
question Further information is requested

Comments

@icnahom
Copy link

icnahom commented Mar 7, 2022

Description
A way to have an asynchronous friendly (non-blocking) Python APIs.

Basic example
Can be used with other async enabled web server/framework like Sanic or FastAPI.

Other
How Elasticsearch built their python client is described here. They are using libraries like aiohttp, and unasync.

@icnahom
Copy link
Author

icnahom commented Mar 7, 2022

https://github.com/ziyoubaba/aiomeilisearch this one looks good, but it would be great if we can have up-to-date support in this
official python sdk.

@sanders41
Copy link
Collaborator

It's not part of this sdk like you are asking, but I maintain an async Python client here https://github.com/sanders41/meilisearch-python-async that is up-to-date with the latest release of Meilisearch.

@icnahom
Copy link
Author

icnahom commented Mar 7, 2022

@sanders41 Nice! May I ask why it's not part of this sdk? Would be great if it's supported because we can follow up and learn with the official meilisearch documentation.

@sanders41
Copy link
Collaborator

I am a contributor to this SDK, but not a Meilisearch employee so I'll answer with that in mind. @alallema and @brunoocasali feel free to correct anything I get wrong.

This SDK was built from the ground up as a synchronous client, so adding async support would be a big re-write. Then trying to support both async and sync in the same client would make that re-write and future maintenance more difficult. @alallema is the main Meilisearch maintainer of this client, and she also maintains the DigitialOcean, AWS, GCP, php, Java, and Kubernetes SDKs (I may have some wrong and may have missed some, but you get the point...it's a lot). So with that there are only so many things they can maintain themselves.

While there are a few differences between this SDK and my async SDK in the way parameters are passed and values are returned, everything that is supported here is also supported there so the Meilisearch documentation will be very close to the same way to do it. There is specific documentation available here where you can see differences.

If you feel like anything is missing or unclear contributions are always welcome.

@alallema
Copy link
Contributor

alallema commented Mar 8, 2022

Hi @icnahom,
Thanks for this feedback. I totally agree with sanders answer, indeed rewriting the python SDK to handle synchronous and asynchronous would be a huge work and the maintenance would be heavy. This is for the moment not something we are considering knowing that @sanders maintains for the moment an asynchronous client.
And Thank you @sanders for your answer ❤️ By the way your SDK should be on amwesome-meilisearch. You can do a PR directly on the repo or I will ask the team in charge of it ⭐

@alallema alallema added the question Further information is requested label Mar 30, 2022
@pawarren
Copy link

would be lovely to have async support merged in at some point!

@sanders41
Copy link
Collaborator

As far as I know there is still no plan to add async support here. For async use this SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants