parse()

listparser.parse(obj[, agent, etag, modified])

Parse a subscription list and return a dictionary containing the results.

Parameters:
  • obj (file or string) – a file-like object or a string containing a URL, an absolute or relative filename, or an XML document
  • agent (string) – User-Agent header to be sent when requesting a URL
  • etag (string) – ETag header to be sent when requesting a URL
  • modified (string or datetime) – Last-Modified header to be sent when requesting a URL
Returns:

all of the parsed information, webserver HTTP response headers, and any exception encountered

Return type:

dictionary

parse() is the only public function exposed by listparser.

If obj is a URL, the agent will identify the software making the request, etag will identify the last HTTP ETag header returned by the webserver, and modified will identify the last HTTP Last-Modified header returned by the webserver. agent and etag must be strings, while modified can be either a string or a Python datetime object.

If agent is not provided, the USER_AGENT global variable will be used by default.