ResourceDefinition#

class pymovements.ResourceDefinition(content: str, *, source: WebSource | None = None, url: str | None = None, filename: 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

source#

The source of the downloadable resource. (default: None)

Type:

WebSource | 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.

Type:

dict[str, Any]

Parameters:
  • content (str) – The content type of the resource.

  • source (WebSource | None) – The source of the downloadable resource. (default: None)

  • url (str | None) – The URL to the downloadable resource. (default: None)

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

  • mirrors (list[str] | None) – 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)

  • md5 (str | None) – The MD5 checksum of the downloadable resource. (default: None)

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

  • filename_pattern_schema_overrides (dict[str, type] | None) – If named groups are present in the filename_pattern, this specifies their particular datatypes. (default: None)

  • load_function (str | None) – 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)

  • load_kwargs (dict[str, Any] | None) – A dictionary of additional keyword arguments that are passed to the load_function. (default: None)

Methods

__init__(content, *[, source, url, ...])

from_dict(dictionary)

Create a Resource instance from a dictionary.

to_dict(*[, exclude_none])

Convert the ResourceDefinition instance into a dictionary.

Attributes

filename

The target filename of the downloadable resource.

filename_pattern

filename_pattern_schema_overrides

load_function

md5

The MD5 checksum of the downloadable resource.

mirrors

A list of additional mirror URLs to download the resource.

source

url

The URL to the downloadable resource.

content

load_kwargs