20260122
This commit is contained in:
1 parent
72a94b8de3
commit
262b081f94
6 files changed
+958
-650
No files matched your search
+50
-130
@@ -74,16 +74,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
"execution_count": null,
|
||||
"id": "d8abca28-6e1f-4f0a-a715-c1697cdf3f6a",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2025-04-04T12:09:07.760344Z",
|
||||
"iopub.status.busy": "2025-04-04T12:09:07.759806Z",
|
||||
"iopub.status.idle": "2025-04-04T12:09:08.370898Z",
|
||||
"shell.execute_reply": "2025-04-04T12:09:08.369913Z",
|
||||
"shell.execute_reply.started": "2025-04-04T12:09:07.760298Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
@@ -114,17 +107,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
"execution_count": null,
|
||||
"id": "62ff063a-5380-4e08-b115-acd967441ca4",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2025-09-17T00:08:50.471131Z",
|
||||
"iopub.status.busy": "2025-09-17T00:08:50.470548Z",
|
||||
"iopub.status.idle": "2025-09-17T00:08:51.110490Z",
|
||||
"shell.execute_reply": "2025-09-17T00:08:51.109925Z",
|
||||
"shell.execute_reply.started": "2025-09-17T00:08:50.471076Z"
|
||||
}
|
||||
},
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import os,sys,shutil\n",
|
||||
@@ -1270,49 +1255,12 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 5,
|
||||
"execution_count": null,
|
||||
"id": "2f9f474d-265c-4beb-bd0e-53372ae9e57e",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2025-12-03T04:26:40.331997Z",
|
||||
"iopub.status.busy": "2025-12-03T04:26:40.331341Z",
|
||||
"iopub.status.idle": "2025-12-03T04:26:41.149586Z",
|
||||
"shell.execute_reply": "2025-12-03T04:26:41.149140Z",
|
||||
"shell.execute_reply.started": "2025-12-03T04:26:40.331947Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"<>:51: SyntaxWarning: invalid escape sequence '\\s'\n",
|
||||
"<>:51: SyntaxWarning: invalid escape sequence '\\s'\n",
|
||||
"/tmp/ipykernel_1730998/3799497539.py:51: SyntaxWarning: invalid escape sequence '\\s'\n",
|
||||
" data =[re.sub('\\s+', '', cell) if cell is not None else None for cell in row]\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"['姓名', '邵希强']\n",
|
||||
"['性别', '男']\n",
|
||||
"['测试标准', '国民体质测定标准']\n",
|
||||
"['身高体重指数', '26.02', '60分']\n",
|
||||
"['握力', '33.5千克', '50分']\n",
|
||||
"['肺活量', '3050毫升', '70分']\n",
|
||||
"['选择反应时', '0.572秒', '75分']\n",
|
||||
"['指标', '您的结果', '亚洲男性平均值']\n",
|
||||
"['臀围', '100', '88.82']\n",
|
||||
"['身高腰围指数', '53.19', '42.79']\n",
|
||||
"['建议类别', '建议项']\n",
|
||||
"['增加摄入', '豆类、水果、蔬菜、坚果类、蛋类、菌类、乳制品、肉类']\n",
|
||||
"['生活习惯', '提高睡眠质量、保持心情舒畅、换季时避开感染源、减少用眼']\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import pdfplumber\n",
|
||||
"import json\n",
|
||||
@@ -1384,33 +1332,12 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 13,
|
||||
"execution_count": null,
|
||||
"id": "b0764366-12cf-4880-8e0f-9ae18b46d392",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2025-12-03T05:52:34.403674Z",
|
||||
"iopub.status.busy": "2025-12-03T05:52:34.402297Z",
|
||||
"iopub.status.idle": "2025-12-03T05:52:34.532929Z",
|
||||
"shell.execute_reply": "2025-12-03T05:52:34.532427Z",
|
||||
"shell.execute_reply.started": "2025-12-03T05:52:34.403605Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"[['姓名', '邵希强']]\n",
|
||||
"[['性别', '男']]\n",
|
||||
"[['测试标准', '国民体质测定标准']]\n",
|
||||
"[['身高体重指数', '26.02', '60分']]\n",
|
||||
"[['握力', '33.5 千克', '50分']]\n",
|
||||
"[['肺活量', '3050 毫升', '70分']]\n",
|
||||
"[['选择反应时', '0.572 秒', '75分']]\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import pdfplumber\n",
|
||||
"name = 'file/01730823-邵希强.pdf'\n",
|
||||
@@ -1424,36 +1351,10 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 31,
|
||||
"execution_count": null,
|
||||
"id": "04dd6436-8374-4096-a2a3-d79f4d93a360",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2025-12-04T01:29:08.571756Z",
|
||||
"iopub.status.busy": "2025-12-04T01:29:08.571003Z",
|
||||
"iopub.status.idle": "2025-12-04T01:29:08.644466Z",
|
||||
"shell.execute_reply": "2025-12-04T01:29:08.643884Z",
|
||||
"shell.execute_reply.started": "2025-12-04T01:29:08.571687Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"['北体乾元健康管理中心', '姓名 邵希强', '中石化(天津)石油化工 编号 01730823', '有限公司 性别 男', '年龄 53', '国民体质检测结果与健康处方', '肺活量', '握力 身高体重指数', '坐位体前屈 选择反应时', '纵跳 闭眼单脚站立', '俯卧撑', '测试标准 国民体质测定标准', '闭眼单脚站立 2.8 秒 10分', '身高体重指数 26.02 60分', '坐位体前屈 13.5 厘米 90分', '握力 33.5 千克 50分', '纵跳 18.0 厘米 30分', '肺活量 3050 毫升 70分', '俯卧撑 5 次 50分', '选择反应时 0.572 秒 75分', '腰臀比 0.90 正常', '请注意:以上测试项目及格线为3分。列表中红色项目需重点关注,建议在专家指导下进行科学锻炼,', '减少潜在的运动风险。', '感谢您完成测试,以《国民体质测定标准》综合评级,您的总分为58分,等级为四级(不合格)。', '(其中项目纵跳因超出年龄范围得分仅供参考,不计入总分)', '北体乾元体质监测报告']\n",
|
||||
"11 21\n",
|
||||
"闭眼单脚站立\n",
|
||||
"身高体重指数\n",
|
||||
"坐位体前屈\n",
|
||||
"握力\n",
|
||||
"纵跳\n",
|
||||
"肺活量\n",
|
||||
"俯卧撑\n",
|
||||
"选择反应时\n",
|
||||
"腰臀比\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import pdfplumber\n",
|
||||
"name = 'file/03499391-宋文路.pdf'\n",
|
||||
@@ -1474,27 +1375,10 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 35,
|
||||
"execution_count": null,
|
||||
"id": "ac034bf9-cba9-4a72-87ba-d77721cc7097",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2025-12-08T01:54:24.900658Z",
|
||||
"iopub.status.busy": "2025-12-08T01:54:24.900121Z",
|
||||
"iopub.status.idle": "2025-12-08T01:54:24.960757Z",
|
||||
"shell.execute_reply": "2025-12-08T01:54:24.960174Z",
|
||||
"shell.execute_reply.started": "2025-12-08T01:54:24.900608Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"['北体乾元健康管理中心', '姓名 宋文路', '中石化(天津)石油化工 编号 03499391', '有限公司 性别 男', '年龄 26', '国民体质检测结果与健康处方', '握力', '纵跳 身高体重指数', '选择反应时', '测试标准 国民体质测定标准', '身高体重指数 33.68 20分', '握力 38.6 千克 55分', '纵跳 22.8 厘米 30分', '选择反应时 0.466 秒 90分', '腰臀比 0.95 正常', '请注意:以上测试项目及格线为60分。列表中红色项目需重点关注,建议在专家指导下进行科学锻炼,', '减少潜在的运动风险。', '感谢您完成测试,因为您未完成肺活量、台阶指数、俯卧撑、1分钟仰卧起坐、坐位体前屈、闭眼单脚', '站立,无法以《国民体质测定标准》综合评级,改为以平均分作为综合评级参考。您的平均得分为53,等级', '为四级(不合格),仅供参考。', '北体乾元体质监测报告']\n",
|
||||
"感谢您完成测试,因为您未完成肺活量、台阶指数、俯卧撑、1分钟仰卧起坐、坐位体前屈、闭眼单脚站立,无法以《国民体质测定标准》综合评级,改为以平均分作为综合评级参考。您的平均得分为53,等级为四级(不合格),仅供参考。北体乾元体质监测报告\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import pdfplumber\n",
|
||||
"name = 'file/03499391-宋文路.pdf'\n",
|
||||
@@ -1510,10 +1394,46 @@
|
||||
" print(ss)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "26623725-92da-48d9-a476-78a1befd06ef",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 合并PDF文件"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 12,
|
||||
"id": "9b37b17e-66d3-4acc-8edb-760ea17123b4",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2026-01-17T11:13:57.369456Z",
|
||||
"iopub.status.busy": "2026-01-17T11:13:57.368880Z",
|
||||
"iopub.status.idle": "2026-01-17T11:13:59.005588Z",
|
||||
"shell.execute_reply": "2026-01-17T11:13:59.004975Z",
|
||||
"shell.execute_reply.started": "2026-01-17T11:13:57.369401Z"
|
||||
}
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from pypdf import PdfWriter\n",
|
||||
"import glob\n",
|
||||
"\n",
|
||||
"fi_path = 'file/2025/'\n",
|
||||
"fls = glob.glob(f'{fi_path}*.pdf')\n",
|
||||
"fls.sort()\n",
|
||||
"merger = PdfWriter()\n",
|
||||
"for pdf in fls:\n",
|
||||
" merger.append(pdf)\n",
|
||||
"merger.write(\"file/2025年明细账.pdf\")\n",
|
||||
"merger.close()\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "41177ae9-d7ae-45c2-90b5-94578699215e",
|
||||
"id": "6d5c9dd3-bd09-49b3-8a22-07bb4440aace",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
|
||||
Reference in new issue
Block a user