7.42. Common Modifier Fn

common modifier functions/classes

class nettoolkit.facts_finder.modifiers.commons.modifier_commons.DataFrameInit(capture)[source]

Bases: object

Database Object

Parameters:

capture (str) – capture log file

read_int_sheets()[source]

reads ntc parsed excel file, returns dictionary of dataframe if sheet found in command list

Returns:

dictionary of dataframe

Return type:

dict

class nettoolkit.facts_finder.modifiers.commons.modifier_commons.KeyExchanger(column_mapper, cmd_lst)[source]

Bases: object

Dynamic Cisco Key Exchanger

Parameters:
  • column_mapper (dict) – cisco commands column mapper dictionary

  • cmd_lst (list) – commands capture list

read_column_mapper()[source]

reads column mapper file for each sheet, and update dictionary for each sheet Dataframe if sheet name found in command list

Returns:

dictionary of DataFrame

Return type:

dict

update_cisco_cmd_lst()[source]

updates cisco commands list with headers

class nettoolkit.facts_finder.modifiers.commons.modifier_commons.TableInterfaces[source]

Bases: object

Interfaces Object common calls/methods class

property pdf_dict

tables dictionary of DataFrame

Returns:

dictionary of dataframe

Return type:

dict

class nettoolkit.facts_finder.modifiers.commons.modifier_commons.TableVrfs[source]

Bases: object

VRF Object common calls/methods class

add_filter_col()[source]

add filter column for vrf

drop_mtmt_vrf()[source]

drop rows where vrf is management vrf

property pdf_dict

vrf dictionary of DataFrame

Returns:

dictionary of dataframe

Return type:

dict

update_column_names()[source]

rename vrf column name from name to vrf

update_rt()[source]

update vrf route targets value from rd values

class nettoolkit.facts_finder.modifiers.commons.modifier_commons.Var[source]

Bases: object

var Object common calls/methods class

convert_to_dataframe()[source]

creates a new dictionary of data frame from local variables Dictionary of Pandas DataFrame as value

create_a_temp_v6_hext2_3_column(sht_df)[source]

creates a temporary column ‘ipaddr’ for further processing

Parameters:

sht_df (DataFrame) – pandas DataFrame

Returns:

updated DataFrame with ‘ipaddr’ column

Return type:

DataFrame

property pdf_dict

dictionary of dataframe with var key

Returns:

dictionary of dataframe

Return type:

dict

update_device(sht)[source]

updates the multiple fields from show version output

Parameters:

sht (str) – sheet name

Returns:

None

Return type:

None

update_var(key, value)[source]

update self.var dicationary

Parameters:
  • key (str) – key

  • value (str) – value