lsru.utils.url_retrieve_and_unpack

lsru.utils.url_retrieve_and_unpack(url, path, overwrite=False)[source]

Generic function to combine download and unpacking of tar archives

Downloads the tar archive as a memory object and extracts its content to a new directory. Directory name is the remote file name with stripped extension

Parameters:
  • url (str) – Url pointing to tar file to retrieve
  • path (str) – Path to directory under which a new directory containing the archive content will be created
  • overwrite (bool) – Force overwriting local files even when the output directory already exist? Defaults to False
Returns:

The path containing extracted content

Return type:

str