for solution_element in tqdm(solutions_elements, 'Parsing challenges'): parser = Parser(solution_element) challenge_id = parser.parse_id() # using codewars api to get info about the challenge response = requests.get(CHALLENGE_URL.format(challenge_id)) js = response.json() # creating a challenge object challenge = Challenge.fromjson(js) if challenge.kyu == None: challenge.kyu = 'unrated' challenge.code = parser.parse_code() challenge.language = parser.parse_language() challenges[challenge.kyu].append(challenge) for kyu, challenge_list in challenges.items(): for challenge in tqdm(challenge_list, 'Saving {}'.format(kyu)): kyu_path = os.path.join(directory, kyu, challenge.name) os.makedirs(kyu_path, exist_ok=True) with open(os.path.join(kyu_path, 'README.md'), 'w') as f: f.write(challenge.description) with open( os.path.join( kyu_path,