2525TELEGRAM = 'telegram'
2626
2727# Indexes for creating yaml sequences of data
28- AREAS_START_INDEX = 14
29- AREAS_END_INDEX = 18
30- FOCUS_START_INDEX = 19
31- FOCUS_END_INDEX = 23
32- PROG_LANG_START_INDEX = 24
33- PROG_LANG_END_INDEX = 28
28+ AREAS_START_INDEX = 13
29+ AREAS_END_INDEX = 17
30+ FOCUS_START_INDEX = 18
31+ FOCUS_END_INDEX = 22
32+ PROG_LANG_START_INDEX = 23
33+ PROG_LANG_END_INDEX = 27
3434
3535type_ad_hoc = ("ad-hoc" , "ad hoc" )
3636type_long_term = ("long-term" , "long term" )
@@ -263,18 +263,18 @@ def get_num_mentee_from_row(mentor_row):
263263 """
264264 Gets the 'num_mentee' value for a new mentor from mentor_row, or use a default value if invalid.
265265 """
266- val = mentor_row .iloc [44 ]
266+ val = mentor_row .iloc [31 ]
267267
268268 return int (val ) if pd .notna (val ) else 0
269269
270270def get_mentor_position (mentor_row ):
271271 """
272272 Returns formatted value for mentor role and company
273273 """
274- if not pd .isna (mentor_row .iloc [9 ]):
275- return f"{ mentor_row .iloc [8 ].strip ()} , { mentor_row .iloc [9 ].strip ()} "
274+ if not pd .isna (mentor_row .iloc [5 ]):
275+ return f"{ mentor_row .iloc [4 ].strip ()} , { mentor_row .iloc [5 ].strip ()} "
276276 else :
277- return mentor_row .iloc [8 ].strip ()
277+ return mentor_row .iloc [4 ].strip ()
278278
279279
280280def xlsx_to_yaml_parser (mentor_row ,
@@ -291,42 +291,42 @@ def xlsx_to_yaml_parser(mentor_row,
291291 focus = get_yaml_block_sequence (mentor_row , FOCUS_START_INDEX , FOCUS_END_INDEX )
292292 programming_languages = get_yaml_block_sequence (mentor_row , PROG_LANG_START_INDEX , PROG_LANG_END_INDEX )
293293
294- mentor_image = f"{ IMAGE_FILE_PATH } /{ mentor_row .iloc [2 ].strip ().lower ().replace (' ' , '_' )} { IMAGE_SUFFIX } "
294+ mentor_image = f"{ IMAGE_FILE_PATH } /{ mentor_row .iloc [0 ].strip ().lower ().replace (' ' , '_' )} { IMAGE_SUFFIX } "
295295 # Format mentor role and company
296296 mentor_position = get_mentor_position (mentor_row )
297297
298- mentor_type = get_mentorship_type (mentor_row .iloc [4 ])
298+ mentor_type = get_mentorship_type (mentor_row .iloc [6 ])
299299
300300 # If mentor is new i.e mentor_sort is 0 (from default input), get the correct num_mentees and sort values
301301 if mentor_sort == 0 :
302302 num_mentee = get_num_mentee_from_row (mentor_row )
303303 mentor_sort = get_sort (mentor_type , current_period , num_mentee )
304304
305305 mentor = {
306- 'name' : mentor_row .iloc [2 ].strip (),
306+ 'name' : mentor_row .iloc [0 ].strip (),
307307 'disabled' : mentor_disabled ,
308308 'matched' : mentor_matched ,
309309 'sort' : mentor_sort ,
310310 'num_mentee' : num_mentee ,
311311 'hours' : extract_numbers_from_string (mentor_row .iloc [30 ]),
312312 'type' : mentor_type ,
313313 'index' : mentor_index ,
314- 'location' : mentor_row .iloc [6 ],
314+ 'location' : mentor_row .iloc [3 ],
315315 'position' : mentor_position ,
316- 'bio' : get_multiline_string (mentor_row .iloc [11 ]),
316+ 'bio' : get_multiline_string (mentor_row .iloc [10 ]),
317317 'image' : get_multiline_string (mentor_image ),
318- 'languages' : mentor_row .iloc [7 ],
319- 'availability' : add_availability (mentor_row .iloc [40 ]),
318+ 'languages' : mentor_row .iloc [8 ],
319+ 'availability' : add_availability (mentor_row .iloc [7 ]),
320320 'skills' : {
321- 'experience' : mentor_row .iloc [10 ],
322- 'years' : extract_numbers_from_string (mentor_row .iloc [10 ]),
323- 'mentee' : get_multiline_string (mentor_row .iloc [29 ]),
321+ 'experience' : mentor_row .iloc [9 ],
322+ 'years' : extract_numbers_from_string (mentor_row .iloc [9 ]),
323+ 'mentee' : get_multiline_string (mentor_row .iloc [28 ]),
324324 'areas' : areas ,
325325 'languages' : ', ' .join (programming_languages ),
326326 'focus' : focus ,
327- 'extra' : get_multiline_string (mentor_row .iloc [12 ])
327+ 'extra' : get_multiline_string (mentor_row .iloc [11 ])
328328 },
329- 'network' : get_social_media_links (mentor_row .iloc [31 ], mentor_row .iloc [32 ]),
329+ 'network' : get_social_media_links (mentor_row .iloc [32 ], mentor_row .iloc [33 ]),
330330 }
331331 return mentor
332332
@@ -385,7 +385,7 @@ def get_all_mentors_in_yml_format(yml_file_path, xlsx_file_path, current_period,
385385 mentors = []
386386
387387 for row in range (0 , len (df_mentors )):
388- mentor_name = df_mentors .iloc [row ].values [2 ].strip ().lower ()
388+ mentor_name = df_mentors .iloc [row ].values [0 ].strip ().lower ()
389389
390390 df_yml_row = df_yml .loc [df_yml .Name == mentor_name ]
391391
@@ -432,7 +432,7 @@ def get_new_mentors_in_yml_format(yml_file_path, xlsx_file_path, current_period,
432432 if df_mentors .iloc [row ].isnull ().all ():
433433 break
434434
435- mentor_name = df_mentors .iloc [row ].values [2 ].strip ().lower ()
435+ mentor_name = df_mentors .iloc [row ].values [0 ].strip ().lower ()
436436
437437 if df_yml .loc [df_yml .Name == mentor_name ].empty :
438438 mentor = xlsx_to_yaml_parser (df_mentors .iloc [row ], new_index , current_period )
0 commit comments