Package grizzled :: Package net
[frames] | no frames]

Package net

Network-related methods and classes.
Submodules

Functions
tuple
download(url, directory=None, bufsize=8192)
Download the specified URL to a directory.
Function Details

download(url, directory=None, bufsize=8192)

 

Download the specified URL to a directory. This module properly handles HTTP authentication for URLs like this one:

https://user:password@localhost:8080/foo/bar/baz.tgz

Note, however, that user/password authentication is only supported for "http" and "https" URLs.

Parameters:
  • url (str) - the URL to download
  • directory (str) - The directory to receive the downloaded file. If this parameter is omitted, download() will create a temporary directory to contain the file.
  • bufsize (int) - buffer size to use when reading URL
Returns: tuple
A (download_directory, downloaded_file) tuple