Skip to content

Configuration

Configuration functions, and settings objects.

get_config(target_paths, config_filename)

Find configuration file from CLI target paths.

Source code in databooks/config.py
def get_config(target_paths: List[Path], config_filename: str) -> Optional[Path]:
    """Find configuration file from CLI target paths."""
    common_path = find_common_parent(paths=target_paths)
    repo = get_repo(common_path)
    repo_dir = getattr(repo, "working_dir", None)

    return find_obj(
        obj_name=config_filename,
        start=Path(repo_dir) if repo_dir is not None else Path(common_path.anchor),
        finish=common_path,
    )