Skip to content

Commit

Permalink
Merge pull request #1701 from hornc/1530/get-author-from-700
Browse files Browse the repository at this point in the history
Tidy comments around 7xx author fields
  • Loading branch information
mekarpeles committed Dec 18, 2018
2 parents faf4f06 + 6133220 commit 1681290
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions openlibrary/catalog/marc/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class SeeAlsoAsTitle(MarcException):
'035', # oclc
'050', # lc classification
'082', # dewey
'100', '110', '111', # authors TODO
'100', '110', '111', # authors
'130', '240', # work title
'245', # title
'250', # edition
Expand Down Expand Up @@ -306,8 +306,7 @@ def read_author_person(f):
return author

# 1. if authors in 100, 110, 111 use them
# 2. if first contrib is 710 or 711 use it
# 3. if
# 2. if first contrib is 700, 710, or 711 use it

def person_last_name(f):
v = list(f.get_subfield_values('a'))[0]
Expand Down Expand Up @@ -448,6 +447,14 @@ def read_location(rec):
return list(found)

def read_contributions(rec):
""" Reads contributors from a MARC record
and use values in 7xx fields to set 'authors'
if the 1xx fields do not exist. Otherwise set
additional 'contributions'
:param (MarcBinary | MarcXml) rec:
:rtype: dict
"""
want = dict((
('700', 'abcdeq'),
('710', 'ab'),
Expand Down

0 comments on commit 1681290

Please sign in to comment.