# List the JSON files in a ChatGPT export ZIP with their sizes.
# It reads only the ZIP's table of contents, so it is instant even on a huge export.
# Run: python check_export.py your-export.zip
import sys
import zipfile

with zipfile.ZipFile(sys.argv[1]) as z:
    for info in sorted(z.infolist(), key=lambda i: i.filename):
        if info.filename.lower().endswith(".json"):
            print(f"{info.file_size:>15,} bytes  {info.filename}")
