john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

redis hiredis flushall smembers

# install redis server from source: http://redis.io/download
sudo pip install redis
sudo pip install hiredis  # faster c implementation, if available import redis will use hiredis transparently

http://redis-py.readthedocs.org/en/latest/
https://github.com/WoLpH/redis-py
http://redis.io/commands


import redis
r = redis.StrictRedis(host='localhost', port=6379)
r.flushall()

message_total = r.get('messages:total')
r.smembers('active:users')

  • « date time datetime dateutil from string pytz utc
  • Logging logrotate var log »

Published

May 22, 2014

Category

python

~37 words

Tags

  • flushall 1
  • hiredis 1
  • python 180
  • redis 1
  • smembers 1