loadzip#

loadzip(filename=None, folder=None, load=True, convert=True, **kwargs)[source]#

Load the contents of a zip file into a variable

Parameters:
  • filename (str/path) – the name of the zip file to load from

  • folder (str) – optional additional folder for the filename

  • load (bool) – whether to load the contents of the zip file; else just return the ZipFile itself

  • convert (bool) – whether to convert bytes objects to strings

  • kwargs (dict) – passed to sc.load()

Returns:

dict with each file loaded as a key

Example:

data = sc.loadzip('my-files.zip')
New in version 2.0.0.
New in version 3.0.0: load into memory instead of extracting to disk; see sc.unzip() for extracting
New in version 3.1.4: optionally return just the zipfile object; convert bytes to string