Package mobi :: Package mtld :: Package da :: 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) Afilias Technologies Limited 2021. All Rights Reserved.

Author: Afilias Technologies Limited

Instance Methods
 
load_data_from_file(self, filePath)
Load the data file from the provided path.
 
getProperties(self, key)
Selects a value for a given IPv4 address, traverses the tree and chooses the most specific value available for a given address.
 
getPropertyNames(self)
Return a list of all the property names.
 
getPropertyNamesAsStrings(self)
Return a list of all the property names as string.
 
getCopyright(self)
Returns the data file copyright.
 
getCreationDate(self)
Returns the data file creation date.
 
getVersion(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, filePath)

 

Load the data file from the provided path.

Parameters:
  • filePath - The path on disk to the data file.
Raises:

getProperties(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.

getPropertyNames(self)

 

Return a list of all the property names.

Returns:
A list of the properties names.

getPropertyNamesAsStrings(self)

 

Return a list of all the property names as string.

Returns:
A list of the properties names.

getCopyright(self)

 

Returns the data file copyright.

Returns:
The copyright.

getCreationDate(self)

 

Returns the data file creation date.

Returns:
The creation date.

getVersion(self)

 

Returns the version of the data file.

Returns:
The version of the data file.