Skip to content

Reports ​

formatfor
textreading in a terminal
jsonscripts; the shape is fixed by schema/report.schema.json and carries a schemaVersion
htmlsending to someone: one self-contained file, printable, no outside requests
markdownGitHub job summaries and pull request comments
sarifGitHub code scanning and other SARIF 2.1.0 readers; each finding links to its rule page
junitCI 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.sarif

One 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.

MIT licensed. It predicts from the artwork; it is not a verifier.