I have used ZipFile to open a downloaded compound zipfile. I want to import several of the contained files into DataFrames.
ZipFile.Reader for IOStream(<file ./GBIF-Datasets/0333654-200613084148143.zip>) containing 16 files:
uncompressedsize method mtime name
----------------------------------------------
39310607 Deflate 2021-07-29 01-56 occurrence.txt
28756841 Deflate 2021-07-29 01-56 verbatim.txt
16349369 Deflate 2021-07-29 01-56 multimedia.txt
1641 Deflate 2021-07-29 01-56 citations.txt
2947 Deflate 2021-07-29 01-56 dataset/1bc719fd-c4e1-410f-b8c1-518cc1addcb5.xml
[...]
1044 Deflate 2021-07-29 01-56 rights.txt
3430 Deflate 2021-07-29 01-56 metadata.xml
36912 Deflate 2021-07-29 01-56 meta.xml
z.files[0]
ZipFile.ReadableFile(name=occurrence.txt, method=Deflate, uncompresssedsize=39310607, compressedsize=4638199, mtime=1.627487774e9)
I can find no examples or documentation on how to do this.
Two questions:
- Is
ZipFile
the right library to use? There seems to be zero documentation. - how do I access the contained files and load them into a DataFrame. I tried IOBuffer but couldn’t find any way open the
ZipFile.ReadableFile
?
Thanks…