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]:
[True, 'baz']

In [3]:
pipe.get('foo')
pipe.execute()


Out[3]:
['bar']

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'])


[<Person id:0905152[http] name:_Wachowski, Andy_>, <Person id:0905154[http] name:_Wachowski, Lana_>]
0000154 Mel Gibson
0317112 Mel Gibson
2153167 Mel Gibson
6709224 Mel Gibson
2800055 Mel Gibson
0316945 Donal Gibson
0317195 Terel Gibson
2106809 Raquel Gibson
0316878 Cal Gibson
7133936 Jamel Gibson
3912400 Jamel Gibson
0316950 E.L. Gibson
6580412 Rachel Gibson
0317119 Michael Gibson
0316915 Daniel Gibson
7454542 L. Gibson
1812763 Rachel Gibson
4307514 Joel Gibson
2798174 Daniel Gibson
7681841 Ginnel Gibson

In [7]:
pipe.get("7681841")
pipe.execute()


Out[7]:
[True,
 True,
 True,
 True,
 True,
 True,
 True,
 True,
 True,
 True,
 True,
 True,
 True,
 True,
 True,
 True,
 True,
 True,
 True,
 True,
 'Ginnel Gibson']

In [10]:
r.keys()


Out[10]:
['2798174',
 'foo',
 '2800055',
 '0000154',
 '0317119',
 '6709224',
 '0317112',
 '6580412',
 'mykey',
 '7454542',
 '0317195',
 '2153167',
 '4307514',
 '0316945',
 '7133936',
 '2106809',
 '1812763',
 '0316878',
 '0316950',
 'bing',
 '7681841',
 '3912400',
 '0316915']

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']


The Brothers Grimsby
Zoolander 2
La reina de España
Escobar ()
Ma ma
The Counselor
I'm So Excited!
Twice Born
To Rome with Love
Pirates of the Caribbean: On Stranger Tides
Sex and the City 2
Nine
G-Force
Broken Embraces
A Matador's Mistress
Vicky Cristina Barcelona
Elegy
The Good Night
Volver
Bandidas
Chromophobia
Sahara
Head in the Clouds
Noel
Don't Move
Gothika
Fanfan
Masked and Anonymous
Waking Up in Reno
Vanilla Sky
Don't Tempt Me
Captain Corelli's Mandolin
Blow
All the Pretty Horses
Woman on Top
Volavérunt
All About My Mother
The Hi-Lo Country
The Girl of Your Dreams
Talk of Angels
Twice Upon a Yesterday
Don Juan
Open Your Eyes
Live Flesh
A Corner of Paradise
Love Can Seriously Damage Your Health
Not Love, Just Frenzy
La Celestina
Brujas
The Butterfly Effect
Entre rojas
Todo es mentira
Alegre ma non troppo
Per amore, solo per amore
The Rebel
The Greek Labyrinth
Belle Epoque
Jamón, Jamón
L'Agent by Agent Provocateur
Mecano - Los vídeos
The Cannibalistic Councillor
Sesame Street
Framed
Série rose

In [ ]:
#r.flushall()