store.backends.http_simple_store
¶
Module Contents¶
Classes¶
Object representing resource metadata. |
|
Attributes¶
- store.backends.http_simple_store.logger¶
- class store.backends.http_simple_store.HTTPSimpleStoreResourceInfo(url: str, sha: str)¶
Bases:
e3.store.backends.base.ResourceInfo
Object representing resource metadata.
This is subclassed by all store drivers.
- property uid: str¶
Return an unique identifier.
This is meant to be used to implement a cache system.
- verify(resource_path: str) bool ¶
Verify that a downloaded resource is valid.
This is meant to validate the resource fingerprint (e.g. sha1sum). :param resource_path: path to the downloaded resource
- class store.backends.http_simple_store.HTTPSimpleStore(store_configuration: Any, cache_backend: e3.store.cache.backends.base.Cache)¶
Bases:
e3.store.backends.base.Store
- get_resource_metadata(query: dict[str, str]) HTTPSimpleStoreResourceInfo ¶
Return resource metadata directly computed from the query.
There is no remote server involved here.
- Parameters:
query – a dict containing two keys ‘sha’ and ‘url’. sha is the sha1sum of the resource and url is the remote url
- download_resource_content(metadata: e3.store.backends.base.ResourceInfo, dest: str) str | None ¶
Download a resource.
- Parameters:
metadata – metadata associated with the resource to download
dest – where to download the resource
- Returns:
the path to the downloaded resource