adderlib.urlhandlers module

class adderlib.urlhandlers.DebugHandler

Bases: adderlib.urlhandlers.UrlHandler

URL handler for debugging with sample XMLs from the documentation

classmethod api_call(server_address: urllib.parse.ParseResult, args: dict) collections.OrderedDict

Load sample XML return data for the given query

class adderlib.urlhandlers.RequestsHandler

Bases: adderlib.urlhandlers.UrlHandler

Request handler using the requests library

classmethod api_call(server_address: urllib.parse.ParseResult, args: dict) collections.OrderedDict

GET a call to the API

timeout: int = 5
class adderlib.urlhandlers.UrlHandler

Bases: abc.ABC

Abstract URL Handler

abstract classmethod api_call(server_address: urllib.parse.ParseResult, args: dict) dict

Handle a call to the REST API and return a dictionary result Data from the Adder API is returned as an XML document and should be returned as a dictionary _parse_response() is provided as a good-enough method via xmltodict, but can be overloaded if desired