Files
online_sys/frontend_财经商贸/extract_resume_data.py
KQL a7242f0c69 Initial commit: 教务系统在线平台
- 包含4个产业方向的前端项目:智能开发、智能制造、大健康、财经商贸
- 已清理node_modules、.yoyo等大文件,项目大小从2.6GB优化至631MB
- 配置完善的.gitignore文件

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-12 18:16:55 +08:00

62 lines
2.3 KiB
Python

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
import os
def extract_position_data(position_names):
"""从JSON文件中提取指定岗位的数据"""
result = {}
# 读取所有part文件
for i in range(1, 4):
file_path = f'/Users/apple/Documents/cursor/教务系统/frontend/网页未导入数据/文旅产业/个人简历内容_part{i}.json'
try:
with open(file_path, 'r', encoding='utf-8') as f:
data = json.load(f)
for item in data:
position = item.get('❌岗位名称查询', '')
if position in position_names:
result[position] = item
print(f"找到: {position} in part{i}")
except Exception as e:
print(f"Error reading part{i}: {e}")
# 也读取主文件
main_file = '/Users/apple/Documents/cursor/教务系统/frontend/网页未导入数据/文旅产业/个人简历内容.json'
try:
with open(main_file, 'r', encoding='utf-8') as f:
data = json.load(f)
for item in data:
position = item.get('❌岗位名称查询', '')
if position in position_names and position not in result:
result[position] = item
print(f"找到: {position} in main file")
except Exception as e:
print(f"Error reading main file: {e}")
return result
# 需要提取的岗位
positions_to_extract = [
'露营地运营专员',
'文创产品设计师', '文创产品策划师', '文创产品设计师助理',
'品牌策划运营专员', '品牌公关', '品牌推广专员',
'ip运营', 'IP运营总监助理', '品牌公关管培生'
]
# 提取数据
extracted_data = extract_position_data(positions_to_extract)
# 保存提取的数据
output_file = '/Users/apple/Documents/cursor/教务系统/frontend/extracted_resume_data.json'
with open(output_file, 'w', encoding='utf-8') as f:
json.dump(extracted_data, f, ensure_ascii=False, indent=2)
print(f"\n成功提取 {len(extracted_data)} 个岗位的数据")
print(f"已保存到: {output_file}")
# 显示缺失的岗位
missing = set(positions_to_extract) - set(extracted_data.keys())
if missing:
print(f"\n未找到的岗位: {missing}")