DataManager#
- class sunpy.data.data_manager.DataManager(cache)[source]#
Bases:
object
This class provides a remote data manager for managing remote files.
- Parameters:
cache (
sunpy.data.data_manager.cache.Cache
) – Cache object to be used byDataManager
.
Methods Summary
get
(name)Get the file by name, and download it if deferred.
override_file
(name, uri[, sha_hash])Replaces the file by the name with the file provided by the url/path.
require
(name, urls, sha_hash[, defer_download])Decorator for informing the data manager about the requirement of a file by a function.
Disables hash checking temporarily.
Methods Documentation
- get(name)[source]#
Get the file by name, and download it if deferred.
- Parameters:
name (
str
) – Name of the file given to the data manager, same as the one provided inrequire
.- Returns:
pathlib.Path
– Path of the file.- Raises:
KeyError – If
name
is not in the cache.
- override_file(name, uri, sha_hash=None)[source]#
Replaces the file by the name with the file provided by the url/path.
- Parameters:
name (
str
) – Name of the file provided in therequire
decorator.uri (
str
) – URI of the file which replaces original file. Scheme should be one ofhttp
,https
,ftp
orfile
. If no scheme is given the uri will be interpreted as a local path. i.e.file:///tmp/test
and/tmp/test
are the same.sha_hash (
str
, optional) – SHA256 hash of the file to compared to after downloading.