read_fct module

Created on Mon Nov 17 11:18:59 2014 @author: pierre_b


Read every csv files in a directory and subdirectory and create a structure for the code generation

Parameters:path (str) – path to the root folder with the csv files
Returns:gen_dict – Dict with key = class name and value = class dict (name, package, properties, methods…)
Return type:dict

Read a csv file and create a dict for the class code generation

Parameters:path (str) – path to the class csv file to read
Returns:class_dict – Dict containing all the class informations (properties, package, methods…)
Return type:dict
get_value_str(value, type_val)[source]

Convert the value from the csv file to the correct str according to the type

  • value (str) – value to convert
  • type_val (str) – Type to convert to

value – Value updated to match the type

Return type:


find_import_type(gen_dict, class_dict, pyleecan_type=[])[source]

Find all the Pyleecan type used by the class of class_dict

  • gen_dict (dict) – Dict with key = class name and value = class_dict
  • class_dict (dict) – Dict of the class to find the import
  • pyleecan_type (list) – Existing type to import (Default value = [])

type_list – List of pyleecan type (as str) to import

Return type:



Check if the type is a list of Pyleecan type ([name])

Parameters:type_name (str) – Type of the property
Returns:is_list – True if the type is a list of pyleecan type
Return type:bool
exception NotAFile[source]

Bases: Exception

Raised when the code generator is call on a wrong path