fastdev.io.download

Module Contents

fastdev.io.download.download_url(url: str, local_path: str, verify: bool = True, force_redownload: bool = False) str[source]

Download url to local path.

Parameters:
  • url (str) – URL to download.

  • local_path (str) – Local path to save the downloaded file. If the local path is a directory, the file will be saved to the directory with the same name as the URL basename.

  • verify (bool, optional) – Verify SSL certificate. Defaults to True.

  • force_redownload (bool, optional) – Whether to force redownload the file even if it exists. Defaults to False.

Returns:

Local path of the downloaded file.

Return type:

str

fastdev.io.download.cached_local_path(url: str, rel_cache_path: str | None = None, cache_root: str = FDEV_CACHE_ROOT) str[source]

Get the cached local path of the URL.

Parameters:
  • url (str) – Remote URL.

  • rel_cache_path (str, optional) – Relative local path in the cache root. Use the URL relative path if None. Defaults to None.

  • cache_root (str, optional) – Cache root. Defaults to FDEV_CACHE_ROOT.

Return type:

str