Skip to main content

barcode-claim-audit 0.1.0

An offline static audit of documented code-reading claims against Python source. Requires Python >=3.9, with no runtime dependencies. Source is parsed with AST and never executed. Environment files are never opened.

Usage

python3 -m pip install .
barcode-claim-audit /path/to/project
python3 -m barcode_claim_audit /path/to/project --json
python3 -m barcode_claim_audit /path/to/project --verbose --ignore 'vendor/*'
python3 -m barcode_claim_audit /path/to/project --fail-on MEDIUM
python3 -m barcode_claim_audit --version

JSON stdout contains verdict, findings (rule, severity, message), evidence flags, and inspected file paths. Human output shows the verdict and all findings. Repeat --ignore to exclude relative paths using glob patterns; matching directories are pruned. --verbose adds a file count in human output. Default threshold is HIGH; MEDIUM reports remain visible but exit successfully. Exit codes: 0 for PASS, 2 for findings meeting the threshold, 1 for usage or filesystem errors.

Matching and rules

Only root README.md and Markdown files with a docs path component contribute claims. Fenced code is excluded; inline code counts. Matching lowercases text, expands n't to not, replaces hyphens with spaces and joins whitespace within blank-line-separated paragraphs. Exact templates use word boundaries, longest first. Negative spans are removed before positive matching. The full template sets are in barcode_claim_audit/phrases.py. Examples:

scans qr codes
supports barcode scanning
does not scan qr codes
no barcode support

One finding per family, at most two: documented-barcode-claim-false is HIGH when a positive template has no production evidence, or MEDIUM when evidence exists only in tests. documented-no-barcode-claim-false is HIGH when a negative template conflicts with production evidence. Without claims the result is PASS. With no source, a positive template yields HIGH and a negative one yields PASS.

Production evidence excludes tests/, test_*.py, *_test.py, fixtures/, docs/, examples/, and symlinks. Test evidence is limited to tests/ and test-named files outside the other excluded directories. Imports are resolved per module, including aliases; local functions and classes shadow imported names.

Supported calls: pyzbar.pyzbar.decode, pylibdmtx.pylibdmtx.decode, zxingcpp.read_barcode/read_barcodes, cv2.QRCodeDetector and cv2.barcode_BarcodeDetector. Construction alone counts for cv2. Bound detector methods detect, detectAndDecode and detectAndDecodeMulti (including self attributes, with targets and chained construction) consequently qualify too.

Limitations

Only the exact templates count. A bare QR or barcode word is insufficient. Generation, camera capture, image opening, file export and setup instructions about a user holding a code up to a camera are outside the claim vocabulary. Comments, docstrings and strings alone are never evidence. Imports without calls, image creation, camera access and unbound lookalike methods do not qualify. System code reader helpers invoked through subprocess are not counted; command names inside strings are never evidence. Other scan stacks, including phone-camera SDKs and hardware scanner wedges that type keystrokes, are out of scope; only the Python decode routes listed above are counted.

This checks syntax rather than runtime success, reachability, dependency availability, image quality or actual hardware. Dynamic imports and reassignment are not modeled. Local definitions conservatively shadow imports throughout a module. Syntax-invalid source contributes no evidence. Filesystem errors produce a usage error.

Development

python3 -m unittest discover
python3 -m build

The sdist includes the test suite and fixtures. License: MIT.

Metadata

Release files for barcode-claim-audit 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for barcode-claim-audit 0.1.0
File Size Uploaded Provenance Actions
barcode_claim_audit-0.1.0.tar.gz 15.6 kB Without provenance Details for barcode_claim_audit-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for barcode-claim-audit 0.1.0
File Interpreter ABI Platform Actions
barcode_claim_audit-0.1.0-py3-none-any.whl Python 3 none any Details for barcode_claim_audit-0.1.0-py3-none-any.whl

Total release size: 23.3 kB

Release files / barcode_claim_audit-0.1.0.tar.gz

Download URL barcode_claim_audit-0.1.0.tar.gz
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c69eaed73daa1d840dca1a4cfc97720458401dfa19485d4a061c3de9a1922eff
BLAKE2b-256 checksum
How to use checksums
0c22fb54def608a89813f313bf7a2d9ab5b8bcc010de5e0ab2cae9cabe4b7924
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / barcode_claim_audit-0.1.0-py3-none-any.whl

Download URL barcode_claim_audit-0.1.0-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4817eaf589ed13a13cf7c15e3d736104a6fbf29cf7b8a4af70cc8861cbafc0e
BLAKE2b-256 checksum
How to use checksums
dd57aee151063ab0f514a9a24986767e99188204a38c35f3c94df685834dafb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for barcode-claim-audit 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page