Create json in python for Openrefine -
i'm scraping resources in python , want make json file, using in openrefine clean data.
here's code:
import json import codecs = xpath b = xpath c = xpath d = xpath codecs.open('info2.json', 'a', 'utf-8-sig') f: json.dump({'a': a, 'b': b, 'c': c, 'd': d}, f, sort_keys=true, indent=4, ensure_ascii=false)
it's right until i'll upload file in openrefine: can't click on right node, on specific element. here's example:
i think there's error producing json python, tryed putting 2 {{}} gives me "dict" error, tryed putting elements arrays nothing worked.
as request, here part of json:
p.s. i'm using codecs because there non-latin characters
to make node selectable in openrefine import need enclose array in node - e.g.
{ "distribution": [ "jhu", "123" ], "immagine": { "immaginelist": [ "1", "2", "3" ] } }
Comments
Post a Comment