The DeviceAtlas Device Detection API provides a way to detect devices
based on the HTTP headers. Using the headers, the API returns device
information such as screen width, screen height, is mobile, vendor, model
etc.
To get the most accurate results: 1- Pass the whole HTTP headers. 2-
Use the DeviceAtlas client-side-component and pass the result.
|
__init__(self,
config=None)
Constructs a DeviceApi instance with default configs. |
|
|
|
set_config(self,
c)
Applies a configuration object to the api instance, resetting the
cache and to the loaded tree if exists |
|
|
|
load_data_from_file(self,
json_data_file_path)
Load the DeviceAtlas device detection data into the API from a JSON
file. |
|
|
|
load_data_from_string(self,
json_data_string)
Load the DeviceAtlas device detection data into the API from a
string. |
|
|
|
|
|
get_data_version(self)
Get the device data (JSON file) version. |
|
|
|
get_data_revision(self)
Get the device data (JSON file) revision. |
|
|
|
get_data_creation_timestamp(self)
Get the device data (JSON file) creation timestamp. |
|
|
|
get_properties(self,
user_agent_or_headers,
client_side_properties=None)
Get known properties from a User-Agent or HTTP headers optionally
merged with properties from the client side component. |
|
|
|
__put_cache(self,
key,
properties) |
|
|
|
__get_properties_from_headers(self,
user_agent_or_headers,
client_side_properties,
properties) |
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|