Home | Trees | Indices | Help |
---|
|
object --+ | Config
DeviceApi Configurations. To change the default configs of the DeviceAtlas DeviceApi create an instance of this class, set your preferred configs and pass the instance to the constructor of a DeviceApi.
Note that you may change the configs even after the Config instance has been passed to the DeviceApi.
Copyright: Copyright (c) DeviceAtlas Limited 2021. All Rights Reserved.
Author: DeviceAtlas Limited
Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
bool |
|
||
Inherited from |
Properties | |
cookie_name Get the cookie name that the client side properties would be set to. |
|
include_ua_props Get if the User-Agent dynamic properties are being included in the property set or not. |
|
include_lang_props Get if the language/locale properties should be included in the property set or not. |
|
include_match_info To get if get_properties(HEADERS) include the matched and unmatched parts of the User-Agent to the property set. |
|
return_none_when_no_properties Get if the value returned by get_properties(HEADERS) should be None when there are no properties found or an instance of Properties that has no Property inside it should be returned. |
|
max_cache_entries Get the max number of results to be cached. |
|
Inherited from |
Method Details |
Get the cookie name that the client side properties would be set to. When using get_properties(HEADERS), the detection would automatically use the contents of this cookie if it exists. If you want the client side properties to be used add the DeviceAtlas Client-side component (JS lib) to your web-site pages. When the User-Agent or HTTP headers are set manually to get_properties() the client side properties (probably the value set to the cookie) can be manually passed to this methods as the second argument, note that this config is only used for get_properties(HEADERS). |
To change the cookie name that the client side properties would be set to. When using get_properties(HEADERS), the detection would automatically use the contents of this cookie if it exists. If you want the client side properties to be used add the DeviceAtlas Client-side component (JS lib) to your web-site pages. When the User-Agent or HTTP headers are set manually to get_properties() the client side properties (probably the value set to the cookie) can be manually passed to this method as the second argument, note that this config is only used for get_properties(HEADERS). If you set the cookie-name to None then the client side properties cookie will be ignored.
|
To disable or enable get_properties(HEADERS) including User-Agent dynamic properties. Some properties cannot be known before runtime and can change from User-Agent to User-Agent. The most common of these are the OS Version and the Browser Version. The DeviceApi is able to dynamically detect these changing properties with a small overhead. If you do not use these properties you can set this config to False to make the detection marginally faster.
|
To disable or enable get_properties(HEADERS) including language and locale properties. To check the Accept-Language header and include properties to the property set for getting the client's language and locale preferences set to True. If you do not use these properties you can set this config to False to make the detection marginally faster.
|
To disable or enable get_properties(HEADERS) including the matched and unmatched parts of the User-Agent to the property set.
|
Set if the value returned by get_properties(HEADERS) should be None when there are no properties found or whether an empty Properties object should be returned instead.
|
Set the max number of results to be cached. Depending on the frequency and distance factor of your User-Agents or headers passed to the API for detection, increasing the result cache may increase performance by preventing repeated lookups. For a large set of inputs (i.e. an almost unique set of user-agents) set to lower numbers or zero to disable.
|
Abstraction to make it easier to check if the cache is enabled on the DeviceApi instance.
|
Property Details |
cookie_nameGet the cookie name that the client side properties would be set to. When using get_properties(HEADERS), the detection would automatically use the contents of this cookie if it exists. If you want the client side properties to be used add the DeviceAtlas Client-side component (JS lib) to your web-site pages. When the User-Agent or HTTP headers are set manually to get_properties() the client side properties (probably the value set to the cookie) can be manually passed to this methods as the second argument, note that this config is only used for get_properties(HEADERS).
|
include_ua_propsGet if the User-Agent dynamic properties are being included in the property set or not.
|
include_lang_propsGet if the language/locale properties should be included in the property set or not.
|
include_match_infoTo get if get_properties(HEADERS) include the matched and unmatched parts of the User-Agent to the property set.
|
return_none_when_no_propertiesGet if the value returned by get_properties(HEADERS) should be None when there are no properties found or an instance of Properties that has no Property inside it should be returned.
|
max_cache_entriesGet the max number of results to be cached.
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Wed Dec 4 11:30:34 2019 | http://epydoc.sourceforge.net |