magpie.owsrequest

The OWSRequest is based on pywps code:

Module Contents

Classes

OWSParser

OWSGetParser

Basically a case-insensitive query string parser.

OWSPostParser

MultiFormatParser

Functions

ows_parser_factory(request: pyramid.request.Request) → OWSParser

Retrieve the appropriate OWSParser parser using the Content-Type header.

lxml_strip_ns(tree)

magpie.owsrequest.LOGGER[source]
magpie.owsrequest.ows_parser_factory(request: pyramid.request.Request)OWSParser[source]

Retrieve the appropriate OWSParser parser using the Content-Type header.

If the Content-Type header is missing or text/plain, and the request has a body, try to parse the body as JSON and set the content-type to application/json if successful.

Handle XML-like Content-Type headers such as application/x-www-form-urlencoded whenever applicable.

Otherwise, use the basic OWSGetParser or OWSPostParser according to the presence of a body. These provide minimal parsing to handle most typical OGC Web Services (OWS) request parameters.

class magpie.owsrequest.OWSParser(request)[source]

Bases: object

parse(self, param_list)[source]

Parses the initialized request to populate params retrieved from the parser.

Once this method has been called, all expected parameters are guaranteed to exist within :attr`params`. Missing query parameters from the request will be set to None. All query parameter names will be normalized to lower characters for easier retrieval.

Parameters

param_list – all known query parameters to the service.

abstract _get_param_value(self, param)[source]
class magpie.owsrequest.OWSGetParser(request)[source]

Bases: magpie.owsrequest.OWSParser

Basically a case-insensitive query string parser.

_request_params(self)[source]
_get_param_value(self, param)[source]
magpie.owsrequest.lxml_strip_ns(tree)[source]
class magpie.owsrequest.OWSPostParser(request)[source]

Bases: magpie.owsrequest.OWSParser

_get_param_value(self, param)[source]
class magpie.owsrequest.MultiFormatParser(request)[source]

Bases: magpie.owsrequest.OWSParser

_get_param_value(self, param)[source]