python - How to read gzipped file from FTP server? -
i want read file public ftp server, , can't seem figure how use gzip , urllib efficiently, without explicitely downloading file opening gzip.open()
. there other way possible @ all?
for example "ftp://ftp.server.com/pub/data/archive.gz" link got. right way read contents file in python?
edit:
so ended using:
g = gzip.open(urllib.urlretrieve(url)[0])
argument gzip.open()
way temp file downloaded url path, , g
regular file object representing archive contents
what might work read memory , unzip it, problem end using tons of memory, hence it's better download rather dowloading memory , manipulating there.
Comments
Post a Comment