Spaces:
Sleeping
Sleeping
Update json2kadi.py
Browse files- json2kadi.py +4 -2
json2kadi.py
CHANGED
@@ -33,7 +33,7 @@ def transform_value(key, value):
|
|
33 |
else:
|
34 |
raise ValueError(f"Unsupported value type: {type(value)}")
|
35 |
|
36 |
-
def
|
37 |
return [transform_value(key, value) for key, value in data.items()]
|
38 |
|
39 |
|
@@ -199,7 +199,9 @@ input_json = {
|
|
199 |
|
200 |
if __name__ == "__main__":
|
201 |
# Transform the input JSON
|
202 |
-
output_json = transform_json2kadi(input_json)
|
|
|
|
|
203 |
|
204 |
# Print the output JSON
|
205 |
print(json.dumps(output_json, indent=2))
|
|
|
33 |
else:
|
34 |
raise ValueError(f"Unsupported value type: {type(value)}")
|
35 |
|
36 |
+
def my_json_to_kadi(data):
|
37 |
return [transform_value(key, value) for key, value in data.items()]
|
38 |
|
39 |
|
|
|
199 |
|
200 |
if __name__ == "__main__":
|
201 |
# Transform the input JSON
|
202 |
+
# output_json = transform_json2kadi(input_json)
|
203 |
+
from kadi_apy.lib.conversion import json_to_kadi
|
204 |
+
output_json = json_to_kadi(input_json)
|
205 |
|
206 |
# Print the output JSON
|
207 |
print(json.dumps(output_json, indent=2))
|