Skip to content

Python port: add photo reader, library docs, examples, pyproject - #12

Open
avishorwork-wq wants to merge 1 commit into
mainfrom
ports-python-reader
Open

avishorwork-wq wants to merge 1 commit into
mainfrom
ports-python-reader

Conversation

@avishorwork-wq

@avishorwork-wq avishorwork-wq commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Adds the photo reader to the Python port and tidies the port for use.

  • reader/: prism_reader.py (detection, hypothesis search, Reed-Solomon, palette-mix and distance-fit recovery), prism_chain.py (page retry chain), read.py (entry point). Needs numpy and Pillow; the encoder, decoder and Secure modules still need only the standard library.
  • pyproject.toml (name Comb Code package, author Avi Shor, optional "reader" extra), README with install, example, API reference, reader usage and license note, examples/encode_decode.py and examples/read_photo.py.
  • Reader dev-only paths removed (hard-coded /tmp import paths), comments reworded. No change to encoder/decoder or reader behavior.

Checks: reader code is AST-identical to the previous source apart from docstrings and comments; pip install . works (modules installed); encode/decode example round-trips; read_photo.py reads a clean code and two kit scenes. Not re-run here: a full 772-scene pass (blurred scenes take minutes each in pure Python). The earlier full-kit count for this reader was 706 of 772, 0 wrong (from the original port work).
Known limits (stated in the README): chain canvas resizes are approximated with Pillow, time budgets are not enforced, slow on hard photos.

Sample run (not a full gate): every 8th bench scene, 97 of 772, run one at a time with a 40 s limit per scene: 68 read with the expected payload, 29 did not finish within the limit, 0 wrong payloads. The reader is slow on hard photos in pure Python. A full 772 pass was not run.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant