Scale an ingredient list, in any language it reads
scale_ingredientsScales recipe ingredient lists by a factor or from one serving count to another, reading French, English, and Spanish lines and rounding quantities to kitchen-usable amounts.
Instructions
Multiply a list of ingredient lines, in French, in English, in Spanish, or in a list holding more than one of them. Give either 'factor', or 'from_servings' and 'to_servings' and the factor is worked out from them. Quantities land where a kitchen can follow them: an egg stays whole because half of one is not something a cook takes out of the shell, while anything that pours, weighs or cuts can halve, a spoonful shrinks into the smaller spoon before it is rounded, and a pinch keeps whatever size a hand gives it while its count is multiplied. Every line comes back with 'scaling': 'scaled' when the arithmetic landed on the exact product, 'rounded' when something had to move for the line to stay usable, 'unscaled' when the line carries nothing to multiply. A rounded line says what it was rounded from and in which direction. No quantity is converted between measuring systems: grams stay grams and cups stay cups, because a conversion changes what the recipe said.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| factor | No | What to multiply by. Give exactly one of: 'factor', or both 'from_servings' and 'to_servings'. | |
| language | No | 'auto' reads each line on its own, which is what a list holding more than one language needs. Name a language to read every line that way. | auto |
| ingredients | Yes | The lines as written, one ingredient each, such as '200 g de farine' or '3 eggs'. | |
| to_servings | No | What it should serve. Give it with 'from_servings', and without 'factor'. | |
| from_servings | No | What the list serves now. Give it with 'to_servings', and without 'factor'. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notes | Yes | ||
| factor | Yes | What every quantity was multiplied by. | |
| language | Yes | How the lines were read. | |
| ingredients | Yes | ||
| scaled_count | Yes | Lines whose arithmetic came out exact. | |
| rounded_count | Yes | Lines whose value moved to stay usable. | |
| unscaled_count | Yes | Lines carrying nothing that can be multiplied, tools excepted. | |
| equipment_count | Yes | Lines naming a tool, which are never multiplied: a recipe made for more people uses the same pan. |