Update README and project cleanup

This commit is contained in:
inkling
2026-04-08 14:52:09 +08:00
commit fafd267288
71 changed files with 14865 additions and 0 deletions

69
check_excel.py Normal file
View File

@@ -0,0 +1,69 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import openpyxl
wb = openpyxl.load_workbook('家庭教育档案-天数.xlsx')
ws = wb.active
print('✓ 所有表头列表')
print('=' * 80)
for i in range(1, ws.max_column + 1):
cell = ws.cell(1, i)
col_letter = chr(64 + i) if i <= 26 else chr(64 + i // 26) + chr(64 + i % 26)
print(f'{i:2d} ({col_letter:2s}): {cell.value}')
print('\n' + '=' * 80)
print('✓ C列家庭角色全部唯一值')
print('=' * 80)
c_values = {}
for row in range(2, ws.max_row + 1):
val = str(ws[f'C{row}'].value).strip() if ws[f'C{row}'].value else ''
if val:
c_values[val] = c_values.get(val, 0) + 1
for val, count in sorted(c_values.items()):
print(f' {val:15s} (出现 {count:3d} 次)')
print('\n' + '=' * 80)
print('✓ D列文化程度全部唯一值')
print('=' * 80)
d_values = {}
for row in range(2, ws.max_row + 1):
val = str(ws[f'D{row}'].value).strip() if ws[f'D{row}'].value else ''
if val:
d_values[val] = d_values.get(val, 0) + 1
for val, count in sorted(d_values.items()):
print(f' {val:20s} (出现 {count:3d} 次)')
print('\n' + '=' * 80)
print('✓ U列孩子学习成绩全部唯一值')
print('=' * 80)
u_values = {}
for row in range(2, ws.max_row + 1):
val = str(ws[f'U{row}'].value).strip() if ws[f'U{row}'].value else ''
if val:
u_values[val] = u_values.get(val, 0) + 1
for val, count in sorted(u_values.items()):
print(f' {val:15s} (出现 {count:3d} 次)')
print('\n' + '=' * 80)
print('✓ 寻找性格/特征相关列...')
print('=' * 80)
found = False
for i in range(1, ws.max_column + 1):
header = str(ws.cell(1, i).value).lower() if ws.cell(1, i).value else ''
if '性格' in header or '特征' in header or '个性' in header or '性质' in header:
col_letter = chr(64 + i) if i <= 26 else chr(64 + i // 26) + chr(64 + i % 26)
print(f'✓ 找到Column {i} ({col_letter}): {ws.cell(1, i).value}')
# 取样
values = {}
for row in range(2, min(100, ws.max_row + 1)):
val = str(ws[f'{col_letter}{row}'].value).strip() if ws[f'{col_letter}{row}'].value else ''
if val:
values[val] = values.get(val, 0) + 1
for val, count in sorted(values.items()):
print(f' {val:30s} (出现 {count:3d} 次)')
found = True
if not found:
print('✗ 未找到明确的性格/特征列')
print('请检查以下可能的列...')