Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: ci

on:
push:
pull_request:

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev,image,pdf]"

- name: Run tests
run: |
pytest -q

quality:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev,image,pdf]"

- name: Lint
run: |
ruff check .

- name: Type check
run: |
mypy --strict aztec_py

build:
runs-on: ubuntu-latest
needs: quality
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Build package
run: |
python -m pip install build
python -m build
89 changes: 89 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# IPython Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Changelog

## [1.0.0] - 2026-04-05

### Fixed
- CRLF encoding coverage and regressions aligned with upstream issue #5.
- Error-correction capacity sizing bug fixed for worst-case stuffing payloads (upstream issue #7).

### Added
- Package split into `aztec_py` with modern `pyproject.toml` packaging.
- SVG output support based on upstream PR #6 by Zazzik1.
- CLI entry point (`aztec`) and `python -m aztec_py` runner.
- PDF output (`AztecCode.pdf()` and extension-aware `save()` behavior).
- `AztecRune` support for 0..255 values.
- Optional decode helper (`aztec_py.decode`) backed by `python-zxing`.
- Property-based tests with Hypothesis.
- Input validation for public API boundaries.

### Changed
- Project metadata updated for fork lineage visibility.
- Added explicit attribution artifacts: `LICENSE.upstream` and `CONTRIBUTORS.md`.
28 changes: 28 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Contributors & Lineage

## Authors
- Originally written by Dmitry Alimov (delimitry).
- Updates, bug fixes, and active maintenance in this fork by greyllmmoder.

## Current maintainer
- greyllmmoder - https://github.com/greyllmmoder

## Upstream lineage (MIT license chain)
This project is a fork of **dlenski/aztec_code_generator**
(https://github.com/dlenski/aztec_code_generator), which is itself
a fork of **delimitry/aztec_code_generator**
(https://github.com/delimitry/aztec_code_generator).

Both upstream projects are MIT licensed. The original upstream license
text is preserved in `LICENSE.upstream`.

## What changed from upstream
- Fixed: CRLF encoding crash (upstream issue #5)
- Fixed: Error correction capacity calculation (upstream issue #7)
- Added: SVG renderer (based on upstream PR #6)
- Added: Type hints, docstrings, CLI, PDF output, Rune mode
- Restructured: Single-file module split into package

## Third-party contributions incorporated
- SVG support: originally authored by Zazzik1
(https://github.com/dlenski/aztec_code_generator/pull/6), MIT license
21 changes: 21 additions & 0 deletions LICENSE.upstream
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2016 Dmitry Alimov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
5 changes: 5 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include README.md
include requirements.txt
include LICENSE
include LICENSE.upstream
include CONTRIBUTORS.md
46 changes: 46 additions & 0 deletions PRODUCTION_CHECKLIST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Production Checklist

Use this checklist before shipping a new `aztec-py` version to production.

## 1. Pre-Release Validation

- [ ] `python -m pytest -q`
- [ ] `python -m ruff check .`
- [ ] `python -m mypy --strict aztec_py`
- [ ] `python -m build`
- [ ] `python scripts/decoder_matrix.py --report compat_matrix_report.md`
- [ ] If decode runtime is available in CI: `python scripts/decoder_matrix.py --strict-decode`

## 2. Runtime Optional Dependencies

- [ ] Verify `aztec-py[pdf]` installs and `AztecCode(...).pdf()` works.
- [ ] Verify `aztec-py[decode]` behavior:
- [ ] successful decode path when Java + ZXing are available
- [ ] clear error path when runtime/dependency is missing

## 3. GS1 Integration Readiness

- [ ] Build GS1 payloads using `GS1Element` + `build_gs1_payload`.
- [ ] Ensure variable-length elements are marked with `variable_length=True`.
- [ ] Confirm payloads with scanner app/hardware in target environment.

## 4. Release Hygiene

- [ ] Update `CHANGELOG.md`.
- [ ] Confirm `README.md` examples still execute.
- [ ] Verify version metadata in `pyproject.toml`.
- [ ] Build artifacts from clean working tree.

## 5. Post-Release Smoke Checks

- [ ] Install built wheel in fresh venv.
- [ ] `python -c "import aztec_py; print(aztec_py.__all__)"`
- [ ] `aztec "Hello" --format terminal`
- [ ] `aztec "Hello" --format svg > smoke.svg`
- [ ] `aztec "Hello" --format png --output smoke.png`

## 6. Incident Guardrails

- [ ] Keep compatibility fixture failures as release blockers.
- [ ] Log scanner model/runtime for each production decode issue.
- [ ] Add a regression fixture for every production bug before patching.
Loading
Loading