Pipeline

From a purchase order to an impact estimate

Every procurement file goes through the same three stages, followed by a report on the shares of purchases. The Notebook handles the transitions between them automatically, writing an intermediate file at each step so you can inspect, if necessary correct, and re-run without starting over.

STAGE 1

Identify ingredients and their weights

Each product line, e.g., "SOUP, CHICKEN NOODLE RTU LOW SODIUM," 21.8 lbs — is broken into its likely constituent ingredients (chicken broth, chicken, noodles, vegetables), each with an estimated share of the product's total weight. Where a line gives a count or case rather than a weight, the weight is estimated. Each product is also judged plant-based or not (made mostly from plants or fungi with no animal-derived ingredient, at any level of processing).

Reads: your procurement .csv or .xlsxitem_weights.json  →  Writes: ingredients_{file}.csv

STAGE 2

Sort each ingredient into a shared category

Every ingredient is assigned to one of more than 120 categories — beef, dairy cheese, tilapia (farmed), wheat/rye, unidentified meat, and so on. The code first checks foodcategories.json which pairs ingredients with categories; if an ingredient isn't already listed there, it asks the AI model for a category and records the new pairing for you to review later for possible inclusion in the foodcategories.json file.

Canned and cooked beans, rice and pasta are then split into their dry equivalent and water, because the conversion factors for those categories are per kilogram as bought dry. Broth and stock are split the same way: only a small share counts as meat, seafood or vegetables, the rest as water. In soup bases, the meat and stock count as at most a quarter of the base.

Reads: ingredients_{file}.csvfoodcategories.json  →  Writes: categories_{file}.csv

STAGE 3

Apply conversion factors to calculate impact

The total weight in each category is multiplied against a table of per-kilogram factors — calories, CO₂e, carbon opportunity cost, direct and total animal lives, blue and green water consumption, land use, and eutrophication — to produce the final totals, in metric and U.S. units. For fish, beef and pork the edible share of the cut (bone-in, whole fish, fillet) is taken into account.

Reads: categories_{file}.csvfactors.csv  →  Writes: impacts_lbs_{file}.csvimpacts_metric_{file}.csv

THEN

Report the shares of purchases

Shares of total weight and calories: plant-based (with and without cooking oils), animal-derived, and, where the worksheet marks them, certified, local or plant-based products. Also the impacts per 1,000 kcal purchased, and lists of products worth a second look.

Reads: categories_{file}.csvimpacts files  →  Writes: shares_report_{file}.txtshares_{file}.csvproduct_shares_{file}.csv


Worked example

One row, followed all the way through

Consider one row of a 1,777-row procurement file that lists 21.8 pounds of "SOUP, CHICKEN NOODLE RTU LOW SODIUM." Stages 1 and 2 may resolve it like this:

Row 1621 · ingredient breakdown
IngredientCategoryShareWeight
chicken broth (chicken equivalent)chicken2.2%0.48 lbs
water (in chicken broth)water70.5%15.38 lbs
chickenchicken8.1%1.76 lbs
noodles (dry equivalent)wheat/rye7.8%1.69 lbs
water (in noodles)water6.4%1.39 lbs
carrotsother vegetables3.0%0.66 lbs

Two rules adjust for how the food was bought. The chicken broth (72.7% of the soup) is nearly all water, so 3% of it is counted as chicken. The cooked noodles (14.1% of the soup) count 55% of their weight as dry pasta. In both cases the rest is counted as water.

Once all the multi-ingredient items in the file have gone through the same process, Stage 3 sums each category's weight across the entire procurement file and reports totals like these (an excerpt):

Impacts_lbs output · excerpt
CategoryWeightCO₂eTotal animal lives
chicken135,490 lbs596,156 lbs54,566 lives
beef39,982 lbs1,653,110 lbs71.5 lives
butter6,749 lbs75,212 lbs0.6 lives
apples8,394 lbs3,005 lbs0 lives

Robustness check

It holds up across languages

As an experiment, the project's authors translated all 1,500+ products in a US Foods procurement file into French, Spanish, and German, then ran the unaltered Notebook against the translated list. Total impact figures differed by less than 2% per category compared to the English run.

Ready to run it on your own file?

The Get started page covers both the local Notebook route and the hosted web tool. Most vendor reports can be used as they come.

Get started →