Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
January 30, 2022 03:48 pm GMT

Pythonic Redis

pottery

Star 611 Watch 11 Fork 23

Pottery is a Pythonic way to access Redis. If you know how to use Python dicts, then you already know how to use Pottery.

Pottery is useful for accessing Redis more easily, and also for implementing microservice resilience patterns; and it has been battle tested in production at scale.

>>> from pottery import RedisList>>> tel = RedisDict({'jack': 4098, 'sape': 4139}, redis=redis, key='tel')>>> tel['guido'] = 4127>>> telRedisDict{'jack': 4098, 'sape': 4139, 'guido': 4127}>>> tel['jack']4098>>> squares = RedisList([1, 4, 9, 16, 25], redis=redis, key='squares')>>> squaresRedisList[1, 4, 9, 16, 25]>>> squares[0]1

Original Link: https://dev.to/vorg/pythonic-redis-77a

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To