clams.appmetadata package

Module contents

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

Defines a 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.

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

add_input(at_type: Union[str, mmif.vocabulary.base_types.TypesBase], required: bool = True, **properties)[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

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: Union[str, mmif.vocabulary.base_types.TypesBase], **properties)[source]

Helper method to add an element to the output list.

Parameters
  • at_type@type of the input object

  • properties – additional property specifications

add_parameter(name: str, description: str, type: typing_extensions.Literal[‘integer’, ‘number’, ‘string’, ‘boolean’], choices: Optional[List[Union[int, float, str]]] = None, default: Union[int, float, str] = None)[source]

Helper method to add an element to the parameters list.