class documentation

class UserAgent(_UserAgent):

View In Hierarchy

Represents a parsed user agent header value.

This uses a basic parser to try to extract some information from the header.

Deprecated since version 2.0: Will be removed in Werkzeug 2.1. Subclass werkzeug.user_agent.UserAgent (note the new module name) to use a dedicated parser instead.
Changed in version 2.0: Passing a WSGI environ is deprecated and will be removed in 2.1.
Parameters
environ​_or​_stringThe header value to parse, or a WSGI environ containing the header.
Method __init__ Undocumented

Inherited from _UserAgent:

Property browser The browser name, if it could be parsed from the string.
Property language The browser language, if it could be parsed from the string.
Property platform The OS name, if it could be parsed from the string.
Property version The browser version, if it could be parsed from the string.
Class Variable ​_parser Undocumented
Instance Variable ​_browser Undocumented
Instance Variable ​_language Undocumented
Instance Variable ​_platform Undocumented
Instance Variable ​_version Undocumented

Inherited from UserAgent (via _UserAgent):

Method __bool__ Undocumented
Method __repr__ Undocumented
Method __str__ Undocumented
Method to​_header Convert to a header value.
Instance Variable string The original header value.
def __init__(self, environ_or_string):

Undocumented

Parameters
environ​_or​_string:t.Union[str, WSGIEnvironment]Undocumented