medcat.utils.download_scripts
This module is designed to identify and download the medcat-scripts.
It will link the current setup (i.e medcat version) into account and subsequently identify and download the medcat-scripts based on the most recent applicable tag. So if you've got medcat==2.2.0, it might grab medcat/v2.2.3 for instance.
Functions:
-
fetch_scripts–Download the latest compatible medcat-scripts folder into.
-
main–
Attributes:
DOWNLOAD_URL_TEMPLATE
module-attribute
DOWNLOAD_URL_TEMPLATE = f'https://api.github.com/repos/{GITHUB_REPO}/zipball/{tag}'
EXPECTED_TAG_PREFIX
module-attribute
EXPECTED_TAG_PREFIX = 'medcat/v'
GITHUB_REPO
module-attribute
GITHUB_REPO = 'CogStack/cogstack-nlp'
SCRIPTS_PATH
module-attribute
SCRIPTS_PATH = 'medcat-scripts/'
fetch_scripts
fetch_scripts(destination: str | Path = '.', overwrite_url: str | None = None, overwrite_tag: str | None = None) -> Path
Download the latest compatible medcat-scripts folder into.
Parameters:
-
(destinationstr | Path, default:'.') –The destination path. Defaults to ".".
-
(overwrite_urlstr | None, default:None) –The overwrite URL. Defaults to None.
-
(overwrite_tagstr | None, default:None) –The overwrite tag. Defaults to None.
Returns:
-
Path(Path) –The path of the scripts.
Source code in medcat-v2/medcat/utils/download_scripts.py
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | |
main
main(*in_args: str)
Source code in medcat-v2/medcat/utils/download_scripts.py
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | |