PulseCanvas / app · pulsecanvas.ai / scripts / store-asset-inventory.py
| 1 | #!/usr/bin/env python3 |
| 2 | """Generate release-matched asset hashes and upstream credits, without inventing grants.""" |
| 3 | import csv,hashlib,json,pathlib |
| 4 | root=pathlib.Path('Sources/PulseCanvas/Resources/ProjectM');out=pathlib.Path('build/app-store');out.mkdir(parents=True,exist_ok=True) |
| 5 | presets=json.loads((root/'catalog.json').read_text()) |
| 6 | with (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']) |
| 12 | print('Wrote',len(presets),'preset hashes and texture provenance rows') |