original_docstring: 
      Extract custom parts of a project data dict by subtracting template parts
  
      Parameters
      ----------
          project_csv: path
              path to the complete project csv file
          export_custom_csv: path
              path to store the resulting customization csv file
          *template_parts: (list)
              list of template parts included in the project
  
      Returns
      -------
  
      
docstring: Extract custom parts of a project data dict by subtracting template parts
  Parameters
  
  path
  path to the complete project csv file
  export_custom_csv: path
  path to store the resulting customization csv file
  template_parts: (list)
  list of template parts included in the project
  
  Returns
docstring_tokens: Extract custom parts of a project data dict by subtracting template parts Parameters path path to the complete project csv file export_custom_csv : path path to store the resulting customization csv file template_parts : ( list ) list of template parts included in the project Returns
code: def extract_customization(project_csv, export_custom_csv, *template_parts):
      """
      Extract custom parts of a project data dict by subtracting template parts
  
      Parameters
      ----------
          project_csv: path
              path to the complete project csv file
          export_custom_csv: path
              path to store the resulting customization csv file
          *template_parts: (list)
              list of template parts included in the project
  
      Returns
      -------
  
      """
  
      # ensure the project csv is compatible with the templates
      validate_project_against_template_parts(project_csv, *template_parts)
  
      custom_df = pd.read_csv(project_csv, dtype=str)
      custom_df = custom_df.rename(columns=map_header_json_to_csv)
      custom_df.index = custom_df['Variable / Field Name']
      custom_df.drop('Variable / Field Name', axis=1, inplace=True)
  
      for template_part in template_parts:
          template_path = (template_dir / template_part).with_suffix('.csv')
          template_df = pd.read_csv(template_path, dtype=str)
          template_df.index = template_df['Variable / Field Name']
          template_df.drop('Variable / Field Name', axis=1, inplace=True)
  
          mask = ~ template_df.isna()
          custom_df[mask] = np.nan
          # keep variable / field name column entries
  
      # remove custom structural fields (from structure.csv)
      mask = ((custom_df['Form Name'].isna()) & (custom_df['Field Type'].isna()) &
              (custom_df['Field Label'].isna()))
      custom_df = custom_df.loc[mask]
  
      # remove rows and columns that don't contain custom infos
      custom_df.dropna(axis=0, how='all', inplace=True)
      custom_df.dropna(axis=1, how='all', inplace=True)
  
      # save the resulting customization csv
      if export_custom_csv is not None:
          custom_df.to_csv(export_custom_csv, index=True)
code_tokens: def extract_customization ( project_csv , export_custom_csv , * template_parts ) : validate_project_against_template_parts ( project_csv , * template_parts ) custom_df = pd . read_csv ( project_csv , dtype = str ) custom_df = custom_df . rename ( columns = map_header_json_to_csv ) custom_df . index = custom_df [ 'Variable / Field Name' ] custom_df . drop ( 'Variable / Field Name' , axis = 1 , inplace = True ) for template_part in template_parts : template_path = ( template_dir / template_part ) . with_suffix ( '.csv' ) template_df = pd . read_csv ( template_path , dtype = str ) template_df . index = template_df [ 'Variable / Field Name' ] template_df . drop ( 'Variable / Field Name' , axis = 1 , inplace = True ) mask = ~ template_df . isna ( ) custom_df [ mask ] = np . nan mask = ( ( custom_df [ 'Form Name' ] . isna ( ) ) & ( custom_df [ 'Field Type' ] . isna ( ) ) & ( custom_df [ 'Field Label' ] . isna ( ) ) ) custom_df = custom_df . loc [ mask ] custom_df . dropna ( axis = 0 , how = 'all' , inplace = True ) custom_df . dropna ( axis = 1 , how = 'all' , inplace = True ) if export_custom_csv is not None : custom_df . to_csv ( export_custom_csv , index = True )
short_docstring: Extract custom parts of a project data dict by subtracting template parts
  Parameters
short_docstring_tokens: Extract custom parts of a project data dict by subtracting template parts Parameters
comment: """
      Extract custom parts of a project data dict by subtracting template parts
  
      Parameters
      ----------
          project_csv: path
              path to the complete project csv file
          export_custom_csv: path
              path to store the resulting customization csv file
          *template_parts: (list)
              list of template parts included in the project
  
      Returns
      -------
  
      """$SEP$# ensure the project csv is compatible with the templates$SEP$# keep variable / field name column entries$SEP$# remove custom structural fields (from structure.csv)$SEP$# remove rows and columns that don't contain custom infos$SEP$# save the resulting customization csv