DB_JOB/작업파일/공공기관3/_napply_final.py
hehihoho3 b0acd1e705 백업: 셀병합 정상화(D~J)+KDHC 옵션2/행높이17, 오늘(06-21) 제출 17곳 검수·압축
- 공공기관2/3 작업본 + 오늘 제출 17곳 D~J 카테고리 셀병합 정상화
- 한국지역난방공사 옵션2(고아셀 F98 수정)+전행 높이17
- 제출_프리랜서2_2026-06-21.zip 생성(17개 xlsx, 2,468행)

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

42 lines
1.7 KiB
Python

# -*- coding: utf-8 -*-
import sys,io,json,copy
sys.stdout=io.TextIOWrapper(sys.stdout.buffer,encoding='utf-8')
import openpyxl
from openpyxl.styles import PatternFill
XL=r'10.한국장애인고용공단\한국장애인고용공단.xlsx'
plan=json.load(open(r'D:\01.프로젝트\DB수집\_temp\nshot_한국장애인고용공단\plan_한국장애인고용공단.json',encoding='utf-8'))
KEEP={3,23,26,72,75,78,132,148,150,155,156,157,158,159,179,186,187}
cand=[p['row'] for p in plan if p['auto'] in ('candidate','어문')]
wb=openpyxl.load_workbook(XL); ws=wb.active
BLUE=PatternFill(start_color='FFBDD7EE',end_color='FFBDD7EE',fill_type='solid')
def order_parts(parts):
seq=['어문','이미지','영상','오디오','글꼴','3D','기타']
return [x for x in seq if x in parts]
changed=0
for r in cand:
cur=ws.cell(r,14).value or ''
parts=set(p for p in cur.replace(' ','').split(',') if p)
if r in KEEP:
continue # keep as-is (has image)
# demote: remove 이미지
if '이미지' in parts:
parts.discard('이미지')
if not parts: parts={'어문'}
new=','.join(order_parts(parts))
if new!=cur:
ws.cell(r,14).value=new
ws.cell(r,14).fill=BLUE
changed+=1
# also mark KEEP rows whose N changed? they didn't. But blue-mark verified keeps? per SOP only changed cells blue.
wb.save(XL)
print('N demoted(이미지 제거):',changed)
# final N dist
from collections import Counter
nc=Counter()
for r in range(3,ws.max_row+1):
if ws.cell(r,2).value is None and not any(ws.cell(r,c).value for c in range(4,11)): continue
L=ws.cell(r,12).value
if L=='사이트': continue
nc[ws.cell(r,14).value]+=1
print('N dist (non-site):',dict(nc))