Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
18 lines (12 sloc) 361 Bytes
import csv
from redis import StrictRedis
reader = csv.reader(open("./presidents.csv"))
header =
client = StrictRedis()
for i, row in enumerate(reader):
key = "president:%s" % (row[0], )
doc = dict(zip(header, row))
# simulate a disconnect every 3 operations
if i % 3 == 0:
client.set(key, doc)
You can’t perform that action at this time.