diff options
Diffstat (limited to 'json_to_wiki.py')
-rw-r--r-- | json_to_wiki.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/json_to_wiki.py b/json_to_wiki.py new file mode 100644 index 0000000..b62d320 --- /dev/null +++ b/json_to_wiki.py @@ -0,0 +1,26 @@ + +import json +import sys + +import export + +def main(): + everything = json.load(sys.stdin) + + def _export(): + for (name, valuess) in everything.iteritems(): + print name + templates = [] + + for (tname, values) in valuess: + template = export.Template( + tname.decode('utf8'), values.items()) + templates.append(template) + + yield (name, templates) + + export.output_multi('converted', _export()) + +if __name__ == '__main__': + main() + |