Skip to main content

encoding-claim-audit

Version 0.1.0. Offline static audit of documented UTF-8 and Unicode claims against Python text file I/O. Python >=3.9; no runtime dependencies. Audited code is never executed and no network requests are made.

Usage

python3 -m pip install .
encoding-claim-audit [path]
encoding-claim-audit ./project --json --fail-on HIGH
encoding-claim-audit ./project --ignore documented-encoding-claim-false-test-only
encoding-claim-audit --version

Path defaults to .. --verbose prints verified claim notes and source counts. --json emits findings, verified_claims, and summary. Each finding has a family, rule, severity, message, and evidence items with path, line, and kind. Exit codes: 0 PASS at the selected threshold, 2 FAIL, 1 usage/input error. The default threshold is MEDIUM. --fail-on HIGH still prints MEDIUM findings. Unknown ignore rules are input errors. --ignore RULE,... accepts:

  • documented-encoding-claim-false: HIGH for production evidence or no source.
  • documented-encoding-claim-false-test-only: MEDIUM for test-only evidence.

Each family produces at most one finding. Production evidence takes precedence. Ignored findings are omitted, not relabeled as verified.

Scope and limitations

Claims come from root README.md and docs/**/*.md prose, including inline code. Backtick and tilde fenced code is excluded; sentences containing negation are suppressed. Positive sentences elsewhere can independently establish a claim. UTF-8, utf8, utf_8, and Unicode are recognized case-insensitively.

AST checks cover open/io.open, codecs.open, io.TextIOWrapper, and read_text/ write_text methods. Missing or non-UTF-8 literal encodings are evidence. Standard open positional encoding and codecs.open third positional encoding are recognized; Path methods and TextIOWrapper require keyword encoding. Binary I/O is excluded. Tests are identified by tests/test/fixtures directory components. examples directories and symlinks are skipped. Only Python source and Markdown documentation are read; .env contents are never opened. No claims yields empty findings and verified claims. No Python source yields HIGH per family. No production text I/O makes the claim moot, not falsified.

This is static pattern matching, not semantic judgement. Dead code counts. Variable modes/encodings are skipped as unknown. Dynamic file opens are missed. Alias tracking is per-file only; shadowing and reassignment are not resolved. Text method matching does not infer receiver types and may flag unrelated methods. Negation is conservative and sentence based, so unrelated negative words can suppress claims. Clean results with unknown encodings are qualified rather than proof of runtime behavior. Source must be UTF-8 (optional BOM), docs UTF-8; malformed or unreadable input yields exit 1.

Differentiation

  • privacy-claim-audit: network/telemetry evidence, never text encodings.
  • config-claim-audit: documented default values, never encoding arguments.
  • readme-claim-audit: install/flag/link/version, never encoding.
  • bandit/ruff: code issues, never documentation promises.
  • file/chardet: actual bytes on disk, never documentation versus code truth.

Development

PYTHONPATH=src python3 -m unittest discover -s tests -v
python3 -m build

The source distribution includes tests and good/bad/testonly fixtures, including a marker-only .env read guard. Licensed under MIT.

Metadata

Release files for encoding-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 encoding-claim-audit 0.1.0
File Size Uploaded Provenance Actions
encoding_claim_audit-0.1.0.tar.gz 9.9 kB Without provenance Details for encoding_claim_audit-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 17.5 kB

Release files / encoding_claim_audit-0.1.0.tar.gz

Download URL encoding_claim_audit-0.1.0.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
73b99ba0029b8ae4b7fdef2c5b706557410cf986a911dbd8ba2e9ee1e27b5e3e
BLAKE2b-256 checksum
How to use checksums
6a74ca592f2ce7a9660812d0e4a58f0b72195df83dc5b6d96c3e1386a25155d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

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

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

Security for encoding-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