Metadata-Version: 2.4
Name: check-json-format
Version: 1.0.0
Summary: Validate JSON files for format correctness and duplicate keys.
Author-email: Pandiyaraj Karuppasamy <pandiyarajk@live.com>
Maintainer-email: Pandiyaraj Karuppasamy <pandiyarajk@live.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/pandiyarajk/check_json_format
Project-URL: Documentation, https://github.com/pandiyarajk/check_json_format#readme
Project-URL: Repository, https://github.com/pandiyarajk/check_json_format
Project-URL: Changelog, https://github.com/pandiyarajk/check_json_format/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/pandiyarajk/check_json_format/issues
Keywords: json,validation,lint,format,duplicate-keys
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# check_json_format

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

**Repository:** [https://github.com/pandiyarajk/check_json_format](https://github.com/pandiyarajk/check_json_format)  
**PyPI:** [check-json-format](https://pypi.org/project/check-json-format/)

## Author

**Pandiyaraj Karuppasamy**  
Email: [pandiyarajk@live.com](mailto:pandiyarajk@live.com)

## Install

From PyPI (recommended):

```bash
pip install check-json-format
```

From source:

```bash
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:

```bash
check-json-format <json_file_path>
```

Or run as a module:

```bash
python -m check_json_format <json_file_path>
```

When running from a source checkout:

```bash
python check_json_format.py <json_file_path>
```

### Example

```bash
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`):

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

## License

See [LICENSE](LICENSE) in this repository.
