Reports
| format | for |
|---|---|
text | reading in a terminal |
json | scripts; the shape is fixed by schema/report.schema.json and carries a schemaVersion |
html | sending to someone: one self-contained file, printable, no outside requests |
markdown | GitHub job summaries and pull request comments |
sarif | GitHub code scanning and other SARIF 2.1.0 readers; each finding links to its rule page |
junit | CI systems that read test reports; one test case per code |
sh
npx barcode-grader "artwork/**/*.pdf" --format html -o barcodes.html
npx barcode-grader label.pdf --report json=label.json,sarif=label.sarifOne file named on the command line gives one JSON object; a folder, a pattern or several files give an array.
From Python or anything else
python
import json, subprocess
out = subprocess.run(["npx", "barcode-grader", "label.pdf", "--json", "--fail-on", "never"], capture_output=True, text=True)
for code in json.loads(out.stdout)["codes"]:
print(code["name"], code["value"], code["verdict"])The same functions are exported for your own code as barcode-grader/report: formatText, formatJson, formatSarif, formatHtml, formatMarkdown, formatJunit.