\r\n

51Degrees Device Detection Python  4.4

Device Detection services for 51Degrees Pipeline

fiftyone_devicedetection_onpremise.devicedetection_onpremise.DeviceDetectionOnPremise Class Reference

Detailed Description

The Device Detection On Premise engine uses a datafile to generate a list of properties about a device based on evidence supplied to it.

Inheritance diagram for fiftyone_devicedetection_onpremise.devicedetection_onpremise.DeviceDetectionOnPremise:

[legend]

Collaboration diagram for fiftyone_devicedetection_onpremise.devicedetection_onpremise.DeviceDetectionOnPremise:

[legend]

Public Member Functions

def  __init__ (self, data_file_path=None, data=None, auto_update=None, cache=None, restricted_properties=None, licence_keys=None, download=True, max_matched_useragent_length=None, drift=None, difference=None, allow_unmatched=None, file_system_watcher=False, polling_interval=30, update_time_maximum_randomisation=10, create_temp_data_copy=True, update_matched_useragent=False, performance_profile="LowMemory", reuse_temp_file=False, concurrency=multiprocessing.cpu_count(), update_on_start=False, data_update_url="https://distributor.51degrees.com/api/v2/download", use_predictive_graph=None, use_performance_graph=None, data_update_use_url_formatter=True, data_update_verify_md5=True, **kwargs)
Constructor for the DeviceDetection On Premise Engine. More...
def  init_engine (self)
Function for initialising the engine, wrapped like this so that an engine can be initialised once the datafile is retrieved if update_on_start is set to true. More...
def  get_metric_properties (self)
def  get_evidence_key_filter (self)
Returns evidence key filter for the on premise engine. More...
def  on_registration (self, pipeline)
Function called after the engine is registered with a pipeline the engine base class registers the datafile but we also need to initialise the SWIG wrapper so call self.init_engine() here after the datafile is registered. More...
def  process_internal (self, flow_data)
Internal process method of the Device Detection On Premise engine Gets properties through the SWIG wrapper and stores them in a SwigData extension of the ElementData class. More...
def  get_component (self, property)

Public Attributes

 data
 config
 properties_list  data_file_path  engine  evidence_keys_list  properties

Constructor & Destructor Documentation

◆ __init__()

def fiftyone_devicedetection_onpremise.devicedetection_onpremise.DeviceDetectionOnPremise.__init__ (   self,
  data_file_path = None,
  data = None,
  auto_update = None,
  cache = None,
  restricted_properties = None,
  licence_keys = None,
  download = True,
  max_matched_useragent_length = None,
  drift = None,
  difference = None,
  allow_unmatched = None,
  file_system_watcher = False,
  polling_interval = 30,
  update_time_maximum_randomisation = 10,
  create_temp_data_copy = True,
  update_matched_useragent = False,
  performance_profile = "LowMemory",
  reuse_temp_file = False,
  concurrency = multiprocessing.cpu_count(),
  update_on_start = False,
  data_update_url = "https://distributor.51degrees.com/api/v2/download",
  use_predictive_graph = None,
  use_performance_graph = None,
  data_update_use_url_formatter = True,
  data_update_verify_md5 = True,
**   kwargs  
)

Constructor for the DeviceDetection On Premise Engine.

@type data_file_path: string

Parameters
data_file_path - path to the data file @type data: binary
data - in memory version of datafile @type auto_update: bool
auto_update - whether to automatically update the datafile when required @type restricted_properties: list
restricted_properties - List of property keys to limit the engine to @type license_keys: string
licence_keys - licencekeys to use for the data file update service @type download: bool
download - whether to download the datafile or keep it in memory when it is returned from the datafile update service @type max_matched_useragents_length : int
Number - of characters to consider in the matched User-Agent. Ignored if update_matched_useragent is false @type update_matched_useragent:
- update_matched_useragent: True if the detection should record the matched characters from the target User-Agent @type drift: int
drift - Set maximum drift in hash position to allow when processing HTTP headers @type difference: int
difference - set the maximum difference to allow when processing HTTP headers. The difference is the difference in hash value between the hash that was found, and the hash that is being searched for. By default this is 0. @type allow_unmatched : bool
allow_unmatched - True if there should be at least one matched node in order for the results to be considered valid. By default, this is false @type performance_profile: string
performance_profile - options are: LowMemory, MaxPerformance, Balanced, BalancedTemp, HighPerformance @type reuse_temp_file: bool
reuse_temp_file - Indicates that an existing temp file may be used. This should be selected if multiple instances wish to use the same file to prevent high disk usage. @type concurrency: int
concurrency - defaults to the number of cpus in the machine @type update_on_start : bool
update_on_start - : When this is set to true the datafile is updated / downloaded immediately on initialization. This is useful if no initial datafile is present. @type file_system_watcher: bool
file_system_watcher - whether to check the datafile's path for changes and update the connected FlowElement's data @type polling_interval: int
polling_interval - How often to poll for updates to the datafile (minutes) @type update_time_maximum_randomisation : int
update_time_maximum_randomisation - : Maximum randomisation offset in seconds to polling time interval @type data_update_verify_md5 : bool @type create_temp_copy: bool
create_temp_copy - whether to copy datafile to temporary location when updating @type data_update_url: string
data_update_url - base url for the datafile update service @type use_performance_graph: bool
use_performance_graph - True if the performance optimized graph should be used for processing @type use_predictive_graph: bool
use_predictive_graph - True if the predictive optimized graph should be used for processing
data_update_use_url_formatter - This must be set to false to prevent the API from appending the query string parameters that are required when calling the 51Degrees Distributor service. @type data_update_use_url_formatter: bool

Member Function Documentation

◆ get_component()

def fiftyone_devicedetection_onpremise.devicedetection_onpremise.DeviceDetectionOnPremise.get_component (   self,
  property  
)

◆ get_evidence_key_filter()

def fiftyone_devicedetection_onpremise.devicedetection_onpremise.DeviceDetectionOnPremise.get_evidence_key_filter (   self )

Returns evidence key filter for the on premise engine.

Generated via a list of evidence keys from the swig engine

◆ get_metric_properties()

def fiftyone_devicedetection_onpremise.devicedetection_onpremise.DeviceDetectionOnPremise.get_metric_properties (   self )

◆ init_engine()

def fiftyone_devicedetection_onpremise.devicedetection_onpremise.DeviceDetectionOnPremise.init_engine (   self )

Function for initialising the engine, wrapped like this so that an engine can be initialised once the datafile is retrieved if update_on_start is set to true.

If this is the case, processing is held until the data file is downloaded and available.

◆ on_registration()

def fiftyone_devicedetection_onpremise.devicedetection_onpremise.DeviceDetectionOnPremise.on_registration (   self,
  pipeline  
)

Function called after the engine is registered with a pipeline the engine base class registers the datafile but we also need to initialise the SWIG wrapper so call self.init_engine() here after the datafile is registered.

◆ process_internal()

def fiftyone_devicedetection_onpremise.devicedetection_onpremise.DeviceDetectionOnPremise.process_internal (   self,
  flow_data  
)

Internal process method of the Device Detection On Premise engine Gets properties through the SWIG wrapper and stores them in a SwigData extension of the ElementData class.

Each property value (or lack of) is returned in an AspectPropertyData wrapper from the core Pipeline library.

Member Data Documentation

◆ config

fiftyone_devicedetection_onpremise.devicedetection_onpremise.DeviceDetectionOnPremise.config

◆ data

fiftyone_devicedetection_onpremise.devicedetection_onpremise.DeviceDetectionOnPremise.data

◆ data_file_path

fiftyone_devicedetection_onpremise.devicedetection_onpremise.DeviceDetectionOnPremise.data_file_path

◆ datakey

fiftyone_devicedetection_onpremise.devicedetection_onpremise.DeviceDetectionOnPremise.datakey

◆ engine

fiftyone_devicedetection_onpremise.devicedetection_onpremise.DeviceDetectionOnPremise.engine

◆ evidence_keys_list

fiftyone_devicedetection_onpremise.devicedetection_onpremise.DeviceDetectionOnPremise.evidence_keys_list

◆ properties

fiftyone_devicedetection_onpremise.devicedetection_onpremise.DeviceDetectionOnPremise.properties

◆ properties_list

fiftyone_devicedetection_onpremise.devicedetection_onpremise.DeviceDetectionOnPremise.properties_list
On This Page