eradiate.data.BlindOnlineDataStore#

class eradiate.data.BlindOnlineDataStore(base_url, path, attempts=3)[source]#

Bases: DataStore

Serve data downloaded from a remote source without integrity check.

Parameters:
  • base_url (str) – URL to the online storage location.

  • path (path-like) – Path to the local cache location.

  • attempts (int) – Number of download attempts to make before giving up because of connection errors.

Fields:
  • path (Path) – Path to the local cache location.

  • attempts (int) – Number of download attempts to make before giving up because of connection errors.

fetch(filename, downloader=None)[source]#

Fetch a file from the data store. This method wraps pooch.retrieve() and automatically selects compressed files when they are available.

Parameters:
  • filename (path-like) – File name to fetch from the local storage, relative to the storage root.

  • downloader (callable(), optional) – A callable that will be called to download a given URL to a provided local file name. This is mostly useful to display progress bars during download.

Returns:

path (Path) – Absolute path where the retrieved resource is located.

Notes

If a compressed resource exists, it will be served automatically. For instance, if "foo.nc" is requested and "foo.nc.gz" is registered, the latter will be downloaded, decompressed and served as "foo.nc".

purge(keep=None)[source]#

Purge local storage location. The default behaviour is very aggressive and will wipe out the entire directory contents.

Parameters:

keep (str or list of str, optional) – A list of exclusion rules (paths relative to the store’s local storage root, shell wildcards allowed) defining files which should be excluded from the purge process.

Warning

This is a destructive operation, make sure you know what you’re doing!

registry_files(filter=None)[source]#

Returns an empty list (this data store has no registry).

property base_url#

Address of the remote storage location.

Type:

str

property registry#

Raises NotImplementedError (this data store has no registry).