- 공공기관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>
18 lines
834 B
Python
18 lines
834 B
Python
# -*- coding: utf-8 -*-
|
|
import json
|
|
tree=json.load(open('_gnb_tree.json',encoding='utf-8'))
|
|
gnb=[]
|
|
for t in tree:
|
|
gnb.append({'depth':1,'label':t['t'].strip(),'href':t['h']})
|
|
for m in t['mids']:
|
|
gnb.append({'depth':2,'label':m['t'].strip(),'href':m['h']})
|
|
for l in m['leaves']:
|
|
gnb.append({'depth':3,'label':l['t'].strip(),'href':l['h']})
|
|
out={'num':3,'name':'한국조세재정연구원','base':'https://www.kipf.re.kr/kor/','gnb':gnb}
|
|
import os
|
|
os.makedirs(r'D:\01.프로젝트\DB수집\작업파일\공공기관2\_gnb',exist_ok=True)
|
|
json.dump(out,open(r'D:\01.프로젝트\DB수집\작업파일\공공기관2\_gnb\3.json','w',encoding='utf-8'),ensure_ascii=False,indent=1)
|
|
print('gnb rows:',len(gnb))
|
|
from collections import Counter
|
|
print('depth분포:',dict(Counter(g['depth'] for g in gnb)))
|