Package src :: Package com :: Package deviceatlas :: Package carrier :: Module carrier_data :: Class CarrierData
[frames] | no frames]

Class CarrierData

object --+
         |
        CarrierData

This class is responsible for loading the data file and walking the IPv4 Radix Trie to find the properties for a given IP address.


Copyright: Copyright (c) DeviceAtlas Limited 2023. All Rights Reserved.

Author: DeviceAtlas Limited

Instance Methods
 
load_data_from_file(self, file_path)
Load the data file from the provided path.
 
get_properties(self, key)
Selects a value for a given IPv4 address, traverses the tree and chooses the most specific value available for a given address.
 
get_property_names(self)
Return a list of all the property names.
 
get_property_names_as_strings(self)
Return a list of all the property names as string.
 
get_copyright(self)
Returns the data file copyright.
 
get_creation_date(self)
Returns the data file creation date.
 
get_version(self)
Returns the version of the data file.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

load_data_from_file(self, file_path)

 

Load the data file from the provided path.

Parameters:
  • file_path - The path on disk to the data file.
Raises:
  • e - DataFileException when there is a problem with the data file.

get_properties(self, key)

 

Selects a value for a given IPv4 address, traverses the tree and chooses the most specific value available for a given address.

Parameters:
  • key - The IPv4 address to look up.
Returns:
The properties for the most specific IPv4 network in a tree for a given IPv4 address.

get_property_names(self)

 

Return a list of all the property names.

Returns:
A list of the properties names.

get_property_names_as_strings(self)

 

Return a list of all the property names as string.

Returns:
A list of the properties names.

get_copyright(self)

 

Returns the data file copyright.

Returns:
The copyright.

get_creation_date(self)

 

Returns the data file creation date.

Returns:
The creation date.

get_version(self)

 

Returns the version of the data file.

Returns:
The version of the data file.