@@ -14,6 +14,7 @@ def create_template(schema, output_name='releases', output_format='all', main_sh
14
14
Creates template file(s) from given inputs
15
15
This function is built to deal with commandline input and arguments
16
16
but to also be called from elswhere in future
17
+
17
18
"""
18
19
19
20
parser = SchemaParser (schema_filename = schema , main_sheet_name = main_sheet_name , rollup = rollup , root_id = root_id , use_titles = use_titles )
@@ -38,6 +39,11 @@ def spreadsheet_output(spreadsheet_output_class, name):
38
39
39
40
40
41
def flatten (input_name , schema = None , output_name = 'releases' , output_format = 'all' , main_sheet_name = 'main' , root_list_path = 'releases' , rollup = False , root_id = 'ocid' , use_titles = False , ** _ ):
42
+ """
43
+ Flatten a nested structure (JSON) to a flat structure (spreadsheet - csv or xlsx).
44
+
45
+ """
46
+
41
47
if schema :
42
48
schema_parser = SchemaParser (
43
49
schema_filename = schema ,
@@ -99,6 +105,10 @@ def decimal_default(o):
99
105
def unflatten (input_name , base_json = None , input_format = None , output_name = 'releases.json' ,
100
106
main_sheet_name = 'releases' , encoding = 'utf8' , timezone_name = 'UTC' ,
101
107
root_id = 'ocid' , schema = '' , convert_titles = False , ** _ ):
108
+ """
109
+ Unflatten a flat structure (spreadsheet - csv or xlsx) into a nested structure (JSON).
110
+
111
+ """
102
112
if input_format is None :
103
113
raise Exception ('You must specify an input format (may autodetect in future' )
104
114
elif input_format not in INPUT_FORMATS :
0 commit comments