Skip to main content
`Ctrl`+`K`

# export_download_cache

astropy.utils.data.export_download_cache(filename_or_obj, urls=None, overwrite=False, pkgname='astropy')

  Exports the cache contents as a ZIP file.

  Parameters:
    filename_or_obj `python:str` or python:file-like object

      Where to put the created ZIP file. Must be something the zipfile module can write to.

    urls python:iterable of `python:str` or `python:None`

      The URLs to include in the exported cache. The default is all URLs currently in the cache. If a URL is included in this list but is not currently in the cache, a KeyError will be raised. To ensure that all are in the cache use `download_file` or `download_files_in_parallel`.

    overwrite bool, optional

      If filename_or_obj is a filename that exists, it will only be overwritten if this is True.

    pkgname `str`, optional

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

  See also

  `import_download_cache`

    import the contents of such a ZIP file

  `import_file_to_cache`

    import a single file directly