...
 
Commits (3)
......@@ -47,17 +47,11 @@ import shutil
import sys
from pathlib import Path
import toolz
from docopt import docopt
import jsonstat
import toolz
import ujson as json
from docopt import docopt
DATAPACKAGE_JSON = {
"dbnomics": {
"data_model_version": "0.9.1"
}
}
PROVIDER_JSON = dict(
code='CSO',
......@@ -87,9 +81,6 @@ def main():
debug_mode = args['--debug']
logging.basicConfig(format="%(levelname)s: %(message)s", level=(logging.DEBUG if debug_mode else logging.INFO))
# Write datapackage.json
write_json_file(target_dir / 'datapackage.json', DATAPACKAGE_JSON)
# Write provider.json
write_json_file(target_dir / 'provider.json', PROVIDER_JSON)
......@@ -230,10 +221,10 @@ def iterate_dataset(filepath):
for dimension in dataset.dimensions():
if dimension.role in ('time', 'metric'):
continue
dimension_values = {}
dimension_values = []
for value_n in range(0, len(dimension)):
value = dimension.category(value_n)
dimension_values[value.index] = value.label
dimension_values.append([value.index, value.label])
dimensions_values_labels[dimension.did] = dimension_values
return dimensions_values_labels
......