Branchwell

PulseCanvas / app · pulsecanvas.ai / scripts / store-asset-inventory.py

Raw 972 B on 23ffa4e102ea595ec83f2b18683b75332fc815c3
1#!/usr/bin/env python3
2"""Generate release-matched asset hashes and upstream credits, without inventing grants."""
3import csv,hashlib,json,pathlib
4root=pathlib.Path('Sources/PulseCanvas/Resources/ProjectM');out=pathlib.Path('build/app-store');out.mkdir(parents=True,exist_ok=True)
5presets=json.loads((root/'catalog.json').read_text())
6with (out/'asset-rights-inventory.csv').open('w') as f:
7 w=csv.writer(f);w.writerow(['kind','path','creator_title','sha256','rights_status'])
8 for a in presets:
9 p=root/'Presets'/a['path'];w.writerow(['preset',a['path'],a.get('originalTitle',''),hashlib.sha256(p.read_bytes()).hexdigest(),'upstream public-domain assumption; affirmative grants unresolved'])
10 for p in sorted((root/'Textures').rglob('*')):
11 if p.is_file():w.writerow(['texture',str(p.relative_to(root)),'see pack README',hashlib.sha256(p.read_bytes()).hexdigest(),'individual grants unresolved'])
12print('Wrote',len(presets),'preset hashes and texture provenance rows')