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.1.tar.gz (7.0 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.1-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: check_json_format-1.0.1.tar.gz
  • Upload date:
  • Size: 7.0 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.1.tar.gz
Algorithm Hash digest
SHA256 6b386823504bc53688fd242cb5f339009d184063d7b16d8a262ceb119673dd82
MD5 8d0818be2c36ae1012559ead0c85f3e5
BLAKE2b-256 ed4d0620ca3bea231f40b64db1623d2a562fab4a3fa4f3d99569f6bff6e517d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for check_json_format-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a311e898da7ea1141651e1aca9f4c593e5fb0894c1e53906a8fd1afcf894492f
MD5 83490313c607c02929c969b1244d7514
BLAKE2b-256 aa14259da4348e32dd8c462e9a0454523d84a22ae2e07f631fb2747837cc5c40

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