Probably cleaner to do something like

`json.dump(data, f)`

I'd maybe tighten it up further by not binding `f` and maybe `data`, but that's not so important.