1
0
mirror of https://github.com/ilri/csv-metadata-quality.git synced 2025-05-10 15:16:01 +02:00

Add check for uncommon filenames

Generally we want people to upload documents in accessible formats
like PDF, Word, Excel, and PowerPoint. This check warns if a file
is using an uncommon extension.
This commit is contained in:
2019-08-10 23:41:16 +03:00
parent 5ff584a8d7
commit 9ce7dc6716
2 changed files with 49 additions and 0 deletions

View File

@ -86,6 +86,10 @@ def run(argv):
if match is not None:
df[column] = df[column].apply(check.date)
# Check: filename extension
if column == 'filename':
df[column] = df[column].apply(check.filename_extension)
# Write
df.to_csv(args.output_file, index=False)