Re: detect key conflict in a JSON file

2013-05-29 Thread Jerry Hill
On Wed, May 29, 2013 at 1:10 PM, Chris Rebert wrote: > On Wed, May 29, 2013 at 4:16 AM, Jabba Laci wrote: > > I have a growing JSON file that I edit manually and it might happen > > that I repeat a key. If this happens, I would like to get notified. > > Currently the value of the second key sile

Re: detect key conflict in a JSON file

2013-05-29 Thread Steven D'Aprano
On Wed, 29 May 2013 11:20:59 -0400, Roy Smith wrote: >> How to process (read) YAML files in Python? > > Take a look at http://pyyaml.org/ Beware that pyaml suffers from the same issue as pickle, namely that it can execute arbitrary code when reading untrusted data. -- Steven -- http://mail.

Re: detect key conflict in a JSON file

2013-05-29 Thread Chris Rebert
On Wed, May 29, 2013 at 4:16 AM, Jabba Laci wrote: > Hi, > > How can you detect if a key is duplicated in a JSON file? Example: > > { > "something": [...], > ... > "something": [...] > } > > I have a growing JSON file that I edit manually and it might happen > that I repeat a key. If t

Re: detect key conflict in a JSON file

2013-05-29 Thread Roy Smith
On May 29, 2013, at 9:41 AM, Jabba Laci wrote: >> The real answer here is that JSON is probably not the best choice for >> large files that get hand-edited. For data that you intend to hand-edit >> a lot, YAML might be a better choice. >> >>> Currently the value of the second key silently overwr

Re: detect key conflict in a JSON file

2013-05-29 Thread rusi
On May 29, 6:41 pm, Jabba Laci wrote: > > The real answer here is that JSON is probably not the best choice for > > large files that get hand-edited.  For data that you intend to hand-edit > > a lot, YAML might be a better choice. > > >> Currently the value of the second key silently overwrites th

Re: detect key conflict in a JSON file

2013-05-29 Thread Ervin Hegedüs
Hello, On Wed, May 29, 2013 at 03:41:50PM +0200, Jabba Laci wrote: > > The real answer here is that JSON is probably not the best choice for > > large files that get hand-edited. For data that you intend to hand-edit > > a lot, YAML might be a better choice. > > > >> Currently the value of the se

Re: detect key conflict in a JSON file

2013-05-29 Thread Jabba Laci
> The real answer here is that JSON is probably not the best choice for > large files that get hand-edited. For data that you intend to hand-edit > a lot, YAML might be a better choice. > >> Currently the value of the second key silently overwrites the value of >> the first. Thanks but how would

Re: detect key conflict in a JSON file

2013-05-29 Thread Roy Smith
In article , Jabba Laci wrote: > I have a growing JSON file that I edit manually and it might happen > that I repeat a key. If this happens, I would like to get notified. The real answer here is that JSON is probably not the best choice for large files that get hand-edited. For data that you

detect key conflict in a JSON file

2013-05-29 Thread Jabba Laci
Hi, How can you detect if a key is duplicated in a JSON file? Example: { "something": [...], ... "something": [...] } I have a growing JSON file that I edit manually and it might happen that I repeat a key. If this happens, I would like to get notified. Currently the value of the sec