Skip to main content

classy.scripts.model.download

Functions

assert_file_exists

def assert_file_exists(
    path: pathlib.Path,
    md5=None,
)

download

def download(
    model_name: str,
    force_download: bool = False,
)

download_resource

def download_resource(
    resource_url: str,
    output_path: pathlib.Path,
) ‑> int

Download a resource from a specific url into an output_path

main

def main()

parse_args

def parse_args() ‑> argparse.Namespace

request_file

def request_file(
    url,
    path,
)

A complete wrapper over download_file() that also make sure the directory ofpath exists, and that a file matching the md5 value does not exist.

unzip

def unzip(
    zip_path: pathlib.Path,
    target: pathlib.Path,
)