swh.indexer.metadata_mapping.codemeta module#
- class swh.indexer.metadata_mapping.codemeta.CodemetaMapping(log_suffix='')[source]#
Bases:
SingleFileIntrinsicMappingdedicated class for CodeMeta (codemeta.json) mapping and translation
- name = 'codemeta'#
- string_fields = None#
- translate(content: bytes) Dict[str, Any] | None[source]#
Translates content by parsing content from a bytestring containing mapping-specific data and translating with the appropriate mapping to JSON-LD using the Codemeta and ForgeFed vocabularies.
- Parameters:
raw_content – raw content to translate
- Returns:
translated metadata in JSON friendly form needed for the content if parseable,
Noneotherwise.