Built-in Recipes¶
Some tasks are common enough that alkymi has them included as part of its built-in recipes. A common trend for these
built-in recipes is that they are implemented as functions that create and bind functions to Recipe
instances (and
in some cases, custom cleanliness functions - see Custom Cleanliness Functions). The current built-in recipes are:
glob_files
: Finds and returns files in a directory as pathlib.Path instances (potentially recursively). If the result of globbing changes (e.g. a new file is added to the directory), the recipe will be marked dirty.file
: Short-hand for returning a single file as a pathlib.Path instance.zip_results
: Zips the outputs from a number of recipes into elements, similar to Python’s built-in zip() function. Notably, dictionaries are handled a bit differently, in that a dictionary is returned with keys mapping to tuples consisting of items from each of the different inputs.arg
: Creates a recipe that outputs a value. The recipe has a specialset()
function that allows the user to later change the argument, potentially resulting in a need for re-evaluation. TheArg
type can also be used to accept user input using alkymi’s Lab functionality (see Command Line Interface). An optional doc argument can be passed to provide a documentation string for the argument - this will automatically be used by alkymi’s Lab type to create a more detailed CLI.
Note
All built-in recipes are described in detail in the Built-in Recipes API reference