download_tgt_versioned
- download_tgt_versioned(url_fmt, version=None, *, module_key, version_key, api_key=None, force=False, version_transform=None)[source]
Download a file via the UMLS ticket granting system.
- Parameters:
url_fmt (
str
) – The URL format of the file to download where{version}
is used as a placeholder (potentially multiple times), like inhttps://download.nlm.nih.gov/umls/kss/{version}/umls-{version}-mrconso.zip
version (
Optional
[str
]) – The version of the file to downloadmodule_key (
str
) – The key for the pystow submodule of “bio”version_key (
str
) – The key to look up the version viabioversions
if theversion
parameter is not given explicitly.api_key (
Optional
[str
]) – An API key. If not given, is looked up usingpystow.get_config()
with theumls
module andapi_key
key.force (
bool
) – Should the file be re-downloaded?version_transform (
Optional
[Callable
[[str
],str
]]) – A string transformation function, in case the version needs to be reformatted
- Return type:
- Returns:
The local path to the downloaded versioned file
- Raises:
ValueError – if the URL format string doesn’t have a
{version}
substringRuntimeError – if no version is given and none can be looked up