In [1]:
import redis
In [2]:
r = redis.Redis(host='localhost', port=6379, db=0)
r.set('bing', 'baz')
# Use the pipeline() method to create a pipeline instance
pipe = r.pipeline()
# The following SET commands are buffered
pipe.set('foo', 'bar')
pipe.get('bing')
# the EXECUTE call sends all buffered commands to the server, returning
# a list of responses, one for each command.
pipe.execute()
Out[2]:
In [3]:
pipe.get('foo')
pipe.execute()
Out[3]:
In [4]:
from imdb import IMDb
In [6]:
ia = IMDb()
the_matrix = ia.get_movie('0133093')
print the_matrix['director']
for person in ia.search_person('Mel Gibson'):
print person.personID, person['name']
pipe.set(person.personID, person['name'])
In [7]:
pipe.get("7681841")
pipe.execute()
Out[7]:
In [10]:
r.keys()
Out[10]:
In [18]:
full_person = ia.get_person('0004851', info=["filmography"])
full_person.keys()
for i in range(len(full_person["actress"])):
print full_person["actress"][i]['title']
In [ ]:
#r.flushall()