This commit is contained in:
512song committed 2024-06-09 23:51:24 +08:00
1 parent 94984bf7a6
commit 76487f10e8
4 files changed
+3971 -253

No files matched your search

+61 -39
View File
@@ -280,15 +280,15 @@
},
{
"cell_type": "code",
"execution_count": 103,
"execution_count": 7,
"id": "3e614f4a-a623-48e2-97f8-b31f62c9a983",
"metadata": {
"execution": {
"iopub.execute_input": "2024-03-21T07:32:21.775359Z",
"iopub.status.busy": "2024-03-21T07:32:21.774903Z",
"iopub.status.idle": "2024-03-21T07:32:21.809322Z",
"shell.execute_reply": "2024-03-21T07:32:21.808037Z",
"shell.execute_reply.started": "2024-03-21T07:32:21.775322Z"
"iopub.execute_input": "2024-06-05T08:38:54.344213Z",
"iopub.status.busy": "2024-06-05T08:38:54.343465Z",
"iopub.status.idle": "2024-06-05T08:38:54.410170Z",
"shell.execute_reply": "2024-06-05T08:38:54.409619Z",
"shell.execute_reply.started": "2024-06-05T08:38:54.344132Z"
},
"tags": []
},
@@ -297,8 +297,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"74\n",
"74\n"
"709\n",
"709\n"
]
}
],
@@ -331,11 +331,11 @@
"re_ta = {}\n",
"dict1 = {}\n",
"list1 = []\n",
"filename = 'data/东营老年大学.json'\n",
"filename = 'data/中安联合.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"\n",
"filename = 'data/places_result_20240321.csv'\n",
"filename = 'data/places_result_20240605.csv'\n",
"with open(filename,'r',newline='') as csv_file:\n",
" fl = csv.reader(csv_file,delimiter=',')\n",
" header = next(fl) \n",
@@ -376,7 +376,7 @@
" score = int(result[4])/item[m_item]['divisor'] \n",
" re_ta[user][item_name]['成绩'] = f'{score} {item[m_item][\"unit\"]}'\n",
"print(len(re_ta))\n",
"filename = 'data/result_东营老年大学.json'\n",
"filename = 'data/result_中安联合.json'\n",
"\n",
"with open(filename,'w') as fl:\n",
" json.dump(re_ta, fl, ensure_ascii=False) \n",
@@ -393,15 +393,15 @@
},
{
"cell_type": "code",
"execution_count": 105,
"execution_count": 8,
"id": "141b30dc-5975-4dcb-9bc3-9b20d26a0917",
"metadata": {
"execution": {
"iopub.execute_input": "2024-03-21T08:42:07.845829Z",
"iopub.status.busy": "2024-03-21T08:42:07.845385Z",
"iopub.status.idle": "2024-03-21T08:42:07.884449Z",
"shell.execute_reply": "2024-03-21T08:42:07.883406Z",
"shell.execute_reply.started": "2024-03-21T08:42:07.845792Z"
"iopub.execute_input": "2024-06-05T08:39:59.079134Z",
"iopub.status.busy": "2024-06-05T08:39:59.078630Z",
"iopub.status.idle": "2024-06-05T08:39:59.141794Z",
"shell.execute_reply": "2024-06-05T08:39:59.141195Z",
"shell.execute_reply.started": "2024-06-05T08:39:59.079087Z"
},
"tags": []
},
@@ -511,7 +511,7 @@
"\n",
"#list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp','height','weight']\n",
"list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp']\n",
"filename = 'data/result_东营老年大学.json'\n",
"filename = 'data/result_中安联合.json'\n",
"with open(filename,'r') as fl:\n",
" dict2 = json.load(fl) \n",
"for k, v in dict2.items():\n",
@@ -532,7 +532,7 @@
" dict2[k][item_en]['score'] = cal_score(data1)\n",
" #print(k,v[item_en]['成绩'],cal_score(data1))\n",
"\n",
"filename = f'data/result_东营老年大学.json'\n",
"filename = f'data/result_中安联合.json'\n",
"with open(filename,'w') as fl:\n",
" json.dump(dict2,fl , ensure_ascii=False) \n",
"print('ok!') "
@@ -695,15 +695,15 @@
},
{
"cell_type": "code",
"execution_count": 108,
"execution_count": 10,
"id": "b123ee6b-85d2-4660-b226-321832a6b796",
"metadata": {
"execution": {
"iopub.execute_input": "2024-03-21T08:46:57.703552Z",
"iopub.status.busy": "2024-03-21T08:46:57.703093Z",
"iopub.status.idle": "2024-03-21T08:47:18.057243Z",
"shell.execute_reply": "2024-03-21T08:47:18.056037Z",
"shell.execute_reply.started": "2024-03-21T08:46:57.703496Z"
"iopub.execute_input": "2024-06-05T08:52:25.451985Z",
"iopub.status.busy": "2024-06-05T08:52:25.451119Z",
"iopub.status.idle": "2024-06-05T08:58:26.399739Z",
"shell.execute_reply": "2024-06-05T08:58:26.398553Z",
"shell.execute_reply.started": "2024-06-05T08:52:25.451918Z"
},
"tags": []
},
@@ -712,7 +712,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"62\n"
"709\n"
]
}
],
@@ -725,11 +725,11 @@
"headers = {\n",
" \"Content-Type\": \"application/json; charset=UTF-8\"\n",
" }\n",
"filename = 'data/result_东营老年大学1.json'\n",
"filename = 'data/result_中安联合.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"list1 = []\n",
"file_path ='./东营老年大学/'\n",
"file_path ='./中安联合/'\n",
"list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp','bmi']\n",
"i=0\n",
"list2 = []\n",
@@ -739,7 +739,7 @@
" \n",
" id = str(k).rjust(4,\"0\")\n",
" mydata['path'] = file_path+id+'-'+ v['name']+'.pdf'\n",
" mydata['title'] = '体质监测报告样本'\n",
" mydata['title'] = '中安联合公司'\n",
" mydata['subtitle'] = v['unit']\n",
" mydata['id'] = id\n",
" mydata['name'] = v['name']\n",
@@ -788,9 +788,16 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 11,
"id": "d913a531-51b3-4795-adc3-f4fc858d7401",
"metadata": {
"execution": {
"iopub.execute_input": "2024-06-06T03:56:47.359615Z",
"iopub.status.busy": "2024-06-06T03:56:47.359270Z",
"iopub.status.idle": "2024-06-06T03:56:47.566463Z",
"shell.execute_reply": "2024-06-06T03:56:47.565918Z",
"shell.execute_reply.started": "2024-06-06T03:56:47.359581Z"
},
"tags": []
},
"outputs": [],
@@ -800,12 +807,12 @@
"import glob\n",
"from pathlib import Path\n",
"\n",
"fi_path = '/home/songyi/pdf-typescript/北海炼化2023'\n",
"new_path = 'file/北海炼化2023'\n",
"fi_path = '/home/songyi/pdf-typescript/中安联合'\n",
"new_path = 'file/中安联合'\n",
"old = []\n",
"dict2 = {}\n",
"\n",
"filename = 'data/北海炼化2023年.json'\n",
"filename = 'data/中安联合.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"fls = glob.glob(f'{fi_path}/*.pdf')\n",
@@ -829,12 +836,27 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 12,
"id": "02319955-7fb6-4791-ae45-55b03bdadd54",
"metadata": {
"execution": {
"iopub.execute_input": "2024-06-06T04:05:48.101908Z",
"iopub.status.busy": "2024-06-06T04:05:48.101136Z",
"iopub.status.idle": "2024-06-06T04:05:48.165587Z",
"shell.execute_reply": "2024-06-06T04:05:48.165042Z",
"shell.execute_reply.started": "2024-06-06T04:05:48.101837Z"
},
"tags": []
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ok\n"
]
}
],
"source": [
"import os,sys,shutil\n",
"import json\n",
@@ -842,9 +864,9 @@
"from pathlib import Path\n",
"import openpyxl\n",
"\n",
"fi_path = '/home/songyi/pdf-typescript/北海炼化2023'\n",
"fi_path = '/home/songyi/pdf-typescript/中安联合'\n",
"\n",
"filename = 'data/北海炼化2023年.json'\n",
"filename = 'data/中安联合.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"fls = glob.glob(f'{fi_path}/*.pdf')\n",
@@ -860,7 +882,7 @@
" \n",
" list1.append(list2)\n",
"\n",
"filename = 'data/北海炼化体测报告打印明细表.xlsx'\n",
"filename = 'data/中安联合体测报告明细表.xlsx'\n",
"wb = openpyxl.Workbook()\n",
"sheet = wb.active\n",
"sheet.append(title)\n",
@@ -2047,7 +2069,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.12.3"
}
},
"nbformat": 4,