For AI and researchers
Check the archive files yourself: verify_archive.py
Added December 1, 2026 (Release GAP18). This is a new page. It does not change any earlier page on this site.
What it does
- It downloads the AI data manifest (the list of data files with their SHA-256).
- It downloads each listed file (or reads your own copy) and computes its SHA-256.
- It prints every file whose bytes differ from the list, and a count at the end.
- It uses only the Python standard library. It only downloads; it uploads nothing and changes nothing.
How to run it
Download verify_archive.py (SHA-256 efc674ae2acdaeab934d066e121bf24c3cdd4e3d92b0f9011f5e78202eb034dc), then in a terminal:
python verify_archive.py --only datasets/ python verify_archive.py python verify_archive.py --dir FOLDER
The first line checks the data files only (a few minutes). The second checks every listed file, including large PDFs. The third checks copies you already downloaded, kept under their listed paths.
How to read the result
- Match: the bytes are the ones listed. That is all a hash proves. It does not prove that a record is true, complete or the whole story. A filing is not a finding.
- Mismatch: the manifest lists the bytes of its last refresh. A file that got a dated addition later has new bytes until the manifest is refreshed again. The manifest's dated update notes (keys ending in
_update_2026_12_01) name the files each release re-hashed. - Missing: the file could not be downloaded or found in your folder.
- A plain data address that is served from its compressed .gz copy is checked after unpacking.
Test before publishing (December 1, 2026, on the files being published): 3533 listed files, 3528 match, 5 mismatch, 0 missing. The mismatches were files other releases changed after their entries were last hashed.
The whole script
#!/usr/bin/env python3
"""verify_archive.py - check files from www.david-medeiros.com against the site's AI data manifest (SHA-256).
Added December 1, 2026 (Release GAP18). Python 3, standard library only.
python verify_archive.py download every listed file and check it
python verify_archive.py --only datasets/ check only paths that start with this text
python verify_archive.py --dir FOLDER check copies you already have (FOLDER/<path as listed>)
A match proves only that the bytes are the ones listed. It does not prove that a record is true.
A filing is not a finding."""
import argparse, gzip, hashlib, json, os, sys, urllib.request
MANIFEST = 'https://www.david-medeiros.com/for-ai/manifest.json'
def get(url):
req = urllib.request.Request(url, headers={'User-Agent': 'verify_archive.py'})
with urllib.request.urlopen(req, timeout=120) as r:
return r.read()
def main():
ap = argparse.ArgumentParser(description='Check archive files against the AI data manifest.')
ap.add_argument('--manifest', default=MANIFEST, help='manifest URL or local file')
ap.add_argument('--dir', help='folder with files you already downloaded')
ap.add_argument('--only', default='', help='check only paths that start with this text')
a = ap.parse_args()
raw = get(a.manifest) if a.manifest.startswith('http') else open(a.manifest, 'rb').read()
files = json.loads(raw.decode('utf-8-sig'))['files']
ok = bad = missing = 0
for f in files:
if not f['path'].startswith(a.only):
continue
try:
data = open(os.path.join(a.dir, *f['path'].split('/')), 'rb').read() if a.dir else get(f['url'])
except Exception as e:
missing += 1
print('MISSING ', f['path'], '-', e)
continue
h = hashlib.sha256(data).hexdigest()
if h != f['sha256'] and data[:2] == b'\x1f\x8b': # a plain address that is served from its .gz copy
h = hashlib.sha256(gzip.decompress(data)).hexdigest()
if h == f['sha256']:
ok += 1
else:
bad += 1
print('MISMATCH', f['path'], 'listed', f['sha256'], 'got', h)
print('checked %d: %d match, %d mismatch, %d missing' % (ok + bad + missing, ok, bad, missing))
sys.exit(1 if bad or missing else 0)
if __name__ == '__main__':
main()