Open matentzn opened 3 months ago
It may need to be part of the framework. yq
is not available in the ODK.
We could add it: https://github.com/INCATools/ontology-development-kit/issues/838
Or dump it here like:
json_string = json.dumps(json_data)
with open(filepath, "w") as text_file:
print(json_string, file=text_file)
perhaps. Not sure whats best
The second option is the fastest way to have the file.
@anitacaron @matentzn I noticed yesterday that the dashboard JSON produced here is now out of date, so I took a very initial stab at a durable fix in the PR above. I'd agree with @anitacaron that dumping the JSON within Python would be much more straightforward and portable -- just make sure to pass an extra handler function to properly serialize datetimes, because they're a full type in YAML but not in JSON (need to be converted to strings somehow eg with isoformat()
)
In order for James S. to do his work on the website, we need a stable JSON version of overall results file which is currently YAML.
This is the command to do this with yq
But you can also just cycle it through the JSON module when writing the file as part of the framework.
Would you be able to do that @anitacaron?
Originally posted by @anitacaron in https://github.com/OBOFoundry/obo-dash.github.io/issues/15#issuecomment-2009175153