swh.indexer.storage.model module

Classes used internally by the in-memory idx-storage, and will be used for the interface of the idx-storage in the near future.

class swh.indexer.storage.model.BaseRow(id: Any, *, indexer_configuration_id: Optional[int] = None, tool: Optional[Dict] = None)[source]

Bases: object

Method generated by attrs for class BaseRow.

UNIQUE_KEY_FIELDS: Tuple = ('id', 'indexer_configuration_id')
anonymize() Optional[swh.indexer.storage.model.TSelf][source]
to_dict() Dict[str, Any][source]

Wrapper of attr.asdict that can be overridden by subclasses that have special handling of some of the fields.

classmethod from_dict(d) swh.indexer.storage.model.TSelf[source]
unique_key() Dict[source]
class swh.indexer.storage.model.ContentMimetypeRow(id: bytes, mimetype: str, encoding: str, *, indexer_configuration_id: Optional[int] = None, tool: Optional[Dict] = None)[source]

Bases: swh.indexer.storage.model.BaseRow

Method generated by attrs for class ContentMimetypeRow.

object_type: Final = 'content_mimetype'
class swh.indexer.storage.model.ContentLicenseRow(id: bytes, license: str, *, indexer_configuration_id: Optional[int] = None, tool: Optional[Dict] = None)[source]

Bases: swh.indexer.storage.model.BaseRow

Method generated by attrs for class ContentLicenseRow.

object_type: Final = 'content_fossology_license'
UNIQUE_KEY_FIELDS: Tuple = ('id', 'indexer_configuration_id', 'license')
class swh.indexer.storage.model.ContentMetadataRow(id: bytes, metadata: Dict[str, Any], *, indexer_configuration_id: Optional[int] = None, tool: Optional[Dict] = None)[source]

Bases: swh.indexer.storage.model.BaseRow

Method generated by attrs for class ContentMetadataRow.

object_type: Final = 'content_metadata'
class swh.indexer.storage.model.DirectoryIntrinsicMetadataRow(id: bytes, metadata: Dict[str, Any], mappings: List[str], *, indexer_configuration_id: Optional[int] = None, tool: Optional[Dict] = None)[source]

Bases: swh.indexer.storage.model.BaseRow

Method generated by attrs for class DirectoryIntrinsicMetadataRow.

object_type: Final = 'directory_intrinsic_metadata'
class swh.indexer.storage.model.OriginIntrinsicMetadataRow(id: str, metadata: Dict[str, Any], from_directory: bytes, mappings: List[str], *, indexer_configuration_id: Optional[int] = None, tool: Optional[Dict] = None)[source]

Bases: swh.indexer.storage.model.BaseRow

Method generated by attrs for class OriginIntrinsicMetadataRow.

object_type: Final = 'origin_intrinsic_metadata'
class swh.indexer.storage.model.OriginExtrinsicMetadataRow(id: str, metadata: Dict[str, Any], from_remd_id: bytes, mappings: List[str], *, indexer_configuration_id: Optional[int] = None, tool: Optional[Dict] = None)[source]

Bases: swh.indexer.storage.model.BaseRow

Method generated by attrs for class OriginExtrinsicMetadataRow.

object_type: Final = 'origin_extrinsic_metadata'
id

origin URL

from_remd_id

id of the RawExtrinsicMetadata object used as source for indexed metadata