Skip to content

Commit

Permalink
Add get_source_link method to MITAardvark class
Browse files Browse the repository at this point in the history
  • Loading branch information
ehanson8 committed Jan 4, 2024
1 parent e6d1a1c commit b990ab4
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions transmogrifier/sources/json/aardvark.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,28 @@ def get_main_titles(cls, source_record: dict) -> list[str]:
"""
return [source_record["dct_title_s"]]

@classmethod
def get_source_link(
cls, source_base_url: str, source_record_id: str, source_record: dict[str, JSON]
) -> str:
"""
Class method to set the source link for the item.
May be overridden by source subclasses if needed.
Default behavior is to concatenate the source base URL + source record id.
Args:
source_base_url: Source base URL.
source_record_id: Record identifier for the source record.
source_record: A BeautifulSoup Tag representing a single XML record.
- not used by default implementation, but could be useful for subclass
overrides
"""
return source_base_url + cls.get_timdex_record_id(
"gismit", source_record_id, source_record
)

@classmethod
def get_timdex_record_id(
cls, source: str, source_record_id: str, source_record: dict[str, JSON]
Expand Down

0 comments on commit b990ab4

Please sign in to comment.