import json html_string = '''

Library Repositories on GitHub

''' with open("all-libs.json", 'r', encoding="utf-8") as json_file: data = json.load(json_file) for org in data["organisations"]: for repo in org['repositories']: # print(type(repo)) if type(repo) is dict: if str(repo['license']) != "None": license = repo['license']['spdx_id'] else: license = " " html_string += "\n" html_string += '''
Organisation Repository License Stars Forks Forked Last updated
" + org['name'] + "" + repo['name'] + "" + license + "" + str(repo['stargazers_count']) + "" + str(repo['forks_count']) + "" + str(repo['fork']) + "" + repo['updated_at'].split("T")[0] + "
''' with open('repositories.html', 'w', encoding='utf8') as html_file: html_file.write(html_string)