clams.appmetadata package

Module contents

class clams.appmetadata.AppMetadata(*, name: str, description: str, app_version: str = None, mmif_version: str = None, analyzer_version: str = None, app_license: str, analyzer_license: str = None, identifier: AnyHttpUrl, url: AnyHttpUrl, input: List[Input | List[Input]] = [], output: List[Output] = [], parameters: List[RuntimeParameter] = [], dependencies: List[str] = None, more: Dict[str, str] = None)[source]

Data model that describes a CLAMS app.

Can be initialized by simply passing all required key-value pairs.

If you have a pre-generated metadata as an external file, you can read in the file as a dict and use it as keyword arguments for initialization. But be careful with keys of which values are automatically generated by the SDK.

Please refer to <CLAMS App Metadata> for the metadata specification.

add_input(at_type: str | TypesBase, required: bool = True, **properties) Input[source]

Helper method to add an element to the input list.

Parameters:
  • at_type@type of the input object

  • required – whether this type is mandatory or optional

  • properties – additional property specifications

Returns:

the newly added Input object

add_more(key: str, value: str)[source]

Helper method to add a k-v pair to the more map. :param key: key of an additional metadata :param value: value of the additional metadata

add_output(at_type: str | TypesBase, **properties) Output[source]

Helper method to add an element to the output list.

Parameters:
  • at_type@type of the input object

  • properties – additional property specifications

Returns:

the newly added Output object

add_parameter(name: str, description: str, type: Literal['integer', 'number', 'string', 'boolean', 'map'], choices: List[int | float | bool | str] | None = None, multivalued: bool = False, default: int | float | bool | str | List[int | float | bool | str] | None = None)[source]

Helper method to add an element to the parameters list.