import json, pandas version_file_path= "./version.json" readme_file_path= "./README.md" data = json.load(open(version_file_path, 'r')) df = pandas.DataFrame.from_dict(data['service']).rename(columns={'type':'Type', 'name':'Name', 'candidate_version':'Candidate Version', 'release_version':'Release Version', 'product_version':'Product Version'}) df.drop(['latest_candidate_version'], axis=1, inplace=True) with open(readme_file_path, 'w') as file: file.write("# DataSaker\n### {}\n\n".format(data["datasaker"])) file.write("# Service Version\n{}".format(df.to_markdown(index=False, colalign=("center", "left", "center", "center", "center"))))