extract_artifacts.py

back to table · edit · history · where entries came from · files · download

384 bytes, as of the version from 2026-12-02 04:01 (current). Recorded here, not run.

import pathlib,json,os,sys
w=pathlib.Path(os.environ['NUMBERDB_WORKDIR'])
source=w/(sys.argv[1] if len(sys.argv)>1 else 'primary-run-v2.log')
n=0
for line in source.read_text().splitlines():
    if line.startswith('ARTIFACT '):
        _,name,data=line.split(' ',2);obj=json.loads(data)
        (w/name).write_text(json.dumps(obj,indent=2)+'\n');n+=1
print('Extracted',n,'artifacts')