Skip to main content

Validate JSON files for format correctness and duplicate keys.

Project description

check_json_format

A Python tool to validate JSON files for format correctness and duplicate keys.

Repository: https://github.com/pandiyarajk/check_json_format
PyPI: check-json-format

Author

Pandiyaraj Karuppasamy
Email: pandiyarajk@live.com

Install

From PyPI (recommended):

pip install check-json-format

From source:

git clone https://github.com/pandiyarajk/check_json_format.git
cd check_json_format
pip install .

Requirements

  • Python 3.6+
  • No external dependencies (uses standard library only)

Usage

After installing from PyPI:

check-json-format <json_file_path>

Or run as a module:

python -m check_json_format <json_file_path>

When running from a source checkout:

python check_json_format.py <json_file_path>

Example

check-json-format config.json

What it does

  • Format validation: Checks if the file is valid JSON (syntax, brackets, commas, etc.).
  • Duplicate keys: Reports duplicate keys at the same object level (when detectable).
  • File handling: Handles missing files, permission errors, and encoding issues.
  • Exit behavior: Prints SUCCESS: Valid JSON format and optional duplicate-key messages; exits with non-zero on validation failure.

Output

  • Valid JSON: SUCCESS: Valid JSON format and [SUCCESS] No duplicate keys found.
  • Invalid JSON: Error details from the JSON parser.
  • File issues: Clear messages for file not found, permission denied, or encoding errors.

Publishing to PyPI

Build and upload (requires build and twine):

pip install build twine
python -m build
twine upload dist/*

License

See LICENSE in this repository.

Project details


Download files

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

Source Distribution

check_json_format-1.0.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

check_json_format-1.0.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file check_json_format-1.0.0.tar.gz.

File metadata

  • Download URL: check_json_format-1.0.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for check_json_format-1.0.0.tar.gz
Algorithm Hash digest
SHA256 83514ddc8e794aae2acaa7cbfe7aa4b63ea15acdcc749593989783f6126e13ae
MD5 c2df2e36a842f5a9b605c759fc931153
BLAKE2b-256 dcc3ce198e75bad548825a8d07c469c8e61b37ce584d01ac6f0bd28265dc3205

See more details on using hashes here.

File details

Details for the file check_json_format-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for check_json_format-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 552a7b09c766ecc1c7462fe3ede3dee8eb25d12701ca129fd8e6aa531aa984a8
MD5 100560199798500b77ccf192a0db50e8
BLAKE2b-256 8a18eb54ecb161f5c30d7f933a9084a6a7ff8b394e60b4b9c8e02ad0071945e4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page