negotiator 1.0.0

Proper Content Negotiation for Python
The Negotiator is a library for decision making over Content Negotiation requests.
It takes the standard HTTP Accept headers (Accept, Accept-Language, Accept-Charset,
Accept-Encoding) and rationalises them against the parameters acceptable by the
server; it then makes a recommendation as to the appropriate response format.
This version of the Negotiator also supports the SWORDv2 extensions to HTTP Accept
in the form of Accept-Packaging.

Specify the default parameters. These are the parameters which will be used in place of any HTTP Accept headers which are not present in the negotiation request. For example, if the Accept-Language header is not passed to the negotiator it will assume that the client request is for "en"

Specify the default parameters. These are the parameters which will be used in place of any HTTP Accept headers which are not present in the negotiation request. For example, if the Accept-Language header is not passed to the negotiator it will assume that the client request is for "en"

specify the weighting that the negotiator should apply to the different Accept headers. A higher weighting towards content type will prefer content type variations over language variations (e.g. if there are two formats which are equally acceptable to the client, in different languages, a content_type weight higher than a language weight will return the parameters according to the server's preferred content type.

>>> weights = {"content_type" : 1.0, "language" : 0.5}

Create an instance of the negotiator, ready to accept negotiation requests

>>> cn = ContentNegotiator(default_params, acceptable, weights)

set up some more complex accept headers (you can try modifying the order of the elements without q values, and the q values themselves, to see different results).