pycaravel: This module is designed to simplify continuous integration (CI) of data from multiple projects.
Note
This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the gallery for the big picture.
- caravel.parser.build_path(keys, path_patterns, strict=False)[source]ΒΆ
Constructs a path given a set of keys and a list of potential filename patterns to use.
- Parameters:
keys : dict
A dictionary mapping key names to key values. None key or empty-string key will be removed. Otherwise, kets will be cast to string values, therefore if any format is expected (e.g., zero-padded integers), the value should be formatted.
path_patterns : str or list of str
One or more filename patterns to write the file to. Keys should be represented by the name surrounded by curly braces. Optional portions of the patterns should be denoted by square brackets. Keys that require a specific value for the pattern to match can pass them inside angle brackets.
strict : bool
If True, all passed keys must be matched inside a pattern in order to be a valid match. If False, extra keys will be ignored so long as all mandatory keys are found.
- Returns:
path : str
A constructed path for this file based on the provided patterns, or None if no path was built given the combination of keys and patterns.
Follow us