\r\n

51Degrees Device Detection Python  4.2Newer Version 4.3

Device Detection services for 51Degrees Pipeline
  • device-detection-python
  • fiftyone_devicedetection_onpremise
  • fiftyone_devicedetection_onpremise
  • devicedetection_onpremise
  • DeviceDetectionOnPremise

device-detection-python.fiftyone_devicedetection_onpremise.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 device-detection-python.fiftyone_devicedetection_onpremise.fiftyone_devicedetection_onpremise.devicedetection_onpremise.DeviceDetectionOnPremise:

[legend]

Collaboration diagram for device-detection-python.fiftyone_devicedetection_onpremise.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_file_update_base_url='https://distributor.51degrees.com/api/v2/download', use_predictive_graph=None, use_performance_graph=None, **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_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.
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...

Public Attributes

 datakey
 data
 config
 properties_list
 data_file_path
 engine
 evidence_keys_list
 properties

Constructor & Destructor Documentation

◆ __init__()

def device-detection-python.fiftyone_devicedetection_onpremise.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_file_update_base_url = 'https://distributor.51degrees.com/api/v2/download',
  use_predictive_graph = None,
  use_performance_graph = None,
**   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 verify_md5 : bool @type create_temp_copy: bool
create_temp_copy - whether to copy datafile to temporary location when updating @type data_file_update_base_url: string
data_file_update_base_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

Member Function Documentation

◆ get_evidence_key_filter()

def device-detection-python.fiftyone_devicedetection_onpremise.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

◆ init_engine()

def device-detection-python.fiftyone_devicedetection_onpremise.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.

◆ process_internal()

def device-detection-python.fiftyone_devicedetection_onpremise.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.