Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/api/private/deposit_read.py
Show First 20 Lines • Show All 141 Lines • ▼ Show 20 Lines | def metadata_read(self, deposit: Deposit) -> Dict[str, Any]: | ||||
deposit: Deposit to retrieve information from | deposit: Deposit to retrieve information from | ||||
Returns: | Returns: | ||||
Dictionary of deposit information read by the deposit loader, with the | Dictionary of deposit information read by the deposit loader, with the | ||||
following keys: | following keys: | ||||
**origin** (Dict): Information about the origin | **origin** (Dict): Information about the origin | ||||
**metadata_raw** (str): List of raw metadata received for the | **raw_metadata** (str): List of raw metadata received for the | ||||
deposit | deposit | ||||
**metadata_dict** (Dict): Deposit aggregated metadata into one dict | |||||
**provider** (Dict): the metadata provider information about the | **provider** (Dict): the metadata provider information about the | ||||
deposit client | deposit client | ||||
**tool** (Dict): the deposit information | **tool** (Dict): the deposit information | ||||
**deposit** (Dict): deposit information relevant to build the revision | **deposit** (Dict): deposit information relevant to build the revision | ||||
(author_date, committer_date, etc...) | (author_date, committer_date, etc...) | ||||
Show All 31 Lines | def metadata_read(self, deposit: Deposit) -> Dict[str, Any]: | ||||
"origin": {"type": "deposit", "url": deposit.origin_url}, | "origin": {"type": "deposit", "url": deposit.origin_url}, | ||||
"provider": { | "provider": { | ||||
"provider_name": deposit.client.last_name, | "provider_name": deposit.client.last_name, | ||||
"provider_url": deposit.client.provider_url, | "provider_url": deposit.client.provider_url, | ||||
"provider_type": MetadataAuthorityType.DEPOSIT_CLIENT.value, | "provider_type": MetadataAuthorityType.DEPOSIT_CLIENT.value, | ||||
"metadata": {}, | "metadata": {}, | ||||
}, | }, | ||||
"tool": self.tool, | "tool": self.tool, | ||||
"metadata_raw": raw_metadata, | "raw_metadata": raw_metadata, | ||||
"deposit": { | "deposit": { | ||||
"id": deposit.id, | "id": deposit.id, | ||||
"client": deposit.client.username, | "client": deposit.client.username, | ||||
"collection": deposit.collection.name, | "collection": deposit.collection.name, | ||||
"author": SWH_PERSON, | "author": SWH_PERSON, | ||||
"author_date": author_date, | "author_date": author_date, | ||||
"committer": SWH_PERSON, | "committer": SWH_PERSON, | ||||
"committer_date": commit_date, | "committer_date": commit_date, | ||||
Show All 10 Lines |