mirror of
https://github.com/ilri/csv-metadata-quality.git
synced 2024-11-21 21:35:02 +01:00
csv_metadata_quality/app.py: Use regex in column match
Check for a column that has "issn" or "isbn" in the name rather than by its explicit name, as the column is dc.identifier.issn now, but will be cg.issn in the future if CG Core v2 happens.
This commit is contained in:
parent
4687e2f5fa
commit
e88d35ace3
@ -17,10 +17,14 @@ def main():
|
||||
# Run invalid multi-value separator check on all columns
|
||||
df[column] = df[column].apply(check.separators)
|
||||
|
||||
if column == 'dc.identifier.issn':
|
||||
# check if column is an issn column like dc.identifier.issn
|
||||
match = re.match(r'^.*?issn.*$', column)
|
||||
if match is not None:
|
||||
df[column] = df[column].apply(check.issn)
|
||||
|
||||
if column == 'dc.identifier.isbn':
|
||||
# check if column is an isbn column like dc.identifier.isbn
|
||||
match = re.match(r'^.*?isbn.*$', column)
|
||||
if match is not None:
|
||||
df[column] = df[column].apply(check.isbn)
|
||||
|
||||
# check if column is a date column like dc.date.issued
|
||||
|
Loading…
Reference in New Issue
Block a user