find_url
- gwdatafind.find_url(framefile, urltype='file', on_missing='error', host=None, session=None, **request_kw)
Query a GWDataFind host for the URL of a single filename.
- Parameters
framefile (
str
) – the name of the file to match; note that only the basename of the file is relevant.urltype (
str
, optional) – URL scheme to search foron_missing (
str
, optional) –what to do when the requested file isn’t found, one of:
'error'
: raise aRuntimeError
'warn'
: print a warning but return an emptylist
'ignore'
: return an emptylist
with no warnings
host (
str
, optional) – the URL/name of the GWDataFind host to query; if not givenget_default_host()
will be used to discover the default host.session (
requests.Session
, optional) – the connection session to use; if not given, aigwn_auth_utils.requests.Session
will be created on-the-fly**request_kw – other keywords are passed to
igwn_auth_utils.requests.get()
- Returns
urls (
list
ofstr
) – a list of URLs for all instances offilename
- Raises
requests.RequestsException – if the request fails for any reason
RuntimeError – if no matching URLs are found and
on_missing="error"
was given