Introducing the next chapter of Redis Iris. Six new capabilities across retrieval, memory, routing, and messaging.

Check it out

Blog

Hello redis-py, It’s Been a Minute

January 18, 20222 minute read
Chayim Kirshen
Summarize with AI

redis-py 4.1.0 is released!

Python support for Redis has been growing for over a decade, reaching over 1 million downloads per week, and we’re proud to announce the latest release, redis-py 4.1.0!

This release almost brings us within spitting distance of complete Redis command support in Redis 6.2. We’ve added support for missing options in existing commands, SSL support for Sentinel connections, and generally improved the developer experience. It also brings large structural changes such as a focus on Python 3.6, and even Python 3.10 support. We’ve revamped our client documentation, making it easier to find Redis commands, and encouraging everyone to get involved! More importantly, we’ve done it with minimal disruption, so you can upgrade without compatibility issues.

Support for newest Redis commands

Redis 6.2 brings with it a huge swath of new Redis commands, and it’s now easier than ever to use them with Python. From making it easier to fetch data and update its expiration in a single command with GETEX, to managing your Redis instances by disconnecting clients with CLIENT INFO and CLIENT KILL redis-py 4.1.0 has you covered. Let’s look at two examples below of the over 30 commands added in redis-py 4.1.0!

First class Redis module support

redis-py 4.0 was the first version of the Python library to bring first-class support for Redis modules. With the release of redis-py 4.1.0, we now have support for RedisJSON, RediSearch, RedisTimeSeries, RedisGraph, and RedisBloom. That’s right, you can easily store JSON data in Redis! You can operate on it – you can even search it! Just remember, when you store JSON data in Redis, you’re storing a new data type, so you need to use the JSON specific commands to manipulate it. Here are some examples:

What about documents like myDoc above? Did you know that you can fetch multiple keys by querying a portion of the document?

You can even combine RedisJSON and RediSearch for document capabilities or add your custom Redis modules support. It’s all there in redis-py 4.0.

Redis cluster support with redis-py

Did you know that redis-py 4.1.0 also integrates redis-cluster support, with two easy ways to connect? The same great experience for interacting with standalone Redis nodes is now part of redis-py.

Maybe you’d like to connect to your cluster via SSL or prefer the class init based approach, and want to run commands, targeting specific nodes. redis-py 4.1.0 supports those scenarios!

What’s next?

The work is never done and we’re moving full steam ahead! We will add support for more modules, such as RedisAI, with the same first class experience. We’re going to add support for RESP3 functions that will be released in Redis 7, and speed up the code base. We’re also working on developer tooling, to make contributing to and working with redis-py even better!

Related Posts
Blog
Feb. 02, 2022
Blog tile image
Active-Active Geo-Distribution Now Generally Available in Azure Cache for Redis Enterprise
Read now
Blog
Jan. 31, 2022
Blog tile image
Redis 7.0: The First Release Candidate is Here!
Read now
Blog
Jan. 06, 2022
Blog tile image
Redis Recognized in 2021 Gartner® Magic Quadrant™ for Cloud Database Management Systems
Read now
Blog
Jan. 01, 2022
Blog tile image
Looking to re:Invent? It’s Time for a New Approach to Your Data Layer
Read now

Get started with Redis today

Speak to a Redis expert and learn more about enterprise-grade Redis today.