tune worldcat parser
This commit is contained in:
parent
a8866ca3b3
commit
2d3a0b2247
1 changed files with 7 additions and 0 deletions
|
@ -85,6 +85,13 @@ def lookup(id):
|
|||
data['publisher'] = publisher
|
||||
data['date'] = date
|
||||
data['place'] = [place]
|
||||
elif ':' in data['publisher']:
|
||||
place, publisher = data['publisher'].split(':', 2)
|
||||
data['place'] = place.strip()
|
||||
data['publisher'] = publisher.split(',')[0].strip()
|
||||
m = re.compile('\d{4}').findall(publisher)
|
||||
if m:
|
||||
data['date'] = m[0]
|
||||
|
||||
logger.debug('lookup %s => %s', id, data.keys())
|
||||
return data
|
||||
|
|
Loading…
Reference in a new issue