extraction_methods.plugins.header package

Subpackages

Submodules

extraction_methods.plugins.header.header module

Header Method

class extraction_methods.plugins.header.header.HeaderExtract(*args: Any, **kwargs: Any)

Bases: ExtractionMethod, SetEntryPointsMixin

Method: header

Description:

Takes a header backend to run and returns the updated body from the configured backend.

Configuration Options: .. list-table:

- ``backend``: Specify which backend

Example configuration: .. code-block:: yaml

  • method: header inputs:

    backend:

    name: xarray inputs:

    kwargs:

    decode_times: False

    attributes:
    • name: institution

    • name: sensor

entry_point_group: str = 'extraction_methods.header.backends'
input_class

alias of HeaderInput

run(body: dict[str, Any]) Any

Run the method.

Parameters:

body (dict) – current generated properties

Returns:

updated body dict

Return type:

dict

class extraction_methods.plugins.header.header.HeaderInput(*, exists_key: str = '$', exists_delimiter: str = '.', backend: Backend)

Bases: Input

Model for Header Method Input.

backend: Backend
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'backend': FieldInfo(annotation=Backend, required=True, description='Backend and inputs to run.'), 'exists_delimiter': FieldInfo(annotation=str, required=False, default='.', description='Delimiter for nested exists terms.'), 'exists_key': FieldInfo(annotation=str, required=False, default='$', description='Key to signify a previously extracted terms.')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

Module contents

Header Extract

class extraction_methods.plugins.header.HeaderExtract(*args: Any, **kwargs: Any)

Bases: ExtractionMethod, SetEntryPointsMixin

Method: header

Description:

Takes a header backend to run and returns the updated body from the configured backend.

Configuration Options: .. list-table:

- ``backend``: Specify which backend

Example configuration: .. code-block:: yaml

  • method: header inputs:

    backend:

    name: xarray inputs:

    kwargs:

    decode_times: False

    attributes:
    • name: institution

    • name: sensor

entry_point_group: str = 'extraction_methods.header.backends'
input_class

alias of HeaderInput

run(body: dict[str, Any]) Any

Run the method.

Parameters:

body (dict) – current generated properties

Returns:

updated body dict

Return type:

dict