DB_JOB/작업파일/완료/광역_사이트맵/전북특별자치도/8.완주군/_applyC.py
hehihoho3 df16c98366 백업: DB수집 전체 스냅샷 (공공기관2 정리 전)
공공기관2 작업 중. _temp 몽타주(재생성가능)는 제외.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 18:15:40 +09:00

25 lines
989 B
Python

# -*- coding: utf-8 -*-
import json, openpyxl, sys
sys.stdout.reconfigure(encoding='utf-8')
F='전북특별자치도_완주군.xlsx'
d=json.load(open('_ncrawlC.json',encoding='utf-8'))
KEEP={378,382,383,385,494,495,496,498,502,503,524,541,555,574,575,576,593,594}
wb=openpyxl.load_workbook(F); ws=wb.active
ch=0; pimg=0; pkeep=0; brd=0; non=0
for r,v in d.items():
r=int(r)
if r<335: continue
L=v['L']; det=v['det']; old=ws.cell(r,14).value
if L=='페이지':
new='어문' if r in KEEP else det
if r in KEEP and det=='어문,이미지': pkeep+=1
else:
new=det
if (new or '')!=(old or ''):
ws.cell(r,14).value=new; ch+=1
if L=='페이지' and new=='어문,이미지': pimg+=1
elif L=='게시판' and new=='어문,이미지': brd+=1
elif new=='없음': non+=1
wb.save(F)
print('N변경 %d | 페이지→이미지 %d | 페이지어문유지 %d | 게시판→이미지 %d | →없음 %d'%(ch,pimg,pkeep,brd,non))