CLI¶
The package recipemd
provides two CLI applications:
recipemd performs actions with a single recipe in RecipeMD format.
recipemd-find performs actions on a folder of RecipeMD recipes.
Usage Examples¶
Display and validate a recipe:
recipemd <path/to/recipe.md>
Get recipe title:
recipemd <path/to/recipe.md> -t
Get recipe ingredients, e.g. to pipe to shoppinglist-cli:
recipemd <path/to/recipe.md> -i
Multiply recipe by a factor:
recipemd <path/to/recipe.md> -m 5.5
Scale recipe for a given yield (e.g. number of servings, volume, mass, amount):
recipemd <path/to/recipe.md> -y "10 servings"
Get all tags of all recipes in the current folder:
recipemd-find tags
Get recipes by tag:
recipemd-find -e "tag:cheese or tag:summer" recipes
Command reference¶
recipemd¶
Read and process recipemd recipes
usage: recipemd [-h] [-v] [-t | -i | -j] [-r n] [-m N | -y Y]
[-f | --export-links [DIR]]
file
- file¶
A recipemd file
- -h, --help¶
show this help message and exit
- -v, --version¶
show program’s version number and exit
- -t, --title¶
Display recipe title
- -i, --ingredients¶
Display recipe ingredients
- -j, --json¶
Display recipe as JSON
- -r <n>, --round <n>¶
Round amount to n digits after decimal point. Default is “2”, use “no” to disable rounding.
- -m <n>, --multiply <n>¶
Multiply recipe by N
- -y <y>, --yield <y>¶
Scale the recipe for yield Y, e.g. “5 servings”
- -f, --flatten¶
Flatten ingredients and instructions of linked recipes into main recipe
- --export-links <dir>¶
Export flattened linked recipes as required for the main recipe to DIR (DIR defaults to recipe file name)
recipemd-find¶
Find recipes, ingredients and units by filter expression
usage: recipemd-find [-h] [-v] [-e EXPRESSION] [-s] [-1 | -C | -x] action ...
- -h, --help¶
show this help message and exit
- -v, --version¶
show program’s version number and exit
- -e <expression>, --expression <expression>¶
Filter expression. Expects a boolean string, e.g. “cake and vegan or ingr:cheese”
- -s, --no-messages¶
suppress error messages
- -1¶
Force output to be one entry per line. This is the default when output is not to a terminal.
- -C¶
Force multi-column output; this is the default when output is to a terminal.
- -x¶
The same as -C, except that the multi-column output is produced with entries sorted across, rather than down, the columns.
recipemd-find ingredients¶
usage: recipemd-find ingredients [-h] [-c] [folder]
- -h, --help¶
show this help message and exit
- -c, --count¶
count number of uses per ingredient
recipemd-find recipes¶
usage: recipemd-find recipes [-h] [folder]
- -h, --help¶
show this help message and exit
recipemd-find units¶
usage: recipemd-find units [-h] [-c] [folder]
- -h, --help¶
show this help message and exit
- -c, --count¶
count number of uses per unit