WebSource#

class pymovements.WebSource(url: str, *, filename: str | None = None, md5: str | None = None, mirrors: list[str] | None = None)[source]#

Web-based source of a dataset resource.

url#

Primary URL of the resource to be downloaded.

Type:

str

filename#

Optional target filename. Must be provided for calling download().

Type:

str | None

md5#

Optional MD5 checksum for integrity verification.

Type:

str | None

mirrors#

Optional list of full mirror URLs. Tried in order if primary URL fails.

Type:

list[str] | None

Methods

__init__(url, *[, filename, md5, mirrors])

checksum(path, *[, chunk_size])

Calculate MD5 checksum.

download(target_dirpath, *[, ...])

Download this resource into target_dirpath.

from_dict(data)

Create a WebSource from a dictionary.

to_dict(*[, exclude_none])

Serialize this WebSource to a dictionary.

verify_checksum(path, *[, chunk_size])

Verify file integrity by comparing MD5 checksums.