import json html_string = '''

Library Repositories on GitLab

''' with open("all-libs-gitlab.json", 'r') 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 Stars Forks Last updated
" + org['name'] + "" + repo['name'] + "" + str(repo['star_count']) + "" + str(repo['forks_count']) + "" + repo['last_activity_at'].split("T")[0] + "
''' with open('repositories-gitlab.html', 'w', encoding='utf8') as html_file: html_file.write(html_string)