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

View File

@@ -13,7 +13,6 @@ def set_latest_version():
if __name__ == '__main__': if __name__ == '__main__':
if len(sys.argv) != 3: if len(sys.argv) != 3:
exit(traceback.print_exc()) exit(traceback.print_exc())
releaseTag = sys.argv[1] releaseTag = sys.argv[1]
serviceName = sys.argv[2] serviceName = sys.argv[2]

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)))

View File

@@ -1,2 +1,3 @@
jsontemplates==0.1.0 jsontemplates==0.1.0
PyYAML==6.0 PyYAML==6.0
pandas==2.0.2