- class cartopy.io.Downloader(url_template, target_path_template, pre_downloaded_path_template='')¶
Represents a resource, that can be configured easily, which knows how to acquire itself (perhaps via HTTP).
The key interface method is
path()- typically all external calls will be made to that method. To get hold of an appropriate
Downloader.from_config()static method should be considered.
url_template – The template of the full URL representing this resource.
target_path_template – The template of the full path to the file that this Downloader represents. Typically the path will be a subdirectory of
config['data_dir'], but this is not a strict requirement. If the file does not exist when calling
Downloader.path()it will be downloaded to this location.
pre_downloaded_path_template (optional) – The template of a full path of a file which has been downloaded outside of this Downloader which should be used as the file that this resource represents. If the file does not exist when
Downloader.path()is called it will not be downloaded to this location (unlike the
*_templatearguments should be formattable using the standard
string.format()rules. The formatting itself is not done until a call to a subsequent method (such as
- __init__(url_template, target_path_template, pre_downloaded_path_template='')¶
Download, via HTTP, the file that this resource represents.
from_configstatic method implements the logic for acquiring a Downloader (sub)class instance from the config dictionary.
Returns the path to a file on disk that this resource represents.
The path on disk of the file that this resource represents, if it does not exist, then no further action will be taken with this path, and all further processing will be done using
The path on disk of the file that this resource represents, must either exist, or be writable by the current user.
The full URL that this resource represents.
The minimum keys which should be provided in the
format_dictargument for the