Download custom_nodes/ComfyUI-Manager/json-checker.py from fotographerai/Zen-Style-Shape: direct link, hf CLI and curl.
- Browser
- Download file 803 Bytes
-
https://huggingface.co/spaces/fotographerai/Zen-Style-Shape/resolve/c0e10ba394d17bfa21ed8e0eaaceacb3913487fe/custom_nodes/ComfyUI-Manager/json-checker.py
- Command line
-
hf download hf://spaces/fotographerai/Zen-Style-Shape@c0e10ba394d17bfa21ed8e0eaaceacb3913487fe/custom_nodes/ComfyUI-Manager/json-checker.py
-
curl -L -o json-checker.py https://huggingface.co/spaces/fotographerai/Zen-Style-Shape/resolve/c0e10ba394d17bfa21ed8e0eaaceacb3913487fe/custom_nodes/ComfyUI-Manager/json-checker.py
803 Bytes
| import json | |
| import argparse | |
| def check_json_syntax(file_path): | |
| try: | |
| with open(file_path, 'r', encoding='utf-8') as file: | |
| json_str = file.read() | |
| json.loads(json_str) | |
| print(f"[ OK ] {file_path}") | |
| except UnicodeDecodeError as e: | |
| print(f"Unicode decode error: {e}") | |
| except json.JSONDecodeError as e: | |
| print(f"[FAIL] {file_path}\n\n {e}\n") | |
| except FileNotFoundError: | |
| print(f"[FAIL] {file_path}\n\n File not found\n") | |
| def main(): | |
| parser = argparse.ArgumentParser(description="JSON File Syntax Checker") | |
| parser.add_argument("file_path", type=str, help="Path to the JSON file for syntax checking") | |
| args = parser.parse_args() | |
| check_json_syntax(args.file_path) | |
| if __name__ == "__main__": | |
| main() | |