from io import StringIO
zipdata = StringIO()
zipdata.write(get_zip_data())
myzipfile = zipfile.ZipFile(zipdata)
foofile = myzipfile.open('foo.txt')
print(foofile.read())
Python: downloading and unzipping a .zip file without writing to disk