Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/storage/__init__.py
Show First 20 Lines • Show All 621 Lines • ▼ Show 20 Lines | def origin_intrinsic_metadata_get(self, ids, db=None, cur=None): | ||||
"""Retrieve origin metadata per id. | """Retrieve origin metadata per id. | ||||
Args: | Args: | ||||
ids (iterable): origin identifiers | ids (iterable): origin identifiers | ||||
Yields: | Yields: | ||||
list: dictionaries with the following keys: | list: dictionaries with the following keys: | ||||
- **id** (int) | - **origin_id** (int) | ||||
- **translated_metadata** (str): associated metadata | - **translated_metadata** (str): associated metadata | ||||
- **tool** (dict): tool used to compute metadata | - **tool** (dict): tool used to compute metadata | ||||
""" | """ | ||||
for c in db.origin_intrinsic_metadata_get_from_list(ids, cur): | for c in db.origin_intrinsic_metadata_get_from_list(ids, cur): | ||||
yield converters.db_to_metadata( | yield converters.db_to_metadata( | ||||
dict(zip(db.origin_intrinsic_metadata_cols, c))) | dict(zip(db.origin_intrinsic_metadata_cols, c))) | ||||
▲ Show 20 Lines • Show All 107 Lines • Show Last 20 Lines |