Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Script that validates JSON files and checks for duplicate keys.

Project Description

Checks a JSON file for any duplicate keys, which would be ignored by the normal parser.

Inspired by and based off of a python-list mailing list post: <https://mail.python.org/pipermail/python-list/2013-May/660874.html>.

Dependencies:

  • Python 2.7 or Python 3

Installation:

  • pip install jsonchecker

Or:

  • git clone https://github.com/legoktm/jsonchecker.git && cd jsonchecker && python setup.py install

Usage:

  • jsonchecker file_to_validate.json
  • jsonchecker directory/of/json/files/

An optional --quiet argument can be passed, and will cause the script to print out a . instead of the full filename for each file scanned. Useful if you plan on checking a large number of files.

The script will exit with a status code of 1 if any duplicate keys are found, 0 if none are.

An optional --values argument can be passed to additionally check for duplicate values within each key. The script will exit with a status code of 1 if there are either duplicate keys or duplicate values are found, 0 if none are.

Released into the public domain.

Release History

Release History

This version
History Node

0.8.0

History Node

0.7.0

History Node

0.6.1

History Node

0.5.1

History Node

0.4

History Node

0.3

History Node

0.2

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
jsonchecker-0.8.0.tar.gz (3.5 kB) Copy SHA256 Checksum SHA256 Source Feb 9, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting