Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eweka.nl!lightspeed.eweka.nl!194.134.4.91.MISMATCH!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.014 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'example:': 0.03; 'detect': 0.07; 'json': 0.07; 'subject:file': 0.07; 'key.': 0.09; 'subject:key': 0.16; 'thanks,': 0.17; 'first.': 0.19; 'command': 0.22; 'second': 0.26; 'message-id:@mail.gmail.com': 0.30; 'file': 0.32; 'received:google.com': 0.35; 'hi,': 0.36; 'growing': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'manually': 0.60; 'happen': 0.63; 'repeat': 0.74; 'silently': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=DluQ18qa3DHb1oLzfE+Ny3Bemo9qppePzfJ2e+qt47I=; b=LFH3kLGeDKjkOk7oeYYocTi0ItKocqm2JA26fXmcgK2i1xOkZAnJ3vvCVehZJh7aAF VBOkP+e3ou/K3TYNHI6ry/KH5dx0HO8CrUlmZjMPQL1PKiW5Ul5/DPIN1Iv58w3tHA9v 0V/Kykzn/zxx8/mRVu0IQ/Wo90iNj3RyqzMNqrVpz1ZzkfBn6SKps//wfD65cU9VF3oW pJewSlnXmr1j5MJ1lTk5MA+ztv6BedRFpmUSN1lAIoJHxrMNZtrSjUmR2QW0Q1aQ6Evo stDVNs1tjR9XiZS/LgoD7KF5j8+fvCVvShYBNeDSHBuq9UUFUoGXYpQofMcff3Zi3HNq unnQ== X-Received: by 10.204.224.135 with SMTP id io7mr617199bkb.46.1369826240699; Wed, 29 May 2013 04:17:20 -0700 (PDT) MIME-Version: 1.0 From: Jabba Laci Date: Wed, 29 May 2013 13:16:59 +0200 Subject: detect key conflict in a JSON file To: Python mailing list Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1369826248 news.xs4all.nl 15991 [2001:888:2000:d::a6]:50422 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:46367 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 second key silently overwrites the value of the first. Do you know about a command line JSON validator? Thanks, Laszlo