feat: split metadata into smal pieces
All checks were successful
gl/check check status: success (b532f938e9012f7910822aec1adfeb687ee5220b)
gl/gate gate status: success (b532f938e9012f7910822aec1adfeb687ee5220b)

This commit is contained in:
2023-06-01 16:50:12 +02:00
parent 177ba3a3fa
commit b532f938e9
108 changed files with 1133 additions and 538 deletions

41
tools/split_metadata.py Normal file
View File

@ -0,0 +1,41 @@
# import copy
from pathlib import Path
import yaml
import otc_metadata
data = otc_metadata.services.Services()
for item in data.all_docs:
with open(
Path(
otc_metadata.data.DATA_DIR,
"documents",
f"{item['service_type']}-{item['type']}.yaml",
),
"w",
) as fp:
yaml.dump(item, fp, explicit_start=True)
for item in data.all_services:
with open(
Path(
otc_metadata.data.DATA_DIR,
"services",
f"{item['service_type']}.yaml",
),
"w",
) as fp:
yaml.dump(item, fp, explicit_start=True)
for item in data.service_categories:
with open(
Path(
otc_metadata.data.DATA_DIR,
"service_categories",
f"{item['name']}.yaml",
),
"w",
) as fp:
yaml.dump(item, fp, explicit_start=True)