swh.indexer.storage.converters module

swh.indexer.storage.converters.ctags_to_db(ctags)[source]

Convert a ctags entry into a ready ctags entry.

Parameters

ctags (dict) –

ctags entry with the following keys:

  • id (bytes): content’s identifier

  • tool_id (int): tool id used to compute ctags

  • ctags ([dict]): List of dictionary with the following keys:

    • name (str): symbol’s name

    • kind (str): symbol’s kind

    • line (int): symbol’s line in the content

    • language (str): language

Returns

list of ctags entries as dicts with the following keys:

  • id (bytes): content’s identifier

  • name (str): symbol’s name

  • kind (str): symbol’s kind

  • language (str): language for that content

  • tool_id (int): tool id used to compute ctags

Return type

list

swh.indexer.storage.converters.db_to_ctags(ctag)[source]

Convert a ctags entry into a ready ctags entry.

Parameters

ctags (dict) –

ctags entry with the following keys:

  • id (bytes): content’s identifier

  • ctags ([dict]): List of dictionary with the following keys: - name (str): symbol’s name - kind (str): symbol’s kind - line (int): symbol’s line in the content - language (str): language

Returns

list of ctags ready entry (dict with the following keys):

  • id (bytes): content’s identifier

  • name (str): symbol’s name

  • kind (str): symbol’s kind

  • language (str): language for that content

  • tool (dict): tool used to compute the ctags

Return type

list

swh.indexer.storage.converters.db_to_mimetype(mimetype)[source]

Convert a ctags entry into a ready ctags output.

swh.indexer.storage.converters.db_to_language(language)[source]

Convert a language entry into a ready language output.

swh.indexer.storage.converters.db_to_metadata(metadata)[source]

Convert a metadata entry into a ready metadata output.

swh.indexer.storage.converters.db_to_fossology_license(license)[source]