Part of the Using JSON Schema project.
The ‘hello world’ of JSON processing, check the syntax of a JSON file.
For command line/script use, a console message is displayed and the process exits with 0 for success, 1 for failure.
Command Line / Script Use
Usage: jsonsyntax filename - filename name of file to check (path optional)
To run the syntax checker (command line or script) against the file example.json use,
jsonsyntax example.json
Library Function Use
To use the syntax checker as a library function, call the syntaxCheck function in a try/except block. For example,
from jsonsyntax import checkSyntax
try :
checkSyntax ("example.json")
print ("Valid JSON file")
except as e:
print ("Error: " + e.message);
Install
Installation using pip for Python 2 (2.7) or Python 3.
pip install ujs-jsonsyntax
License
MIT
Release files for ujs-jsonsyntax 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ujs-jsonsyntax-0.1.0.zip | 7.7 kB | Details |
Release files / ujs-jsonsyntax-0.1.0.zip
| Download URL | ujs-jsonsyntax-0.1.0.zip |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
37b65de4e109d5425d37d36f9773c39519bb8b663a5f7d1753e88bceb3a509de
|
|
BLAKE2b-256 checksum How to use checksums |
38ba5322161eb1576d54d771f15445e97382fa94e76bfcd5e9a0bb864674b9b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |