Add readme.md File Generation Code

This commit is contained in:
minchulahn
2023-06-22 11:00:49 +09:00
parent 7508e63d18
commit 333ab34a2d
3 changed files with 15 additions and 2 deletions

13
markdown-table.py Normal file
View File

@@ -0,0 +1,13 @@
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)))