I am using SQLAlchemy+SQLSoup to query a table, now I need to store the query result as a List in Redis. Any help on how-to would be great.
Thanks.
First, install redis-py then do:
>>> import redis
>>> r = redis.StrictRedis(host='localhost', port=6379, db=0)
>>> for e in yourlist:
... r.rpush('yourlist', e)
If you have a complex structure (like an object or a tuple/list) I think your best bet is to serialize the data into some format you prefer (like json or, in case of python, pickle) and simply store it as a string:
>>> r.set('key', val)
Note that in Redis you can't query data by value, only by key. Details depend on your data, so if you need more precise answer please ask more precise question. :) A sample code would really be best.