12.5. pyVig - devices
- class nettoolkit.pyVig.devices.AdevDevices(stencil, var_func_dict, var_df)[source]
Bases:
objectA 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
- 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_ExecutionExecution of Cabling/Connector objects on visio
- Parameters:
cable_matrix_data (ADevCablings) – cablnig object
devices (AdevDevices) – devices object
- class nettoolkit.pyVig.entities.ItemObjects(visObj, devices_data, connectors, filterOnCables=True)[source]
Bases:
Multi_ExecutionExecution 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