...
 
Commits (2)
......@@ -25,18 +25,16 @@
import argparse
from collections import OrderedDict
from itertools import count, islice
import json
import os
import re
import subprocess
import sys
from collections import OrderedDict
from itertools import count, islice
from slugify import slugify
from dbnomics_data_model import validators
provider_code = 'AMECO'
provider = dict(
code=provider_code,
......@@ -386,7 +384,6 @@ def main():
def save_node(dir, node):
if node.get('category_code') is None and node.get('dataset_code') is None and node.get('key') is None:
validators.validate_provider(node)
filename = 'provider.json'
title = 'Provider {}'.format(node['name'])
elif node.get('category_code') is not None:
......@@ -394,21 +391,18 @@ def save_node(dir, node):
assert node.get('key') is None
node['code'] = node['category_code']
del node['category_code']
validators.validate_category(node)
filename = 'category.json'
title = 'Category {} {}'.format(node['code'], node['name'])
elif node.get('dataset_code') is not None:
assert node.get('key') is None
node['code'] = node['dataset_code']
del node['dataset_code']
validators.validate_dataset(node)
filename = 'dataset.json'
title = 'Dataset {} {}'.format(node['code'], node['name'])
else:
assert node.get('key') is not None
node['code'] = node['key']
del node['key']
validators.validate_series(node)
filename = 'series.json'
title = 'Series {} {}'.format(node['code'], node['name'])
......