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

UNIQUE_KEY_FIELDS: Tuple = ('id', 'indexer_configuration_id')
anonymize() → Optional[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) → 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

class swh.indexer.storage.model.ContentLanguageRow(id: bytes, lang: str, *, indexer_configuration_id: Optional[int] = None, tool: Optional[Dict] = None)[source]

Bases: swh.indexer.storage.model.BaseRow

class swh.indexer.storage.model.ContentCtagsRow(id: bytes, name: str, kind: str, line: int, lang: str, *, indexer_configuration_id: Optional[int] = None, tool: Optional[Dict] = None)[source]

Bases: swh.indexer.storage.model.BaseRow

UNIQUE_KEY_FIELDS: Tuple = ('id', 'indexer_configuration_id', 'name', 'kind', 'line', 'lang')
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

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

class swh.indexer.storage.model.RevisionIntrinsicMetadataRow(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

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

Bases: swh.indexer.storage.model.BaseRow