import json
from pathlib import Path

base = Path(__file__).parent
infile = base / "add_category_data.json"
outfile = base / "categories_with_prefixes.json"

data = json.loads(infile.read_text(encoding='utf-8'))
items = data.get('category', [])
new = []
for it in items:
    desc = it.get('description', '')
    new.append({
        'category': desc,
        'roundNumber': 1,
        'diaperPrefix': "",
        'dumpsterPrefix': ""
    })

outfile.write_text(json.dumps(new, ensure_ascii=False, indent=2), encoding='utf-8')
print(f'Wrote {len(new)} items to {outfile}')
