Add support for skipping fields ("-x")

This commit is contained in:
Alan Orth 2021-03-13 23:34:11 +02:00
parent 122d9fd53c
commit 6c3804d55b
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9
2 changed files with 15 additions and 1 deletions

View File

@ -52,6 +52,11 @@ def process():
args = ["-i", input_file, "-o", output_file]
if "excludeCheckbox" in request.form:
if "excludeText" in request.form:
args.append("-x")
args.append(request.form["excludeText"])
if "unsafe" in request.form:
args.append("-u")

View File

@ -14,13 +14,22 @@
<p>Basic options:</p>
<div class="input-group mb-3">
<div class="input-group-text">
Skip fields(s)&nbsp;
<input class="form-check-input" type="checkbox" id="excludeFieldsCheckbox" name="excludeCheckbox" aria-label="Checkbox for following text input">
</div>
<input type="text" class="form-control" placeholder="dcterms.subject" id="excludeFieldsText" name="excludeText" aria-label="Text input with checkbox">
<div id="excludeHelp" class="form-text">Optionally indicate fields to skip during analysis. Separate multiple fields with a comma, for example: <code>dcterms.issued,dcterms.subject</code>.</div>
</div>
<div class="mb-3 form-check form-switch">
<input class="form-check-input" type="checkbox" id="unsafeCheckbox" name="unsafe">
<label class="form-check-label" for="unsafeCheckbox" aria-describedby="unsafeHelp">Enable unsafe fixes</label>
<div id="unsafeHelp" class="form-text">This will remove newlines and perform <a href="https://withblue.ink/2019/03/11/why-you-need-to-normalize-unicode-strings.html" title='When "Zoë" !== "Zoë". Or why you need to normalize Unicode strings'>normalization of Unicode characters</a>. Read more about these <a href="https://github.com/ilri/csv-metadata-quality#unsafe-fixes">unsafe fixes</a>.</div>
</div>
<p>Experimental options</p>
<p>Experimental options:</p>
<div class="mb-3 form-check form-switch">
<input class="form-check-input" type="checkbox" id="experimentalCheckbox" name="experimental">