liveBook · Manning

Redis-py

As explained in The Quick Python Book, Fourth Edition

redis-py is a Python client library that provides an interface to Redis servers.

redis-py is a Python client library for communicating with Redis, a network service that behaves much like a shared Python dictionary. Redis supports caching, message brokering, and quick information lookups. section 23.6

Install the client, connect to a running server, and use familiar Redis operations:

Expiring data

r.setex("timed", 10, "10 seconds") stores a value for ten seconds. After expiration, pttl returns -2 and the key is absent.

How The Quick Python Book, Fourth Edition covers it

How deep it goes
Demonstrates installation, connection setup, scalar values, counters, lists, indexing, and expiration without discussing client internals.
Examples
Uses set/get, incr, list insertion and indexing, and setex with observable return values and byte strings.
What it assumes
Assumes general Python knowledge and access to a running Redis server, while providing installation and server setup options.
What you can do after
Apply Redis operations through the redis-py client after connecting to a running Redis server.
How it connects
Connects Python dictionaries, Redis servers, caching, message brokers, counters, lists, and key expiration.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Quick Python Book, Fourth Edition. The section links point to the parts of the book it draws on.