Add helper function

This commit is contained in:
Edward Betts 2019-09-25 13:23:07 +01:00
parent 2a403cb544
commit 0b10bde447

View file

@ -16,6 +16,10 @@ def row_id(row):
def get_row_value(row, field):
return row[field]['value'] if field in row else None
def get_row_text(row, field):
if field in row and 'xml:lang' in row[field]:
return row[field]['value']
def commons_uri_to_filename(uri):
return urllib.parse.unquote(utils.drop_start(uri, commons_start))