ButlerRepoIndex¶
- class lsst.daf.butler.ButlerRepoIndex¶
Bases:
objectIndex of all known butler repositories.
The index of butler repositories is found by looking for a configuration file at the URI pointed at by the environment variable
$DAF_BUTLER_REPOSITORY_INDEX. The configuration file is a simple dictionary lookup of the form:label1: uri1 label2: uri2
and can be in YAML or JSON format. The content of the file will be cached.
Attributes Summary
The name of the environment variable to read to locate the index.
Methods Summary
Retrieve the list of known repository labels.
get_repo_uri(label[, return_label])Look up the label in a butler repository index.
Attributes Documentation
- index_env_var: ClassVar[str] = 'DAF_BUTLER_REPOSITORY_INDEX'¶
The name of the environment variable to read to locate the index.
Methods Documentation
- classmethod get_repo_uri(label: str, return_label: bool = False) ResourcePath¶
Look up the label in a butler repository index.
- Parameters:
- label
str Label of the Butler repository to look up.
- return_label
bool, optional If
labelcannot be found in the repository index (either because index is not defined orlabelis not in the index) andreturn_labelisTruethen returnResourcePath(label). Ifreturn_labelisFalse(default) then an exception will be raised instead.
- label
- Returns:
- uri
lsst.resources.ResourcePath URI to the Butler repository associated with the given label or default value if it is provided.
- uri
- Raises:
- KeyError
Raised if the label is not found in the index, or if an index is not defined, and
return_labelisFalse.- FileNotFoundError
Raised if an index is defined in the environment but it can not be found.