Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SFR-2171: Fixing OCLC bib author mapping #367

Merged
merged 7 commits into from
Sep 18, 2024
Merged

Conversation

kylevillegas93
Copy link
Contributor

@kylevillegas93 kylevillegas93 commented Sep 17, 2024

Description

  • FIxes OCLC bib author mapping
  • Tries to get text first then fallbacks to romanized text
  • Handles first name or second name not being present in the contributor

Testing

make unit

@kylevillegas93 kylevillegas93 marked this pull request as ready for review September 17, 2024 21:15
Copy link
Contributor

@Apophenia Apophenia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this takes care of the known edge cases. If we come across more, we have a framework for adding a test & fix. Thanks for putting this together!

def _get_creators(self, oclc_bib):
if not oclc_bib.get('contributor'):
return None

return list(
filter(
lambda creator: creator.get('secondName') and creator.get('firstName'),
oclc_bib['contributor'].get('creators', [])
lambda creator: creator.get('secondName') or creator.get('firstName'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


oclc_bib_mapping = OCLCBibMapping(base_oclc_bib)

assert ['Simpson, Homer|||true'] == oclc_bib_mapping.record.authors
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding these!

@kylevillegas93 kylevillegas93 merged commit 5cc5167 into main Sep 18, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants