-
-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Labels
Description
The data I'm working with is provided as a RAR containing several NPY files. To avoid complex external pre-processing and pointless temporary files, I was trying to keep everything in Python. That is fully possible as Numpy can be given not just a file path but any file-like object. Doing the plumbing manually turns out to be relatively straightforward:
def extract_into_memory(archive_entry):
import io
contents = io.BytesIO()
for block in archive_entry.get_blocks():
contents.write(block)
contents.seek(0)
return contentsBut maybe it would be worthwhile to include a similar helper function as part of this library?
Reactions are currently unavailable