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 to rucio list_dids.

  • client (rucio.client.Client or None, optional) – Client instance to use. If omitted, a new client is created.

  • tree (bool, default False) – 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 tree is 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] or tuple[list[str], dict[str, dict[str, list[str]]]]