Skip to content

Commit

Permalink
Add 'alma' as SourceRecord origin option
Browse files Browse the repository at this point in the history
Why these changes are being introduced:
With the addition of Alam MARC records, we will need some logic branching to handle these records,
which is the primary purpose of the SourceRecord.origin property.

How this addresses that need:
* Add 'alma' as option for SourceRecord.origin

Side effects of this change:
* None

Relevant ticket(s):
* https://mitlibraries.atlassian.net/browse/GDT-226
  • Loading branch information
ghukill committed Mar 13, 2024
1 parent 6ecc981 commit d2fa2ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion harvester/harvest/alma.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def create_source_record_from_marc_record(
)

return identifier, MARC(
origin="mit",
origin="alma",
identifier=identifier,
data=etree.tostring(marc_record.node),
marc=marc_record,
Expand Down
4 changes: 3 additions & 1 deletion harvester/records/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class SourceRecord:
ogm_repo_config: config dictionary of OGM repository from configuration YAML
"""

origin: Literal["mit", "ogm"] = field(validator=in_(["mit", "ogm"]))
origin: Literal["alma", "mit", "ogm"] = field(validator=in_(["alma", "mit", "ogm"]))
identifier: str = field(validator=instance_of(str))
metadata_format: Literal["fgdc", "iso19139", "gbl1", "aardvark", "marc"] = field(
validator=in_(["fgdc", "iso19139", "gbl1", "aardvark", "marc"])
Expand Down Expand Up @@ -474,6 +474,8 @@ def _schema_provider_s(self) -> str:
For OGM harvests, provider will come from named defined in OGM configuration YAML.
"""
match self.origin:
case "alma":
return "MIT Libraries"
case "mit":
return "GIS Lab, MIT Libraries"
case "ogm":
Expand Down

0 comments on commit d2fa2ff

Please sign in to comment.