reed-qr 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. reed_qr-0.1.0/.python-version +1 -0
  2. reed_qr-0.1.0/ARCHITECTURE.md +58 -0
  3. reed_qr-0.1.0/CONTRIBUTING.md +132 -0
  4. reed_qr-0.1.0/Cargo.lock +815 -0
  5. reed_qr-0.1.0/Cargo.toml +21 -0
  6. reed_qr-0.1.0/LICENSE +21 -0
  7. reed_qr-0.1.0/LICENSE_AUDIT.md +66 -0
  8. reed_qr-0.1.0/PKG-INFO +645 -0
  9. reed_qr-0.1.0/README.md +627 -0
  10. reed_qr-0.1.0/THIRD_PARTY_NOTICES.md +38 -0
  11. reed_qr-0.1.0/crates/reed-qr-core/Cargo.toml +24 -0
  12. reed_qr-0.1.0/crates/reed-qr-core/LICENSE +21 -0
  13. reed_qr-0.1.0/crates/reed-qr-core/README.md +107 -0
  14. reed_qr-0.1.0/crates/reed-qr-core/THIRD_PARTY_NOTICES.txt +16924 -0
  15. reed_qr-0.1.0/crates/reed-qr-core/examples/roundtrip.rs +14 -0
  16. reed_qr-0.1.0/crates/reed-qr-core/src/codec.rs +143 -0
  17. reed_qr-0.1.0/crates/reed-qr-core/src/encode.rs +115 -0
  18. reed_qr-0.1.0/crates/reed-qr-core/src/error.rs +15 -0
  19. reed_qr-0.1.0/crates/reed-qr-core/src/frame.rs +124 -0
  20. reed_qr-0.1.0/crates/reed-qr-core/src/lib.rs +59 -0
  21. reed_qr-0.1.0/crates/reed-qr-core/src/result.rs +26 -0
  22. reed_qr-0.1.0/crates/reed-qr-core/tests/contracts.rs +281 -0
  23. reed_qr-0.1.0/crates/reed-qr-python/Cargo.toml +21 -0
  24. reed_qr-0.1.0/crates/reed-qr-python/LICENSE +21 -0
  25. reed_qr-0.1.0/crates/reed-qr-python/src/lib.rs +213 -0
  26. reed_qr-0.1.0/docs/compatibility.md +51 -0
  27. reed_qr-0.1.0/docs/integrations.md +69 -0
  28. reed_qr-0.1.0/docs/licenses/python-dependencies.md +37 -0
  29. reed_qr-0.1.0/docs/licenses/rust-dependencies.md +100 -0
  30. reed_qr-0.1.0/docs/streaming.md +98 -0
  31. reed_qr-0.1.0/examples/frame_stream.py +57 -0
  32. reed_qr-0.1.0/examples/static_image.py +10 -0
  33. reed_qr-0.1.0/licenses/RUST-STDLIB.html +29357 -0
  34. reed_qr-0.1.0/licenses/RUST-THIRD-PARTY.txt +18865 -0
  35. reed_qr-0.1.0/licenses/manifest.json +2136 -0
  36. reed_qr-0.1.0/licenses/python-dependencies.json +543 -0
  37. reed_qr-0.1.0/pyproject.toml +75 -0
  38. reed_qr-0.1.0/python/reed_qr/GETTING_STARTED.md +179 -0
  39. reed_qr-0.1.0/python/reed_qr/__init__.py +129 -0
  40. reed_qr-0.1.0/python/reed_qr/__main__.py +5 -0
  41. reed_qr-0.1.0/python/reed_qr/_native.pyi +25 -0
  42. reed_qr-0.1.0/python/reed_qr/api.py +42 -0
  43. reed_qr-0.1.0/python/reed_qr/cli.py +131 -0
  44. reed_qr-0.1.0/python/reed_qr/integrations/__init__.py +1 -0
  45. reed_qr-0.1.0/python/reed_qr/integrations/livekit.py +305 -0
  46. reed_qr-0.1.0/python/reed_qr/py.typed +0 -0
  47. reed_qr-0.1.0/python/reed_qr/scanner.py +501 -0
  48. reed_qr-0.1.0/python/reed_qr/types.py +159 -0
  49. reed_qr-0.1.0/rust-toolchain.toml +4 -0
  50. reed_qr-0.1.0/scripts/check_artifacts.py +158 -0
  51. reed_qr-0.1.0/scripts/prepare_pypi_release.py +180 -0
  52. reed_qr-0.1.0/scripts/update_license_inventory.py +347 -0
  53. reed_qr-0.1.0/scripts/verify_wheel.py +132 -0
  54. reed_qr-0.1.0/scripts/wheel_smoke.py +49 -0
  55. reed_qr-0.1.0/tests/python/test_api.py +121 -0
  56. reed_qr-0.1.0/tests/python/test_cli.py +108 -0
  57. reed_qr-0.1.0/tests/python/test_livekit.py +254 -0
  58. reed_qr-0.1.0/tests/python/test_publish.py +185 -0
  59. reed_qr-0.1.0/tests/python/test_scanner.py +430 -0
  60. reed_qr-0.1.0/uv.lock +635 -0
@@ -0,0 +1 @@
1
+ 3.15.2
@@ -0,0 +1,58 @@
1
+ # Architecture
2
+
3
+ REED QR separates QR processing from video transport and application behavior.
4
+
5
+ ```mermaid
6
+ flowchart LR
7
+ I[PNG or JPEG bytes] --> API[Python API]
8
+ F[Application frames] --> S[Async scanner]
9
+ L[Subscribed LiveKit video] --> A[Optional RTC adapter]
10
+ A --> S
11
+ S --> B[PyO3 binding]
12
+ API --> B
13
+ B --> C[Rust core and rxing]
14
+ C --> R[Owned detection results]
15
+ R --> APP[Application or agent tool]
16
+ ```
17
+
18
+ Rust applications call the core directly. Text encoding follows the same public
19
+ boundary and returns a grayscale image and PNG bytes.
20
+
21
+ ## Components
22
+
23
+ | Component | Responsibility |
24
+ | --- | --- |
25
+ | `crates/reed-qr-core` | Frame validation, grayscale conversion, PNG/JPEG loading, encoding, codec adaptation and result fidelity |
26
+ | `crates/reed-qr-python` | Private native extension, Python exceptions, buffer ownership and interpreter detachment |
27
+ | `python/reed_qr` | Typed public API, asynchronous scheduling, duplicate suppression and event delivery |
28
+ | `python/reed_qr/integrations/livekit.py` | Selected-track readers, RTC event reconciliation and source identity |
29
+
30
+ The core enables only rxing QR encoding/decoding and image PNG/JPEG support.
31
+ Codec types stay private. `qrcode` and Segno are independent test encoders.
32
+
33
+ ## Ownership and scheduling
34
+
35
+ The Python boundary snapshots mutable buffers before native work. Synchronous
36
+ calls detach from the interpreter but wait on the calling thread. The scanner
37
+ uses a bounded thread pool, one replaceable pending frame per source, and a
38
+ bounded result queue. Sampling and duplicate suppression are per source.
39
+
40
+ Applications own camera capture, transport connections, authorization and agent
41
+ tool registration. The RTC adapter owns its readers and scanner; it does not own
42
+ the room or change subscription policy. Track replacement assigns a new source
43
+ generation and discards late results from the previous source.
44
+
45
+ Shutdown stops admission, drops pending work, waits for active native calls, and
46
+ closes readers and workers. Native decoding is not forcibly interrupted. See the
47
+ [streaming contract](docs/streaming.md) for queue, failure and cancellation semantics.
48
+
49
+ ## Payloads
50
+
51
+ rxing raw result bytes contain QR codewords and are not treated as application
52
+ payload bytes. The core verifies byte-mode payloads, optionally with ECI, before
53
+ exposing complete `payload_bytes`. Numeric/alphanumeric modes return text.
54
+ Mixed modes and structured append retain available segments without labeling
55
+ them as a complete exact payload. Non-UTF-8 text is not generally guaranteed.
56
+
57
+ Landmarks identify detector points; the API does not infer four outer corners.
58
+ Application actions remain outside the codec and scanner.
@@ -0,0 +1,132 @@
1
+ # Contributing
2
+
3
+ Use the Rust toolchain in `rust-toolchain.toml`, Python 3.11–3.15, and uv 0.13.6
4
+ or newer. The development interpreter is pinned to Python 3.15.2.
5
+ On Windows, source builds need Visual Studio C++ Build Tools and the Windows SDK.
6
+
7
+ ## Environment and checks
8
+
9
+ ```sh
10
+ uv sync --locked --extra livekit
11
+ uv run --locked --extra livekit python -m pytest
12
+ uv run --locked --extra livekit ruff check python tests examples scripts
13
+ uv run --locked --extra livekit ruff format --check python tests examples scripts
14
+ uv run --locked --extra livekit mypy
15
+ cargo fmt --all -- --check
16
+ uv run --locked --extra livekit cargo clippy --workspace --all-targets --locked -- -D warnings
17
+ cargo test -p reed-qr-core --locked
18
+ ```
19
+
20
+ `uv sync` builds an editable installation. Rebuild the extension after Rust changes:
21
+
22
+ ```sh
23
+ uv run --locked --extra livekit maturin develop
24
+ ```
25
+
26
+ The default interpreter is recorded in `.python-version`. Select another with
27
+ `uv sync --locked --extra livekit --python 3.11`, or the desired supported version.
28
+ For core-only tests, omit `--extra livekit`; adapter tests skip when RTC is absent.
29
+ The adapter tests use simulated room/track events and require no credentials or
30
+ media devices. Type checking includes the optional adapter and needs the extra.
31
+
32
+ On macOS or Linux, use a regular installation to test the packaged Python modules:
33
+
34
+ ```sh
35
+ uv sync --locked --extra livekit --no-editable --python 3.14
36
+ .venv/bin/python -m pytest
37
+ .venv/bin/python -m mypy
38
+ cargo test -p reed-qr-core --locked
39
+ ```
40
+
41
+ Replace `3.14` with the supported interpreter being tested. Running the environment's
42
+ Python directly avoids invoking a pytest executable from another installation.
43
+ Keep the non-editable installation for these checks; another `uv sync` without
44
+ `--no-editable` restores the default editable setup.
45
+
46
+ ## Test data
47
+
48
+ Rust tests generate independent QR symbols with `qrcode`; Python tests use Segno.
49
+ Keep payload bytes, text, mode, error correction, and rendering settings explicit.
50
+ Saved fixtures must record their source, generation recipe, expected results, and
51
+ license or permission. Do not commit private payloads or captured participant video.
52
+
53
+ ## Dependencies and notices
54
+
55
+ Commit `Cargo.lock` and `uv.lock` changes with dependency updates. Fetch the resolved
56
+ Rust sources and regenerate the license files:
57
+
58
+ ```sh
59
+ cargo fetch --locked
60
+ uv run --locked --extra livekit python scripts/update_license_inventory.py
61
+ uv run --locked --extra livekit python scripts/update_license_inventory.py --python-inventory
62
+ uv run --locked --extra livekit python scripts/update_license_inventory.py --check
63
+ ```
64
+
65
+ The collector preserves released license texts and copyright notices. Review new
66
+ dependency licenses before refreshing the Python inventory from an installed
67
+ environment. Exact-version evidence for interpreter-specific alternatives is
68
+ retained from prior reviews. The check mode validates the committed package
69
+ versions and scopes without depending on which interpreter is running it.
70
+
71
+ ## Packaging
72
+
73
+ The installed `reed-qr` command and `python -m reed_qr` provide the welcome screen,
74
+ bundled `guide`, installation `doctor` (also `--json`), and `docs` link.
75
+ Only `docs --open` requests a browser. Keep the bundled guide in
76
+ `python/reed_qr/GETTING_STARTED.md` aligned with the README's working examples.
77
+ The CLI tests check that guidance and diagnostics remain available when the
78
+ native extension cannot load. Clean-wheel checks exercise both entry points,
79
+ the bundled guide, and the real codec round trip without the LiveKit extra.
80
+
81
+ On Windows with multiple Python installations or SDKs, put the selected Python
82
+ runtime ahead of unrelated DLL directories before building. CI configures this
83
+ automatically. In PowerShell:
84
+
85
+ ```powershell
86
+ $pythonBase = (uv run --locked --extra livekit python -c "import sys; print(sys.base_prefix)").Trim()
87
+ $env:PATH = "$pythonBase;$pythonBase\DLLs;$env:PATH"
88
+ ```
89
+
90
+ ```sh
91
+ uv run --locked --extra livekit maturin build --sdist --release --locked --compatibility pypi --out dist
92
+ uv run --locked --extra livekit python scripts/check_artifacts.py
93
+ uv run --locked --extra livekit python scripts/verify_wheel.py
94
+ cargo package -p reed-qr-core --locked
95
+ ```
96
+
97
+ Select a wheel explicitly with `scripts/verify_wheel.py --wheel PATH` when needed.
98
+ The verification script tests pip, `uv pip install`, and `uv add` in clean
99
+ environments outside the checkout. It verifies static and asynchronous scanning,
100
+ typing files, and operation without LiveKit installed. Windows checks restrict
101
+ PATH to the selected Python runtime, uv and operating-system directories.
102
+
103
+ The internal `reed-qr-python` crate is not published. Python releases belong on
104
+ PyPI and the reusable core belongs on crates.io. Uploads require separate release
105
+ approval after the platform, artifact, and licensing checks pass.
106
+
107
+ ## Continuous integration
108
+
109
+ The `CI` workflow runs on pushes, pull requests, merge queues, and manual dispatch.
110
+ It checks formatting and dependency notices, then tests Python 3.11–3.15 on Linux
111
+ x86_64, Windows x86_64, macOS Intel, and macOS Apple Silicon. Rust uses the pinned
112
+ toolchain; the license job also installs `rust-docs` to verify standard-library
113
+ notices.
114
+
115
+ macOS 15 runners cover Intel and Apple Silicon compatibility. The `xcode-27`
116
+ runner adds macOS 27 coverage on Apple Silicon. Ubuntu 24.04 and 26.04 cover the
117
+ older and current LTS environments, giving 30 platform/Python
118
+ combinations across the complete matrix.
119
+
120
+ Each platform builds a wheel from the source distribution and runs the full
121
+ Python suite against that installed wheel with the LiveKit extra present. Separate
122
+ clean environments verify the base package through pip, `uv pip install`, and
123
+ `uv add`, without LiveKit. Linux wheels use a manylinux_2_28 container. Python 3.15
124
+ jobs also package, compile, and inspect the reusable Rust crate.
125
+ An additional adapter run checks the minimum supported LiveKit RTC version on
126
+ Linux with Python 3.14, independently of the newer SDK in the development lockfile.
127
+
128
+ Download verified packages and JUnit test reports from the workflow run's
129
+ artifacts; they expire after 14 days. The stable `CI passed` check requires both
130
+ the formatting/license job and the entire platform matrix to succeed. Use it as
131
+ the required status check in repository branch protection. The workflow does not
132
+ publish to PyPI or crates.io and needs no service credentials.