Back to Gym

Back to Gym: packaged foods

Packaged foods sold in India, the United States and the United Kingdom, with their label's values per 100 g, as the Back to Gym iPhone app's barcode scanner looks them up. Made from Open Food Facts by build_packaged_foods.py in this folder. Offered at backtogym.app/data; questions to support@backtogym.app.

Contains data from Open Food Facts, available under the Open Database License (ODbL) 1.0. © Open Food Facts contributors. Individual product values are under the Database Contents License (DbCL) 1.0.

These files are a Derivative Database of Open Food Facts and are offered under the same licence (LICENSE.md). The app's other food lists (dishes, basics and drinks built from USDA FoodData Central and UK CoFID values) are separate databases, not made from Open Food Facts, and aren't here.

Download

The files

FileCountryProductsExport
packaged-in.jsonIndia9,4432026-11-05
packaged-us.jsonUnited States95,3572026-11-05
packaged-gb.jsonUnited Kingdom69,3122026-11-05

Each has a build report (packaged-<code>-report.md) with the counts and why the rest were left out.

Keys in each product: b barcode without leading zeros, n name, br brand, q pack size as printed, pk pack grams, s serving grams, k kcal, p protein, c carbohydrate, f fat, fi fibre and a alcohol per 100 g, d the pack's mark (vg vegan, v vegetarian, nv non-vegetarian).

What's kept

From Open Food Facts' CSV export, products sold in the country with:

Where a barcode is there twice, the edit made last is kept. Values are as contributors typed them from the label, rounded to 0.1 g; US and Indian labels count fibre in carbohydrate, UK labels don't. They are estimates, and can be wrong or out of date.

Rebuilding

Open Food Facts publishes a new export every night, so a rebuild gives different files: new products, corrections, removals.

curl -sLO https://static.openfoodfacts.org/data/en.openfoodfacts.org.products.csv.gz   # about 1.5 GB
python3 -I build_packaged_foods.py --export en.openfoodfacts.org.products.csv.gz      # all three countries, one pass
python3 -I build_packaged_foods.py --check                                            # checks the files are well formed

Plain Python 3.11 or later; nothing to install.