12.5. pyVig - devices

class nettoolkit.pyVig.devices.AdevDevices(stencil, var_func_dict, var_df)[source]

Bases: object

A single Device details

Parameters:
  • stencil (str) – name of default stencil file

  • var_func_dict (dict) – dictionary of var attributes of device

  • var_df (DataFrame) – DataFrame of var tab from the -clean excel file generated.

add_to_devices(what, **kwargs)[source]

add the key word arguments to dictionary refered by what

Parameters:

what (dict) – device(s) dictionary

add_vlan_info(vlan_df)[source]

add identified vlan-vrf-subnet information for the devices using vlan DataFrame.

Parameters:

vlan_df (DataFrame) – pandas DataFrame object of vlan tab from -clean excel file.

Returns:

updated pandas DataFrame

Return type:

DataFrame

get_self_device_df()[source]

generate the pandas DataFrame object with single row detail for the self device.

Returns:

pandas DataFrame with single row detail of the self device.

Return type:

DataFrame

nettoolkit.pyVig.devices.device_df_drop_empty_duplicates(devices)[source]

generate pandas DataFrame from provides devices dictionary of lists.

  • Removes empty entries from hostname column,

  • Convert case to lowercases,

  • Removes duplicate entries (if any)

  • Returns generated DataFrame.

Parameters:

devices (dict) – dictionary of list (compatible to convert to DataFrame)

Returns:

pandas DataFrame

Return type:

DataFrame

nettoolkit.pyVig.devices.update_var_df_details_to_table_df(merged_df, DCT_dict, var_func_dict)[source]

updates custom details from var tab to devices.

Parameters:
  • merged_df (DataFrame) – pandas DataFrame

  • DCT_dict (dict) – dictionary of DF_ConverT objects

  • var_func_dict (dict) – dictionary of custom var functions

Returns:

updated DataFrame

Return type:

DataFrame

12.6. pyVig - entities

class nettoolkit.pyVig.entities.Connectors(cable_matrix_data, devices)[source]

Bases: Multi_Execution

Execution of Cabling/Connector objects on visio

Parameters:
execute(connector)[source]

Executor Paralllel processing disabled currently due to visio not support

Parameters:

connector (dict) – a single row details of cabling data

Returns:

None

Return type:

None

get_optional_columns_value(connector)[source]

get the value of all optional columns for given row

Parameters:

connector (dict) – a single row information from a DataFrame

Returns:

dictionary with found values else default

Return type:

dict

class nettoolkit.pyVig.entities.ItemObjects(visObj, devices_data, connectors, filterOnCables=True)[source]

Bases: Multi_Execution

Execution of Devices/Item objects on visio

Parameters:
  • visObj (visObj) – visio object

  • devices_data (AdevDevices) – Device object

  • connectors (ADevCablings) – Cabling object

  • filterOnCables (bool, optional) – multi tab filters. Defaults to True.

property bottom_most

bottom most used co-ordinate on visio

Returns:

minimum of used y-axis

Return type:

int

execute(dev)[source]

Executor Paralllel processing disabled currently due to visio not support

Parameters:

dev (dict) – a single row details of device data

Returns:

None

Return type:

None

property left_most

left most used co-ordinate on visio

Returns:

minimum of used x-axis

Return type:

int

property page_height

total height occupied by drawing on visio page

Returns:

page height

Return type:

int

property page_width

total width occupied by drawing on visio page

Returns:

page width

Return type:

int

property right_most

right most used co-ordinate on visio

Returns:

maximum of used x-axis

Return type:

int

property top_most

top most used co-ordinate on visio

Returns:

maximum of used y-axis

Return type:

int

nettoolkit.pyVig.entities.get_col_value(row_info, column, isMerged=True)[source]

get the value of provided column from given row details

Parameters:
  • row_info (dict) – a single row information from a DataFrame

  • column (str) – column name

  • isMerged (bool, optional) – is it a merged column or native. Defaults to True.

Returns:

Cell information from row

Return type:

str

12.7. pyVig - stencils

nettoolkit.pyVig.stencils.get_list_of_stencils(folder, devices_data)[source]

finds the required stencil files in given folder and return those filenames in a list.

Parameters:
  • folder (str) – path of folder where stencils stored

  • devices_data (DeviceData) – Device Data object

Raises:

ValueError – Raise Exception if any stencil is missing

Returns:

list of file names

Return type:

list