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.zipversion (
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 viabioversionsif theversionparameter is not given explicitly.api_key (
Optional[str]) – An API key. If not given, is looked up usingpystow.get_config()with theumlsmodule andapi_keykey.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