import_download_cache

astropy.utils.data.import_download_cache(filename_or_obj, urls=None, update_cache=False, pkgname='astropy')[source]

Imports the contents of a ZIP file into the cache.

Each member of the ZIP file should be named by a quoted version of the URL whose contents it stores. These names are decoded with unquote().

Parameters:
filename_or_objpython:str or python:file-like object

Where the stored ZIP file is. Must be something the zipfile module can read from.

urlsset of python:str or python:list of python:str or python:None

The URLs to import from the ZIP file. The default is all URLs in the file.

update_cachebool, optional

If True, any entry in the ZIP file will overwrite the value in the cache; if False, leave untouched any entry already in the cache.

pkgnamestr, optional

The package name to use to locate the download cache. i.e. for pkgname='astropy' the default cache location is ~/.astropy/cache.

See also

export_download_cache

export the contents the cache to of such a ZIP file

import_file_to_cache

import a single file directly