algolia / algoliasearch-client-python

⚡️ A fully-featured and blazing-fast Python API client to interact with Algolia.
https://www.algolia.com/doc/api-client/getting-started/install/python/?language=python
MIT License
196 stars 67 forks source link

Add synchronous support to v4+ #568

Closed ryancausey closed 3 days ago

ryancausey commented 4 weeks ago

The change to v4 apparently removed all synchronous support: https://www.algolia.com/doc/libraries/python/v4/upgrade/#async-only

Unless there is a trivial method to run async code from within the context of sync code that I am not aware of, this library should offer both an async and a sync versions of the API client. This would be the most compatible with existing integrations that cannot convert all the existing code to async. It is not feasible for a lot of projects to convert all of their existing synchronous code to async code in order to accommodate a library only offering async methods. There are a lot of other libraries that don't yet support async, and thus are difficult to use in conjunction with async code.

shortcuts commented 3 weeks ago

Hey @ryancausey thanks for testing the client and for opening the issue :)

Indeed we don't want to impact your codebase with more changes than what this new major version requires, we will implement a synchronous client in the next 2 weeks :)

shortcuts commented 3 days ago

Hey @ryancausey, I'll release the python sync support in the 4.4.0 version, it should be available under the SearchClientSync class (or any other client version that you use).

Feel free to provide any feedback and/or improvements :D