pyslk.gen_file_query#
- pyslk.gen_file_query(resources: str | list[str] | set[str] | Path | list[pathlib.Path] | set[pathlib.Path], recursive: bool = False, cached_only: bool = False, not_cached: bool = False, tape_barcodes: list[str] | str | None = None) str #
Generates a search query that searches for the listed resources
A search query will be generated which connects all elements of ‘resources’ with and ‘or’. A ‘resource’ (an element of ‘resources’) might be one of these:
a filename with full path (e.g. /arch/bm0146/k204221/INDEX.txt)
a filename without full path (e.g. INDEX.txt)
a regex describing a filename (e.g. /arch/bm0146/k204221/.*.txt)
a namespace (e.g. /arch/bm0146/k204221 or /arch/bm0146/k204221/)
Details are given in the slk_helpers documentation at https://docs.dkrz.de
- Parameters:
resources (
str
orlist
orset
orPath
) – list of resources to be searched forrecursive (
bool
) – do recursive search in the namespacescached_only (
bool
) – do recursive search in the namespacesnot_cached (
bool
) – do recursive search in the namespacestape_barcodes (
list[str]
) – do recursive search in the namespaces
- Returns:
generated search query
- Return type:
str