textflint.common.utils.install

textflint.common.utils.install.unzip_file(path_to_zip_file, unzipped_folder_path)[source]

Unzips a .zip file to folder path.

textflint.common.utils.install.set_cache_dir(cache_dir)[source]

Sets all relevant cache directories to TR_CACHE_DIR.

textflint.common.utils.install.download_if_needed(folder_name)[source]

Folder name will be saved as .cache/textflint/[folder_name]. If it doesn’t exist on disk, the zip file will be downloaded and extracted.

Parameters

folder_name (str) – path to folder or file in cache

Returns

path to the downloaded folder or file on disk

textflint.common.utils.install.http_get(folder_name, out_file, proxies=None)[source]

Get contents of a URL and save to a file.

https://github.com/huggingface/transformers/blob/master/src /transformers/file_utils.py