Python API Client v2 is released 🎉

release
python
api-clients

#1

Hi,

We are thrilled to announce the release of Algolia API Client Python v2. It features the implementation of our common API Client specification, support to asynchronous environments, waitable response objects, and much more. :fire:

Some of the new features include :point_down:t2:

:zap: Blazing-fast asynchronous methods

Within the same API Client, we support synchronous and asynchronous environments. Starting today, our Python API client provides asynchronous methods built on top of the Asyncio framework. It allows the usage of async|await syntax added in Python 3.5, which makes the code non-blocking and speedy.

This point is very important as asynchronous programming in Python has become more and more popular lately! We are happy to bring our client to modern Python while supporting at the same time Python 2.

:fire: Brings the DX one step further

We added a bunch of new helpers that aren’t just a simple mapping to API endpoints. Users are now able to replace_all_objects with zero downtime, or even copy_index between apps:

Some customers have use cases where a complex code is needed, so we are really happy to turn things more easy for them.

:syringe: Injectable requester

Our library is using the standard “requests” module common in python API Clients. However, if our customer doesn’t want to use it, they can inject their own requester into our library. Good news is, even if you inject another requester it will run under our retry strategy.

:robot: Indexing methods can take an iterator and automatically create batches.

Being able to pass an iterator allows you to directly write things like:

By automatically create batches we ensure we optimize the number of network calls for our users without having them to think about it. For very specific use-cases, the batch size can be change.

:confused: No more confusion between add and save.

We dropped the verb add. Now, all save methods mean either you add something new or replace it completely if it was already existing.

save_objects

Also, if you decide de save objects that don’t have any objectIds, the method will fail except if you explicitly say that you want Algolia to generate them for you. This feature is helpful only for particular use cases and shouldn’t be the default option our customers uses as they probably need to update their objects later on.

:vulcan_salute: Specific client classes

To have a better understanding of the Algolia API we have created a class for each type of clients such as SearchClient, AnalyticsClient and InsightsClient.

:stopwatch: An easy way to wait for any operation to be complete

As easy as:

wait

The cool thing is, you can now know that a method is waitable through the IDE completion, thing you couldn’t have done before!

Read the full list of supported operations

:raised_hands: You’d like to contribute?

You’d like to contribute? Before start, we want to let you know that your feedback is important to us! Please consider start using this v2 today! Found a bug or see something that can be improved?

Report it here: github.com/algolia/algoliasearch-client-python

You can also contact us or answer to the thread directly.

:arrow_up: Upgrade Where should I start?

Our documentation was updated, check out the Upgrade Guide and the API Reference.