There is useful configuration to json.dump() which I'd like to pass through await crawler.export_data("export.json"), but I see no way to do that:
ensure_ascii - as someone living in a country using extended latin, setting this to False prevents Python to encode half of the characters as weird mess
indent - allows me to read the output as a mere human
sort_keys - may be useful for git scraping, not sure
The only workaround I can think of right now is something convoluted like:
from pathlib import Path
path = Path("export.json")
await crawler.export_data(path)
path.write_text(json.dumps(json.loads(path.read_text()), ensure_ascii=False, indent=2))
There is useful configuration to
json.dump()which I'd like to pass throughawait crawler.export_data("export.json"), but I see no way to do that:ensure_ascii- as someone living in a country using extended latin, setting this toFalseprevents Python to encode half of the characters as weird messindent- allows me to read the output as a mere humansort_keys- may be useful for git scraping, not sureThe only workaround I can think of right now is something convoluted like: