Scale an ingredient list
scale_ingredientsRescale French ingredient lists to a different serving count via factor or from/to servings. Rounds grams, millilitres, and countable items to readable numbers, leaving approximate lines as-is.
Instructions
Rescale a list of ingredient lines to a different number of servings, without contacting any website. Give either 'factor' directly, or 'from_servings' and 'to_servings' and the factor is computed. Works on any French ingredient list, whatever its source, so it also serves a recipe the user pasted in. Quantities in grams or millilitres are multiplied and rounded to readable values; countable things such as eggs or spoons are rounded to whole or half units; lines with no quantity, or with an approximate one such as a pinch, are returned untouched and flagged. Prefer this over doing the arithmetic yourself.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| factor | No | Multiplier to apply. Use this or the from/to pair. | |
| ingredients | Yes | Ingredient lines, for example ['200 g de farine', '3 oeufs', 'sel']. | |
| to_servings | No | How many servings are wanted. | |
| from_servings | No | How many servings the list is written for. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notes | Yes | ||
| factor | Yes | ||
| ingredients | Yes | ||
| scaled_count | Yes | ||
| rounded_count | Yes | ||
| unscaled_count | Yes |