Mercurial > repos > stephenshank > the_observable_galaxy
diff observable.py @ 0:1c2fae461adc draft default tip
"planemo upload for repository https://github.com/stephenshank/the_observable_galaxy"
author | stephenshank |
---|---|
date | Fri, 15 Jul 2022 10:27:44 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/observable.py Fri Jul 15 10:27:44 2022 +0000 @@ -0,0 +1,18 @@ +import sys +import json + + +observable = {} +observable['notebook'] = sys.argv[1] +observable['history_id'] = sys.argv[2] +output_filename = sys.argv[3] +observable['payload_id'] = sys.argv[4] + +keys = sys.argv[5::2] +vals = sys.argv[6::2] +for key, val in zip(keys, vals): + observable[key] = val + +print(', '.join(sys.argv)) +with open(output_filename, 'w') as outfile: + json.dump(observable, outfile, indent=2)