DB_JOB/작업파일/완료/광역_사이트맵/충청남도/9.서천군/_verify3.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

30 lines
1.4 KiB
Python

# -*- coding: utf-8 -*-
import openpyxl, sys
from openpyxl.utils import get_column_letter
sys.stdout.reconfigure(encoding='utf-8')
new=openpyxl.load_workbook('_충청남도_서천군_NEW.xlsx').active
def show(r):
vals=[]
for c in range(2,16):
v=new.cell(r,c).value
if v is not None: vals.append(f'{get_column_letter(c)}={str(v)[:14]}')
print(f'R{r:>3} '+' | '.join(vals))
# 문화체육과 group (6 tabs incl bbs)
for r in range(3,new.max_row+1):
if new.cell(r,6).value=='문화체육과':
print('=== 문화체육과 ===');
for k in range(r,r+6): show(k)
break
# F-merge of 민원편의시책
fm=[str(m) for m in new.merged_cells.ranges if m.min_col==6 and any(new.cell(m.min_row,6).value=='민원편의시책' for _ in [0])]
print('민원편의시책 F-merge:', [str(m) for m in new.merged_cells.ranges if m.min_col==6 and new.cell(m.min_row,6).value=='민원편의시책'])
# last 5 data rows
print('=== last 5 rows ===')
for r in range(new.max_row-4, new.max_row+1): show(r)
# any fully-empty data rows?
empty=[r for r in range(3,new.max_row+1) if all(new.cell(r,c).value is None for c in range(2,28))]
print('fully empty data rows:', empty)
# bbs M=0 vs >0 among new
mzero=sum(1 for r in range(3,new.max_row+1) if new.cell(r,12).value=='게시판' and new.cell(r,13).value==0)
print('게시판 rows with M=0:', mzero, '/ total 게시판', sum(1 for r in range(3,new.max_row+1) if new.cell(r,12).value=='게시판'))