This repository is a framework prototype for migrating Open Food Facts data quality checks from Perl to Python with parity validation against the legacy backend.
Note
This prototype is under active development. Architecture, module boundaries, and public interfaces may change while the repository is consolidated. Check back over time if you are interested in following its progress.
For an overview of the project, watch the demo video.
You can use the repository in these ways:
- Use the shared runtime in
src/off_data_quality/to run checks directly from Python. See About the runtime model. - Use the migration tooling in
migration/for complete runs. It loads a full product source snapshot and resolves reference when the run needs it. It also handles strict comparison, stored review data, and report artifacts. - Use the Google Sheets demo in
apps/google_sheets/when you want a browser flow that writes findings back to Google Sheets. See Run the Google Sheets demo.
Use the migration demo image to inspect the full migration flow without cloning the repository.
-
Run the published image:
docker run --rm -p 8000:8000 ghcr.io/bobcorn/migration-demo
-
Open the report at
http://localhost:8000.
The container loads the bundled sample snapshot, runs the shipped checks,
writes the report artifacts, and serves the generated site on port 8000.
Use this procedure when you work in the repository.
-
Clone the repository and enter the working tree:
git clone https://github.com/bobcorn/openfoodfacts-data-quality.git cd openfoodfacts-data-quality -
Create
.envfrom the tracked sample file:cp .env.example .env
-
Build and start the migration tooling:
docker compose up --build
-
Open the report at
http://localhost:8000, unless you changedMIGRATION_PORTin.env.
For local run details, see Run the project locally.
Use a local .venv for tests, linting, typing, and repository utilities.
-
Create the virtual environment:
python3.14 -m venv .venv
-
Install the repository with app and dev dependencies:
.venv/bin/python -m pip install -e ".[app,dev]" -
Run local commands from that environment:
.venv/bin/pytest -q tests/test_some_area.py make quality
Use Docker for migration runs that need reference results and for local preview.
The public Python API exposes one concrete namespace:
off_data_quality.checks
from off_data_quality import checks
findings = checks.run(
rows,
check_ids=["en:serving-quantity-over-product-quantity"],
)See Use the Python library for installation and usage details.
Read the full documentation.