API Documentation


Set up a request method user_agent_parsed returning an instance of UserAgent initialized with the client User-Agent.

UserAgent Class

class pyramid_useragent.UserAgent(string=None)

Extract User-Agent components from a string.


The parsing operation is safe: mal-formed User-Agent components are ignored.

components = None

List of UserAgentComponent (order is kept by using an OrderedDict)


Most significant UserAgentComponent

string = None

Original User-Agent string

UserAgentComponent Class

class pyramid_useragent.UserAgentComponent(name=None, version=None, comments=None)

Simple object representing a single User-Agent component

comments = None

Comment part of a User-Agent component as a list

name = None

Name part of a User-Agent component

version = None

Version part of a User-Agent component