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

Package net

source code

Network-related methods and classes.
Submodules [hide private]

Functions [hide private]
tuple
download(url, directory=None, bufsize=8192)
Download the specified URL to a directory.
source code
Variables [hide private]
  log = logging.getLogger('grizzled.net')
  __package__ = None
hash(x)
Function Details [hide private]

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

source code 

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