query_dataset#
- coffea.dataset_tools.rucio_utils.query_dataset(query: str, client=None, tree: bool = False, datatype='container', scope='cms')[source]#
This function uses the rucio client to query for containers or datasets.
- Parameters:
query (
str) – Pattern passed toruciolist_dids.client (
rucio.client.ClientorNone, optional) – Client instance to use. If omitted, a new client is created.tree (
bool, defaultFalse) – If True, return a mapping grouped by dataset components alongside the list.datatype (
str, default"container") – Rucio type to query:"container"(CMS dataset) or"dataset"(CMS block).scope (
str, default"cms") – Rucio scope to operate in.
- Returns:
When
treeis False, returns the matched dataset names. Otherwise returns a tuple of the flat list and a nested dictionary grouping the names by their components.- Return type:
list[str]ortuple[list[str],dict[str,dict[str,list[str]]]]