meta
This commit is contained in:
parent
edd42dfd76
commit
d385853186
48 changed files with 1344 additions and 488 deletions
|
|
@ -8,6 +8,8 @@ import stdnum.isbn
|
|||
|
||||
import ox
|
||||
|
||||
from meta.utils import normalize_isbn
|
||||
|
||||
def valid_olid(id):
|
||||
return id.startswith('OL') and id.endswith('M')
|
||||
|
||||
|
|
@ -74,9 +76,6 @@ def sort_title(title):
|
|||
title = re.sub(u'[\'!¿¡,\.;\-"\:\*\[\]]', '', title)
|
||||
return title.strip()
|
||||
|
||||
def normalize_isbn(value):
|
||||
return ''.join([s for s in value if s.isdigit() or s == 'X'])
|
||||
|
||||
def find_isbns(text):
|
||||
matches = re.compile('\d[\d\-X\ ]+').findall(text)
|
||||
matches = [normalize_isbn(value) for value in matches]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue