ResourceDefinition#

class pymovements.ResourceDefinition(content: str, filename: str | None = None, url: str | None = None, mirrors: list[str] | None = None, md5: str | None = None, filename_pattern: str | None = None, filename_pattern_schema_overrides: dict[str, type] | None = None, load_function: str | None = None, load_kwargs: dict[str, Any] | None = None)[source]#

ResourceDefinition definition.

content#

The content type of the resource.

Type:

str

filename#

The target filename of the downloadable resource. This may be an archive. (default: None)

Type:

str | None

url#

The URL to the downloadable resource. (default: None)

Type:

str | None

mirrors#

An optional list of additional mirror URLs to download the resource. If downloading the resource from url fails, these mirror URLs are used in order of appearance. (default: None)

Type:

list[str] | None

md5#

The MD5 checksum of the downloadable resource. (default: None)

Type:

str | None

filename_pattern#

The filename pattern of the resource files. Named groups will be parsed as metadata will appear in the fileinfo dataframe. (default: None)

Type:

str | None

filename_pattern_schema_overrides#

If named groups are present in the filename_pattern, this specifies their particular datatypes. (default: None)

Type:

dict[str, type] | None

load_function#

The name of the function used to load the data files. If None, the function is determined by the file extension. Refer to Input / Output for available function names. (default: None)

Type:

str | None

load_kwargs#

A dictionary of additional keyword arguments that are passed to the load_function. (default: None)

Type:

dict[str, Any] | None

Methods

__init__(content[, filename, url, mirrors, ...])

from_dict(dictionary)

Create a Resource instance from a dictionary.

to_dict(*[, exclude_none])

Convert the ResourceDefinition instance into a dictionary.

Attributes