datalad_container.utils
Collection of common utilities
- datalad_container.utils.get_container_configuration(ds: Dataset, name: str | None = None) dict [source]
Report all container-related configuration in a dataset
Such configuration is identified by the item name pattern:
datalad.containers.<container-name>.<item-name>
- Parameters:
ds (Dataset) -- Dataset instance to report configuration on.
name (str, optional) -- If given, the reported configuration will be limited to the container with this exact name. In this case, only a single
dict
is returned, not nested dictionaries.
- Returns:
Keys are the names of configured containers and values are dictionaries with their respective configuration items (with the
datalad.containers.<container-name>.
prefix removed from their keys). If name is given, only a singledict
with the configuration items of the matching container is returned (i.e., there will be no outerdict
with container names as keys). If not (matching) container configuration exists, and empty dictionary is returned.- Return type: