skillsnetwork.download#

async skillsnetwork.download(url, path=None, verbose=True, chunk_size=8192)[source]#

Downloads file located at URL to path.

>>> import skillsnetwork
>>> path = "./my_file.txt"
>>> await skillsnetwork.download("https://example.com/myfile", path)
Saved as './my_file.txt'
>>> with open(path, "r") as f:
>>>     content = f.read()
Parameters
  • url (str) – The URL where the file is located.

  • path (Optional[str]) – The path to which the file at URL should be downloaded. Auto-generated from url by default.

  • chunk_size (int) – The number of bytes to read from url at a time.

Raises
Return type

None