Get a model list from all yaml files in `main_path`.
(main_path)
| 19 | |
| 20 | |
| 21 | def get_model_list(main_path): |
| 22 | """ |
| 23 | Get a model list from all yaml files in `main_path`. |
| 24 | """ |
| 25 | files = os.listdir(main_path) |
| 26 | model_list = list() |
| 27 | |
| 28 | for file in files: |
| 29 | f = open(os.path.join(main_path, file), "r") |
| 30 | data = yaml.load(f.read(), Loader=yaml.FullLoader) |
| 31 | model_list.append(data) |
| 32 | f.close() |
| 33 | |
| 34 | model_list = sorted(model_list, key=lambda x: (x["release_date"], x["name"])) |
| 35 | |
| 36 | return model_list |
| 37 | |
| 38 | |
| 39 | def write_to_json(model_list, output_file): |