Spaces:
Sleeping
Sleeping
Download compare_jsons.py from hisham-cmd/VortexCommerceBackend: direct link, hf CLI and curl.
- Browser
- Download file 527 Bytes
-
https://huggingface.co/spaces/hisham-cmd/VortexCommerceBackend/resolve/main/compare_jsons.py
- Command line
-
hf download hf://spaces/hisham-cmd/VortexCommerceBackend/compare_jsons.py
-
curl -L -o compare_jsons.py https://huggingface.co/spaces/hisham-cmd/VortexCommerceBackend/resolve/main/compare_jsons.py
527 Bytes
| import json | |
| import os | |
| files = [ | |
| r'c:\react_projects\VortexCommerce\kaggle\extra_products_vortex.json', | |
| r'c:\react_projects\VortexCommerce\backend\kaggle\extra_products_vortex.json' | |
| ] | |
| for f_path in files: | |
| if os.path.exists(f_path): | |
| with open(f_path, "r", encoding="utf-8") as f: | |
| data = json.load(f) | |
| count = len(data["products"]) if isinstance(data, dict) and "products" in data else len(data) | |
| print(f"{f_path}: {count} products") | |
| else: | |
| print(f"{f_path}: NOT FOUND") | |