2024-11-01 17:33:48 +08:00
{
"cells": [
{
"cell_type": "code",
2025-01-08 14:43:47 +08:00
"execution_count": 3,
2024-11-01 17:33:48 +08:00
"metadata": {},
"outputs": [],
"source": [
"import requests\n",
"import json\n",
"import xlrd\n",
"import xlwt\n",
"from datetime import datetime, timedelta \n",
"import time\n",
"import pandas as pd\n",
"import numpy as np\n",
"# 变量定义\n",
"login_url = \"http://10.200.32.39/jingbo-api/api/server/login\"\n",
"search_url = \"http://10.200.32.39/jingbo-api/api/warehouse/dwDataItem/queryByItemNos\"\n",
"\n",
"login_push_url = \"http://10.200.32.39/jingbo-api/api/server/login\"\n",
"upload_url = \"http://10.200.32.39/jingbo-api/api/dw/dataValue/pushDataValueList\"\n",
"\n",
"login_data = {\n",
" \"data\": {\n",
" \"account\": \"api_dev\",\n",
" \"password\": \"ZTEwYWRjMzk0OWJhNTlhYmJlNTZlMDU3ZjIwZjg4M2U=\",\n",
" \"tenantHashCode\": \"8a4577dbd919675758d57999a1e891fe\",\n",
" \"terminal\": \"API\"\n",
" },\n",
" \"funcModule\": \"API\",\n",
" \"funcOperation\": \"获取token\"\n",
"}\n",
"\n",
"login_push_data = {\n",
" \"data\": {\n",
" \"account\": \"api_dev\",\n",
" \"password\": \"ZTEwYWRjMzk0OWJhNTlhYmJlNTZlMDU3ZjIwZjg4M2U=\",\n",
" \"tenantHashCode\": \"8a4577dbd919675758d57999a1e891fe\",\n",
" \"terminal\": \"API\"\n",
" },\n",
" \"funcModule\": \"API\",\n",
" \"funcOperation\": \"获取token\"\n",
"}\n",
"\n",
"read_file_path_name = \"定性模型数据项12-11.xls\"\n",
"one_cols = []\n",
"two_cols = []\n",
"\n",
"\n",
"\n",
"\n",
"def start(date=''):\n",
" workbook = xlrd.open_workbook(read_file_path_name)\n",
"\n",
"\n",
"\n",
" # 选择第一个表格\n",
" sheet = workbook.sheet_by_index(0)\n",
"\n",
" # 获取行数和列数\n",
" num_rows = sheet.nrows\n",
"\n",
"\n",
"\n",
" row_data = sheet.row_values(1)\n",
" one_cols = row_data\n",
"\n",
"\n",
" login_res = requests.post(url=login_url, json=login_data, timeout=(3, 5))\n",
" text = json.loads(login_res.text)\n",
" if text[\"status\"]:\n",
" token = text[\"data\"][\"accessToken\"]\n",
" else:\n",
" print(\"获取认证失败\")\n",
" token = None\n",
"\n",
" if date == '':\n",
" now = datetime.now()\n",
" else:\n",
" now = date\n",
" year = now.year\n",
" month = now.month\n",
" day = now.day\n",
"\n",
" if month < 10:\n",
" month = \"0\" + str(month)\n",
" if day < 10:\n",
" day = \"0\" + str(day)\n",
" cur_time = str(year) + str(month) + str(day)\n",
" cur_time2 = str(year) + \"-\" + str(month) + \"-\" + str(day)\n",
" search_data = {\n",
" \"data\": {\n",
" \"date\": cur_time,\n",
" \"dataItemNoList\": one_cols[1:]\n",
" },\n",
" \"funcModule\": \"数据项\",\n",
" \"funcOperation\": \"查询\"\n",
" }\n",
" headers = {\"Authorization\": token}\n",
" search_res = requests.post(url=search_url, headers=headers, json=search_data, timeout=(3, 5))\n",
" search_value = json.loads(search_res.text)[\"data\"]\n",
"# datas = search_value\n",
" if search_value:\n",
" datas = search_value\n",
" else :\n",
" datas = None\n",
" \n",
"\n",
" append_rows = [cur_time2]\n",
" dataItemNo_dataValue = {}\n",
"# for data_value in datas:\n",
"# dataItemNo_dataValue[data_value[\"dataItemNo\"]] = data_value[\"dataValue\"]\n",
" for data_value in datas:\n",
" if \"dataValue\" not in data_value:\n",
" print(data_value)\n",
" dataItemNo_dataValue[data_value[\"dataItemNo\"]] = \"\"\n",
" else:\n",
" dataItemNo_dataValue[data_value[\"dataItemNo\"]] = data_value[\"dataValue\"]\n",
" for value in one_cols[1:]:\n",
" if value in dataItemNo_dataValue:\n",
" append_rows.append(dataItemNo_dataValue[value])\n",
" else:\n",
" append_rows.append(\"\")\n",
"\n",
" workbook = xlrd.open_workbook('定性模型数据项12-11.xls')\n",
"\n",
" # 获取所有sheet的个数\n",
" sheet_count = len(workbook.sheet_names())\n",
"\n",
" # 获取所有sheet的名称\n",
" sheet_names = workbook.sheet_names()\n",
"\n",
" new_workbook = xlwt.Workbook()\n",
" for i in range(sheet_count):\n",
" # 获取当前sheet\n",
" sheet = workbook.sheet_by_index(i)\n",
"\n",
" # 获取sheet的行数和列数\n",
" row_count = sheet.nrows\n",
" col_count = sheet.ncols\n",
" # 获取原有数据\n",
" data = []\n",
" for row in range(row_count):\n",
" row_data = []\n",
" for col in range(col_count):\n",
" row_data.append(sheet.cell_value(row, col))\n",
" data.append(row_data)\n",
" # 创建xlwt的Workbook对象\n",
" # 创建sheet\n",
" new_sheet = new_workbook.add_sheet(sheet_names[i])\n",
"\n",
" # 将原有的数据写入新的sheet\n",
" for row in range(row_count):\n",
" for col in range(col_count):\n",
" new_sheet.write(row, col, data[row][col])\n",
"\n",
" if i == 0:\n",
" # 在新的sheet中添加数据\n",
" for col in range(col_count):\n",
" new_sheet.write(row_count, col, append_rows[col])\n",
"\n",
" # 保存新的xls文件\n",
" new_workbook.save(\"定性模型数据项12-11.xls\")\n",
"\n",
" df = pd.read_excel('定性模型数据项12-11.xls')\n",
" df=df.fillna(df.ffill())\n",
" df1 = df[-2:].reset_index()\n",
2025-01-08 14:43:47 +08:00
" '''\n",
" # if df1.loc[1,'70号沥青开工率'] > 0.3: \n",
" 2025年1月8日 修改:\n",
" 复盘分析后发现2024-7月开始, 开工率数据从0.28 变为了28 ,改为下面的判断规则\n",
" '''\n",
" if df1.loc[1,'70号沥青开工率'] > 30:\n",
2024-11-01 17:33:48 +08:00
" a = (df1.loc[1,'70号沥青开工率']-0.2)*5/0.1\n",
" else :\n",
" a = 0\n",
" b = df1.loc[1,'资金因素']\n",
" if df1.loc[1,'昨日计划提货偏差']>0:\n",
" c = df1.loc[1,'昨日计划提货偏差']*10/2000\n",
" else :\n",
" c = df1.loc[1,'昨日计划提货偏差']*10/3000\n",
" d = df1.loc[1,'生产情况']\n",
" if df1.loc[1,'基质沥青库存']/265007 >0.8:\n",
" e = (df1.loc[1,'基质沥青库存'] - df1.loc[0,'基质沥青库存'])*10/-5000\n",
" else : \n",
" e = 0\n",
" f = df1.loc[1,'下游客户价格预期']\n",
" if abs(df1.loc[1,'即期成本'] - df1.loc[0,'即期成本'])>=100:\n",
" g = (df1.loc[1,'即期成本'] - df1.loc[0,'即期成本'])*50/100\n",
" else :\n",
" g = 0\n",
" h = df1.loc[1,'订单结构']\n",
" x = round(0.08*a+0*b+0.15*c+0.08*d +0.03*e +0.08*f +0.4*g+0.18*h+df1.loc[0,'京博指导价'],2)\n",
"\n",
" login_res1 = requests.post(url=login_push_url, json=login_push_data, timeout=(3, 5))\n",
" text1 = json.loads(login_res1.text)\n",
" token_push = text1[\"data\"][\"accessToken\"]\n",
"\n",
"\n",
" data1 = {\n",
" \"funcModule\": \"数据表信息列表\",\n",
" \"funcOperation\": \"新增\",\n",
" \"data\": [\n",
" {\"dataItemNo\": \"C01100036|Forecast_Price|DX|ACN\",\n",
" \"dataDate\": cur_time,\n",
" \"dataStatus\": \"add\",\n",
" \"dataValue\": x\n",
" }\n",
"\n",
" ]\n",
" }\n",
" headers1 = {\"Authorization\": token_push}\n",
2025-01-03 09:32:07 +08:00
" # res = requests.post(url=upload_url, headers=headers1, json=data1, timeout=(3, 5))\n",
2024-11-01 17:33:48 +08:00
" \n",
" \n",
" \n",
"def start_1():\n",
" workbook = xlrd.open_workbook(read_file_path_name)\n",
"\n",
"\n",
"\n",
" # 选择第一个表格\n",
" sheet = workbook.sheet_by_index(0)\n",
"\n",
" # 获取行数和列数\n",
" num_rows = sheet.nrows\n",
"\n",
"\n",
"\n",
" row_data = sheet.row_values(1)\n",
" one_cols = row_data\n",
"\n",
"\n",
" login_res = requests.post(url=login_url, json=login_data, timeout=(3, 5))\n",
" text = json.loads(login_res.text)\n",
" if text[\"status\"]:\n",
" token = text[\"data\"][\"accessToken\"]\n",
" else:\n",
" print(\"获取认证失败\")\n",
" token = None\n",
"\n",
"\n",
" now = datetime.now() - timedelta(days=1) \n",
" year = now.year\n",
" month = now.month\n",
" day = now.day\n",
"\n",
" if month < 10:\n",
" month = \"0\" + str(month)\n",
" if day < 10:\n",
" day = \"0\" + str(day)\n",
" cur_time = str(year) + str(month) + str(day)\n",
" cur_time2 = str(year) + \"-\" + str(month) + \"-\" + str(day)\n",
" search_data = {\n",
" \"data\": {\n",
" \"date\": cur_time,\n",
" \"dataItemNoList\": one_cols[1:]\n",
" },\n",
" \"funcModule\": \"数据项\",\n",
" \"funcOperation\": \"查询\"\n",
" }\n",
" headers = {\"Authorization\": token}\n",
" search_res = requests.post(url=search_url, headers=headers, json=search_data, timeout=(3, 5))\n",
" search_value = json.loads(search_res.text)[\"data\"]\n",
"# datas = search_value\n",
" if search_value:\n",
" datas = search_value\n",
" else :\n",
" datas = None\n",
" \n",
" \n",
"\n",
" append_rows = [cur_time2]\n",
" dataItemNo_dataValue = {}\n",
"# for data_value in datas:\n",
"# dataItemNo_dataValue[data_value[\"dataItemNo\"]] = data_value[\"dataValue\"]\n",
" for data_value in datas:\n",
" if \"dataValue\" not in data_value:\n",
" print(data_value)\n",
" dataItemNo_dataValue[data_value[\"dataItemNo\"]] = \"\"\n",
" else:\n",
" dataItemNo_dataValue[data_value[\"dataItemNo\"]] = data_value[\"dataValue\"]\n",
" for value in one_cols[1:]:\n",
" if value in dataItemNo_dataValue:\n",
" append_rows.append(dataItemNo_dataValue[value])\n",
" else:\n",
" append_rows.append(\"\")\n",
"\n",
" workbook = xlrd.open_workbook('定性模型数据项12-11.xls')\n",
"\n",
" # 获取所有sheet的个数\n",
" sheet_count = len(workbook.sheet_names())\n",
"\n",
" # 获取所有sheet的名称\n",
" sheet_names = workbook.sheet_names()\n",
"\n",
" new_workbook = xlwt.Workbook()\n",
" for i in range(sheet_count):\n",
" # 获取当前sheet\n",
" sheet = workbook.sheet_by_index(i)\n",
"\n",
" # 获取sheet的行数和列数\n",
" row_count = sheet.nrows - 1\n",
" col_count = sheet.ncols\n",
" # 获取原有数据\n",
" data = []\n",
" for row in range(row_count):\n",
" row_data = []\n",
" for col in range(col_count):\n",
" row_data.append(sheet.cell_value(row, col))\n",
" data.append(row_data)\n",
" # 创建xlwt的Workbook对象\n",
" # 创建sheet\n",
" new_sheet = new_workbook.add_sheet(sheet_names[i])\n",
"\n",
" # 将原有的数据写入新的sheet\n",
" for row in range(row_count):\n",
" for col in range(col_count):\n",
" new_sheet.write(row, col, data[row][col])\n",
"\n",
" if i == 0:\n",
" # 在新的sheet中添加数据\n",
" for col in range(col_count):\n",
" new_sheet.write(row_count, col, append_rows[col])\n",
"\n",
" # 保存新的xls文件\n",
" new_workbook.save(\"定性模型数据项12-11.xls\")\n",
"\n",
"\n",
"def start_2(date):\n",
" workbook = xlrd.open_workbook(read_file_path_name)\n",
"\n",
"\n",
"\n",
" # 选择第一个表格\n",
" sheet = workbook.sheet_by_index(0)\n",
"\n",
" # 获取行数和列数\n",
" num_rows = sheet.nrows\n",
"\n",
"\n",
"\n",
" row_data = sheet.row_values(1)\n",
" one_cols = row_data\n",
"\n",
"\n",
" login_res = requests.post(url=login_url, json=login_data, timeout=(3, 5))\n",
" text = json.loads(login_res.text)\n",
" if text[\"status\"]:\n",
" token = text[\"data\"][\"accessToken\"]\n",
" else:\n",
" print(\"获取认证失败\")\n",
" token = None\n",
"\n",
"\n",
" now = date\n",
" year = now.year\n",
" month = now.month\n",
" day = now.day\n",
"\n",
" if month < 10:\n",
" month = \"0\" + str(month)\n",
" if day < 10:\n",
" day = \"0\" + str(day)\n",
" cur_time = str(year) + str(month) + str(day)\n",
" cur_time2 = str(year) + \"-\" + str(month) + \"-\" + str(day)\n",
" search_data = {\n",
" \"data\": {\n",
" \"date\": cur_time,\n",
" \"dataItemNoList\": one_cols[1:]\n",
" },\n",
" \"funcModule\": \"数据项\",\n",
" \"funcOperation\": \"查询\"\n",
" }\n",
" headers = {\"Authorization\": token}\n",
" search_res = requests.post(url=search_url, headers=headers, json=search_data, timeout=(3, 5))\n",
" search_value = json.loads(search_res.text)[\"data\"]\n",
"# datas = search_value\n",
" if search_value:\n",
" datas = search_value\n",
" else :\n",
" datas = None\n",
" \n",
"\n",
" append_rows = [cur_time2]\n",
" dataItemNo_dataValue = {}\n",
"# for data_value in datas:\n",
"# dataItemNo_dataValue[data_value[\"dataItemNo\"]] = data_value[\"dataValue\"]\n",
" for data_value in datas:\n",
" if \"dataValue\" not in data_value:\n",
" print(data_value)\n",
" dataItemNo_dataValue[data_value[\"dataItemNo\"]] = \"\"\n",
" else:\n",
" dataItemNo_dataValue[data_value[\"dataItemNo\"]] = data_value[\"dataValue\"]\n",
" for value in one_cols[1:]:\n",
" if value in dataItemNo_dataValue:\n",
" append_rows.append(dataItemNo_dataValue[value])\n",
" else:\n",
" append_rows.append(\"\")\n",
"\n",
" workbook = xlrd.open_workbook('定性模型数据项12-11.xls')\n",
"\n",
" # 获取所有sheet的个数\n",
" sheet_count = len(workbook.sheet_names())\n",
"\n",
" # 获取所有sheet的名称\n",
" sheet_names = workbook.sheet_names()\n",
"\n",
" new_workbook = xlwt.Workbook()\n",
" for i in range(sheet_count):\n",
" # 获取当前sheet\n",
" sheet = workbook.sheet_by_index(i)\n",
"\n",
" # 获取sheet的行数和列数\n",
" row_count = sheet.nrows\n",
" col_count = sheet.ncols\n",
" # 获取原有数据\n",
" data = []\n",
" for row in range(row_count):\n",
" row_data = []\n",
" for col in range(col_count):\n",
" row_data.append(sheet.cell_value(row, col))\n",
" data.append(row_data)\n",
" # 创建xlwt的Workbook对象\n",
" # 创建sheet\n",
" new_sheet = new_workbook.add_sheet(sheet_names[i])\n",
"\n",
" # 将原有的数据写入新的sheet\n",
" for row in range(row_count):\n",
" for col in range(col_count):\n",
" new_sheet.write(row, col, data[row][col])\n",
"\n",
" if i == 0:\n",
" # 在新的sheet中添加数据\n",
" for col in range(col_count):\n",
" new_sheet.write(row_count, col, append_rows[col])\n",
"\n",
" # 保存新的xls文件\n",
" new_workbook.save(\"定性模型数据项12-11.xls\")\n",
" print('关闭文件')\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"if __name__ == \"__main__\":\n",
" pass\n",
" # 需要单独运行放开\n",
" \n",
" # start_1()\n",
"\n",
" # 每天定时12点运行\n",
" # while True:\n",
" # # 获取当前时间\n",
" # current_time = time.strftime(\"%H:%M:%S\", time.localtime())\n",
" # current_time_1 = time.strftime(\"%H:%M:%S\", time.localtime())\n",
"\n",
" # # 判断当前时间是否为执行任务的时间点\n",
" # if current_time == \"12:00:00\":\n",
" # print(\"执行定时任务\")\n",
" # start()\n",
"\n",
" # # 休眠1秒钟, 避免过多占用CPU资源\n",
" # time.sleep(1)\n",
" \n",
" # elif current_time_1 == \"20:00:00\":\n",
" # print(\"更新数据\")\n",
" # start_1()\n",
" # time.sleep(1)\n",
"\n"
]
},
{
"cell_type": "code",
2025-01-08 14:43:47 +08:00
"execution_count": 4,
2024-11-01 17:33:48 +08:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
2025-01-08 14:43:47 +08:00
"20210613\n",
"20210614\n",
"20210615\n",
"20210616\n",
"20210617\n",
"20210618\n",
"20210619\n",
"20210620\n",
"20210621\n",
"20210622\n",
"20210623\n",
"20210624\n",
"20210625\n",
"20210626\n",
"20210627\n",
"20210628\n",
"20210629\n",
"20210630\n",
"20210701\n",
"20210702\n",
"20210703\n",
"20210704\n",
"20210705\n",
"20210706\n",
"20210707\n",
"20210708\n",
"20210709\n",
"20210710\n",
"20210711\n",
"20210712\n",
"20210713\n",
"20210714\n",
"20210715\n",
"20210716\n",
"20210717\n",
"20210718\n",
"20210719\n",
"20210720\n",
"20210721\n",
"20210722\n",
"20210723\n",
"20210724\n",
"20210725\n",
"20210726\n",
"20210727\n",
"20210728\n",
"20210729\n",
"20210730\n",
"20210731\n",
"20210801\n",
"20210802\n",
"20210803\n",
"20210804\n",
"20210805\n",
"20210806\n",
"20210807\n",
"20210808\n",
"20210809\n",
"20210810\n",
"20210811\n",
"20210812\n",
"20210813\n",
"20210814\n",
"20210815\n",
"20210816\n",
"20210817\n",
"20210818\n",
"20210819\n",
"20210820\n",
"20210821\n",
"20210822\n",
"20210823\n",
"20210824\n",
"20210825\n",
"20210826\n",
"20210827\n",
"20210828\n",
"20210829\n",
"20210830\n",
"20210831\n",
"20210901\n",
"20210902\n",
"20210903\n",
"20210904\n",
"20210905\n",
"20210906\n",
"20210907\n",
"20210908\n",
"20210909\n",
"20210910\n",
"{'dataDate': '20210910', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20210911\n",
"{'dataDate': '20210911', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20210912\n",
"{'dataDate': '20210912', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20210913\n",
"{'dataDate': '20210913', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20210914\n",
"{'dataDate': '20210914', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20210915\n",
"{'dataDate': '20210915', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20210916\n",
"{'dataDate': '20210916', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20210917\n",
"{'dataDate': '20210917', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20210918\n",
"{'dataDate': '20210918', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20210919\n",
"{'dataDate': '20210919', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20210920\n",
"{'dataDate': '20210920', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20210921\n",
"{'dataDate': '20210921', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20210922\n",
"{'dataDate': '20210922', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20210923\n",
"{'dataDate': '20210923', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20210924\n",
"{'dataDate': '20210924', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20210925\n",
"{'dataDate': '20210925', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20210926\n",
"{'dataDate': '20210926', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20210927\n",
"{'dataDate': '20210927', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20210928\n",
"{'dataDate': '20210928', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20210929\n",
"{'dataDate': '20210929', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20210930\n",
"{'dataDate': '20210930', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20211001\n",
"{'dataDate': '20211001', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20211002\n",
"{'dataDate': '20211002', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20211003\n",
"{'dataDate': '20211003', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20211004\n",
"{'dataDate': '20211004', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20211005\n",
"{'dataDate': '20211005', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20211006\n",
"{'dataDate': '20211006', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20211007\n",
"{'dataDate': '20211007', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20211008\n",
"{'dataDate': '20211008', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20211009\n",
"{'dataDate': '20211009', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20211010\n",
"{'dataDate': '20211010', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20211011\n",
"{'dataDate': '20211011', 'dataItemNo': 'STRIKE|DAY|KGL'}\n",
"20211012\n",
"20211013\n",
"20211014\n",
"20211015\n",
"20211016\n",
"20211017\n",
"20211018\n",
"20211019\n",
"20211020\n",
"20211021\n",
"20211022\n",
"20211023\n",
"20211024\n",
"20211025\n",
"20211026\n",
"20211027\n",
"20211028\n",
"20211029\n",
"20211030\n",
"20211031\n",
"20211101\n",
"20211102\n",
"20211103\n",
"20211104\n",
"20211105\n",
"20211106\n",
"20211107\n",
"20211108\n",
"20211109\n",
"20211110\n",
"20211111\n",
"20211112\n",
"20211113\n",
"20211114\n",
"20211115\n",
"20211116\n",
"20211117\n",
"20211118\n",
"20211119\n",
"20211120\n",
"20211121\n",
"20211122\n",
"20211123\n",
"20211124\n",
"20211125\n",
"20211126\n",
"20211127\n",
"20211128\n",
"20211129\n",
"20211130\n",
"20211201\n",
"20211202\n",
"20211203\n",
"20211204\n",
"20211205\n",
"20211206\n",
"20211207\n",
"20211208\n",
"20211209\n",
"20211210\n",
"20211211\n",
"20211212\n",
"20211213\n",
"20211214\n",
"20211215\n",
"20211216\n",
"20211217\n",
"20211218\n",
"20211219\n",
"20211220\n",
"20211221\n",
"20211222\n",
"20211223\n",
"20211224\n",
"20211225\n",
"20211226\n",
"20211227\n",
"20211228\n",
"20211229\n",
"20211230\n",
"20211231\n",
"20220101\n",
"20220102\n",
"20220103\n",
"20220104\n",
"20220105\n",
"20220106\n",
"20220107\n",
"20220108\n",
"20220109\n",
"20220110\n",
"20220111\n",
"20220112\n",
"20220113\n",
"20220114\n",
"20220115\n",
"20220116\n",
"20220117\n",
"20220118\n",
"20220119\n",
"20220120\n",
"20220121\n",
"20220122\n",
"20220123\n",
"20220124\n",
"20220125\n",
"20220126\n",
"20220127\n",
"20220128\n",
"20220129\n",
"20220130\n",
"20220131\n",
"20220201\n",
"20220202\n",
"20220203\n",
"20220204\n",
"20220205\n",
"20220206\n",
"20220207\n",
"20220208\n",
"20220209\n",
"20220210\n",
"20220211\n",
"20220212\n",
"20220213\n",
"20220214\n",
"20220215\n",
"20220216\n",
"20220217\n",
"20220218\n",
"20220219\n",
"20220220\n",
"20220221\n",
"20220222\n",
"20220223\n",
"20220224\n",
"20220225\n",
"20220226\n",
"20220227\n",
"20220228\n",
"20220301\n",
"20220302\n",
"20220303\n",
"20220304\n",
"20220305\n",
"20220306\n",
"20220307\n",
"20220308\n",
"20220309\n",
"20220310\n",
"20220311\n",
"20220312\n",
"20220313\n",
"20220314\n",
"20220315\n",
"20220316\n",
"20220317\n",
"20220318\n",
"20220319\n",
"20220320\n",
"20220321\n",
"20220322\n",
"20220323\n",
"20220324\n",
"20220325\n",
"20220326\n",
"20220327\n",
"20220328\n",
"20220329\n",
"20220330\n",
"20220331\n",
"20220401\n",
"20220402\n",
"20220403\n",
"20220404\n",
"20220405\n",
"20220406\n",
"20220407\n",
"20220408\n",
"20220409\n",
"20220410\n",
"20220411\n",
"20220412\n",
"20220413\n",
"20220414\n",
"20220415\n",
"20220416\n",
"20220417\n",
"20220418\n",
"20220419\n",
"20220420\n",
"20220421\n",
"20220422\n",
"20220423\n",
"20220424\n",
"20220425\n",
"20220426\n",
"20220427\n",
"20220428\n",
"20220429\n",
"20220430\n",
"20220501\n",
"20220502\n",
"20220503\n",
"20220504\n",
"20220505\n",
"20220506\n",
"20220507\n",
"20220508\n",
"20220509\n",
"20220510\n",
"20220511\n",
"20220512\n",
"20220513\n",
"20220514\n",
"20220515\n",
"20220516\n",
"20220517\n",
"20220518\n",
"20220519\n",
"20220520\n",
"20220521\n",
"20220522\n",
"20220523\n",
"20220524\n",
"20220525\n",
"20220526\n",
"20220527\n",
"20220528\n",
"20220529\n",
"20220530\n",
"20220531\n",
"20220601\n",
"20220602\n",
"20220603\n",
"20220604\n",
"20220605\n",
"20220606\n",
"20220607\n",
"20220608\n",
"20220609\n",
"20220610\n",
"20220611\n",
"20220612\n",
"20220613\n",
"20220614\n",
"20220615\n",
"20220616\n",
"20220617\n",
"20220618\n",
"20220619\n",
"20220620\n",
"20220621\n",
"20220622\n",
"20220623\n",
"20220624\n",
"20220625\n",
"20220626\n",
"20220627\n",
"20220628\n",
"20220629\n",
"20220630\n",
"20220701\n",
"20220702\n",
"20220703\n",
"20220704\n",
"20220705\n",
"20220706\n",
"20220707\n",
"20220708\n",
"20220709\n",
"20220710\n",
"20220711\n",
"20220712\n",
"20220713\n",
"20220714\n",
"20220715\n",
"20220716\n",
"20220717\n",
"20220718\n",
"20220719\n",
"20220720\n",
"20220721\n",
"20220722\n",
"20220723\n",
"20220724\n",
"20220725\n",
"20220726\n",
"20220727\n",
"20220728\n",
"20220729\n",
"20220730\n",
"20220731\n",
"20220801\n",
"20220802\n",
"20220803\n",
"20220804\n",
"20220805\n",
"20220806\n",
"20220807\n",
"20220808\n",
"20220809\n",
"20220810\n",
"20220811\n",
"20220812\n",
"20220813\n",
"20220814\n",
"20220815\n",
"20220816\n",
"20220817\n",
"20220818\n",
"20220819\n",
"20220820\n",
"20220821\n",
"20220822\n",
"20220823\n",
"20220824\n",
"20220825\n",
"20220826\n",
"20220827\n",
"20220828\n",
"20220829\n",
"20220830\n",
"20220831\n",
"20220901\n",
"20220902\n",
"20220903\n",
"20220904\n",
"20220905\n",
"20220906\n",
"20220907\n",
"20220908\n",
"20220909\n",
"20220910\n",
"20220911\n",
"20220912\n",
"20220913\n",
"20220914\n",
"20220915\n",
"20220916\n",
"20220917\n",
"20220918\n",
"20220919\n",
"20220920\n",
"20220921\n",
"20220922\n",
"20220923\n",
"20220924\n",
"20220925\n",
"20220926\n",
"20220927\n",
"20220928\n",
"20220929\n",
"20220930\n",
"20221001\n",
"20221002\n",
"20221003\n",
"20221004\n",
"20221005\n",
"20221006\n",
"20221007\n",
"20221008\n",
"20221009\n",
"20221010\n",
"20221011\n",
"20221012\n",
"20221013\n",
"20221014\n",
"20221015\n",
"20221016\n",
"20221017\n",
"20221018\n",
"20221019\n",
"20221020\n",
"20221021\n",
"20221022\n",
"20221023\n",
"20221024\n",
"20221025\n",
"20221026\n",
"20221027\n",
"20221028\n",
"20221029\n",
"20221030\n",
"20221031\n",
"20221101\n",
"20221102\n",
"20221103\n",
"20221104\n",
"20221105\n",
"20221106\n",
"20221107\n",
"20221108\n",
"20221109\n",
"20221110\n",
"20221111\n",
"20221112\n",
"20221113\n",
"20221114\n",
"20221115\n",
"20221116\n",
"20221117\n",
"20221118\n",
"20221119\n",
"20221120\n",
"20221121\n",
"20221122\n",
"20221123\n",
"20221124\n",
"20221125\n",
"20221126\n",
"20221127\n",
"20221128\n",
"20221129\n",
"20221130\n",
"20221201\n",
"20221202\n",
"20221203\n",
"20221204\n",
"20221205\n",
"20221206\n",
"20221207\n",
"20221208\n",
"20221209\n",
"20221210\n",
"20221211\n",
"20221212\n",
"20221213\n",
"20221214\n",
"20221215\n",
"20221216\n",
"20221217\n",
"20221218\n",
"20221219\n",
"20221220\n",
"20221221\n",
"20221222\n",
"20221223\n",
"20221224\n",
"20221225\n",
"20221226\n",
"20221227\n",
"20221228\n",
"20221229\n",
"20221230\n",
"20221231\n",
"20230101\n",
"20230102\n",
"20230103\n",
"20230104\n",
"20230105\n",
"20230106\n",
"20230107\n",
"20230108\n",
"20230109\n",
"20230110\n",
"20230111\n",
"20230112\n",
"20230113\n",
"20230114\n",
"20230115\n",
"20230116\n",
"20230117\n",
"20230118\n",
"20230119\n",
"20230120\n",
"20230121\n",
"20230122\n",
"20230123\n",
"20230124\n",
"20230125\n",
"20230126\n",
"20230127\n",
"20230128\n",
"20230129\n",
"20230130\n",
"20230131\n",
"20230201\n",
"20230202\n",
"20230203\n",
"20230204\n",
"20230205\n",
"20230206\n",
"20230207\n",
"20230208\n",
"20230209\n",
"20230210\n",
"20230211\n",
"20230212\n",
"20230213\n",
"20230214\n",
"20230215\n",
"20230216\n",
"20230217\n",
"20230218\n",
"20230219\n",
"20230220\n",
"20230221\n",
"20230222\n",
"20230223\n",
"20230224\n",
"20230225\n",
"20230226\n",
"20230227\n",
"20230228\n",
"20230301\n",
"20230302\n",
"20230303\n",
"20230304\n",
"20230305\n",
"20230306\n",
"20230307\n",
"20230308\n",
"20230309\n",
"20230310\n",
"20230311\n",
"20230312\n",
"20230313\n",
"20230314\n",
"20230315\n",
"20230316\n",
"20230317\n",
"20230318\n",
"20230319\n",
"20230320\n",
"20230321\n",
"20230322\n",
"20230323\n",
"20230324\n",
"20230325\n",
"20230326\n",
"20230327\n",
"20230328\n",
"20230329\n",
"20230330\n",
"20230331\n",
"20230401\n",
"20230402\n",
"20230403\n",
"20230404\n",
"20230405\n",
"20230406\n",
"20230407\n",
"20230408\n",
"20230409\n",
"20230410\n",
"20230411\n",
"20230412\n",
"20230413\n",
"20230414\n",
"20230415\n",
"20230416\n",
"20230417\n",
"20230418\n",
"20230419\n",
"20230420\n",
"20230421\n",
"20230422\n",
"20230423\n",
"20230424\n",
"20230425\n",
"20230426\n",
"20230427\n",
"20230428\n",
"20230429\n",
"20230430\n",
"20230501\n",
"20230502\n",
"20230503\n",
"20230504\n",
"20230505\n",
"20230506\n",
"20230507\n",
"20230508\n",
"20230509\n",
"20230510\n",
"20230511\n",
"20230512\n",
"20230513\n",
"20230514\n",
"20230515\n",
"20230516\n",
"20230517\n",
"20230518\n",
"20230519\n",
"20230520\n",
"20230521\n",
"20230522\n",
"20230523\n",
"20230524\n",
"20230525\n",
"20230526\n",
"20230527\n",
"20230528\n",
"20230529\n",
"20230530\n",
"20230531\n",
"20230601\n",
"20230602\n",
"20230603\n",
"20230604\n",
"20230605\n",
"20230606\n",
"20230607\n",
"20230608\n",
"20230609\n",
"20230610\n",
"20230611\n",
"20230612\n",
"20230613\n",
"20230614\n",
"20230615\n",
"20230616\n",
"20230617\n",
"20230618\n",
"20230619\n",
"20230620\n",
"20230621\n",
"20230622\n",
"20230623\n",
"20230624\n",
"20230625\n",
"20230626\n",
"20230627\n",
"20230628\n",
"20230629\n",
"20230630\n",
"20230701\n",
"20230702\n",
"20230703\n",
"20230704\n",
"20230705\n",
"20230706\n",
"20230707\n",
"20230708\n",
"20230709\n",
"20230710\n",
"20230711\n",
"20230712\n",
"20230713\n",
"20230714\n",
"20230715\n",
"20230716\n",
"20230717\n",
"20230718\n",
"20230719\n",
"20230720\n",
"20230721\n",
"20230722\n",
"20230723\n",
"20230724\n",
"20230725\n",
"20230726\n",
"20230727\n",
"20230728\n",
"20230729\n",
"20230730\n",
"20230731\n",
"20230801\n",
"20230802\n",
2025-01-03 09:32:07 +08:00
"20230803\n",
"20230804\n",
"20230805\n",
"20230806\n",
"20230807\n",
"20230808\n",
"20230809\n",
"20230810\n",
"20230811\n",
"20230812\n",
"20230813\n",
"20230814\n",
"20230815\n",
"20230816\n",
"20230817\n",
"20230818\n",
"20230819\n",
"20230820\n",
"20230821\n",
"20230822\n",
"20230823\n",
"20230824\n",
"20230825\n",
"20230826\n",
"20230827\n",
"20230828\n",
"20230829\n",
"20230830\n",
"20230831\n",
"20230901\n",
"20230902\n",
"20230903\n",
"20230904\n",
"20230905\n",
"20230906\n",
"20230907\n",
"20230908\n",
"20230909\n",
"20230910\n",
"20230911\n",
"20230912\n",
"20230913\n",
"20230914\n",
"20230915\n",
"20230916\n",
"20230917\n",
"20230918\n",
"20230919\n",
"20230920\n",
"20230921\n",
"20230922\n",
"20230923\n",
"20230924\n",
"20230925\n",
"20230926\n",
"20230927\n",
"20230928\n",
"20230929\n",
"20230930\n",
"20231001\n",
"20231002\n",
"20231003\n",
"20231004\n",
"20231005\n",
"20231006\n",
"20231007\n",
"20231008\n",
"20231009\n",
"20231010\n",
"20231011\n",
"20231012\n",
"20231013\n",
"20231014\n",
"20231015\n",
"20231016\n",
"20231017\n",
"20231018\n",
"20231019\n",
"20231020\n",
"20231021\n",
"20231022\n",
"20231023\n",
"20231024\n",
"20231025\n",
"20231026\n",
"20231027\n",
"20231028\n",
"20231029\n",
"20231030\n",
"20231031\n",
"20231101\n",
"20231102\n",
"20231103\n",
"20231104\n",
"20231105\n",
"20231106\n",
"20231107\n",
"20231108\n",
"20231109\n",
"20231110\n",
"20231111\n",
"20231112\n",
"20231113\n",
"20231114\n",
"20231115\n",
"20231116\n",
"20231117\n",
"20231118\n",
"20231119\n",
"20231120\n",
"20231121\n",
"20231122\n",
"20231123\n",
"20231124\n",
"20231125\n",
"20231126\n",
"20231127\n",
"20231128\n",
"20231129\n",
"20231130\n",
"20231201\n",
"20231202\n",
"20231203\n",
"20231204\n",
"20231205\n",
"20231206\n",
"20231207\n",
"20231208\n",
"20231209\n",
"20231210\n",
"20231211\n",
"20231212\n",
"20231213\n",
"{'dataDate': '20231213', 'dataItemNo': 'SDHYDDJG'}\n",
"{'dataDate': '20231213', 'dataItemNo': 'SDHYSCQK'}\n",
"{'dataDate': '20231213', 'dataItemNo': 'SDHYZJYS'}\n",
"20231214\n",
"20231215\n",
"20231216\n",
"20231217\n",
"20231218\n",
"20231219\n",
"20231220\n",
"{'dataDate': '20231220', 'dataItemNo': 'SDHYDDJG'}\n",
"{'dataDate': '20231220', 'dataItemNo': 'SDHYSCQK'}\n",
"{'dataDate': '20231220', 'dataItemNo': 'SDHYZJYS'}\n",
"20231221\n",
"20231222\n",
"20231223\n",
"20231224\n",
"20231225\n",
"20231226\n",
"20231227\n",
"{'dataDate': '20231227', 'dataItemNo': 'SDHYDDJG'}\n",
"{'dataDate': '20231227', 'dataItemNo': 'SDHYSCQK'}\n",
"{'dataDate': '20231227', 'dataItemNo': 'SDHYZJYS'}\n",
"20231228\n",
"20231229\n",
"20231230\n",
"20231231\n",
"20240101\n",
"20240102\n",
2025-01-08 14:43:47 +08:00
"20240103\n"
]
},
{
"ename": "KeyboardInterrupt",
"evalue": "",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn[4], line 8\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[38;5;28;01mwhile\u001b[39;00m start_date \u001b[38;5;241m<\u001b[39m end_date:\n\u001b[0;32m 7\u001b[0m \u001b[38;5;28mprint\u001b[39m(start_date\u001b[38;5;241m.\u001b[39mstrftime(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124mY\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124mm\u001b[39m\u001b[38;5;132;01m%d\u001b[39;00m\u001b[38;5;124m'\u001b[39m))\n\u001b[1;32m----> 8\u001b[0m start(start_date)\n\u001b[0;32m 9\u001b[0m \u001b[38;5;66;03m# start_1(start_date)\u001b[39;00m\n\u001b[0;32m 10\u001b[0m start_date \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m timedelta(days\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m1\u001b[39m)\n",
"Cell \u001b[1;32mIn[3], line 93\u001b[0m, in \u001b[0;36mstart\u001b[1;34m(date)\u001b[0m\n\u001b[0;32m 84\u001b[0m search_data \u001b[38;5;241m=\u001b[39m {\n\u001b[0;32m 85\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdata\u001b[39m\u001b[38;5;124m\"\u001b[39m: {\n\u001b[0;32m 86\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdate\u001b[39m\u001b[38;5;124m\"\u001b[39m: cur_time,\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 90\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfuncOperation\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m查询\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m 91\u001b[0m }\n\u001b[0;32m 92\u001b[0m headers \u001b[38;5;241m=\u001b[39m {\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mAuthorization\u001b[39m\u001b[38;5;124m\"\u001b[39m: token}\n\u001b[1;32m---> 93\u001b[0m search_res \u001b[38;5;241m=\u001b[39m requests\u001b[38;5;241m.\u001b[39mpost(url\u001b[38;5;241m=\u001b[39msearch_url, headers\u001b[38;5;241m=\u001b[39mheaders, json\u001b[38;5;241m=\u001b[39msearch_data, timeout\u001b[38;5;241m=\u001b[39m(\u001b[38;5;241m3\u001b[39m, \u001b[38;5;241m5\u001b[39m))\n\u001b[0;32m 94\u001b[0m search_value \u001b[38;5;241m=\u001b[39m json\u001b[38;5;241m.\u001b[39mloads(search_res\u001b[38;5;241m.\u001b[39mtext)[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdata\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[0;32m 95\u001b[0m \u001b[38;5;66;03m# datas = search_value\u001b[39;00m\n",
"File \u001b[1;32md:\\ProgramData\\anaconda3\\Lib\\site-packages\\requests\\api.py:115\u001b[0m, in \u001b[0;36mpost\u001b[1;34m(url, data, json, **kwargs)\u001b[0m\n\u001b[0;32m 103\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mpost\u001b[39m(url, data\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m, json\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs):\n\u001b[0;32m 104\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124mr\u001b[39m\u001b[38;5;124;03m\"\"\"Sends a POST request.\u001b[39;00m\n\u001b[0;32m 105\u001b[0m \n\u001b[0;32m 106\u001b[0m \u001b[38;5;124;03m :param url: URL for the new :class:`Request` object.\u001b[39;00m\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 112\u001b[0m \u001b[38;5;124;03m :rtype: requests.Response\u001b[39;00m\n\u001b[0;32m 113\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[1;32m--> 115\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m request(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mpost\u001b[39m\u001b[38;5;124m\"\u001b[39m, url, data\u001b[38;5;241m=\u001b[39mdata, json\u001b[38;5;241m=\u001b[39mjson, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n",
"File \u001b[1;32md:\\ProgramData\\anaconda3\\Lib\\site-packages\\requests\\api.py:59\u001b[0m, in \u001b[0;36mrequest\u001b[1;34m(method, url, **kwargs)\u001b[0m\n\u001b[0;32m 55\u001b[0m \u001b[38;5;66;03m# By using the 'with' statement we are sure the session is closed, thus we\u001b[39;00m\n\u001b[0;32m 56\u001b[0m \u001b[38;5;66;03m# avoid leaving sockets open which can trigger a ResourceWarning in some\u001b[39;00m\n\u001b[0;32m 57\u001b[0m \u001b[38;5;66;03m# cases, and look like a memory leak in others.\u001b[39;00m\n\u001b[0;32m 58\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m sessions\u001b[38;5;241m.\u001b[39mSession() \u001b[38;5;28;01mas\u001b[39;00m session:\n\u001b[1;32m---> 59\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m session\u001b[38;5;241m.\u001b[39mrequest(method\u001b[38;5;241m=\u001b[39mmethod, url\u001b[38;5;241m=\u001b[39murl, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n",
"File \u001b[1;32md:\\ProgramData\\anaconda3\\Lib\\site-packages\\requests\\sessions.py:589\u001b[0m, in \u001b[0;36mSession.request\u001b[1;34m(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)\u001b[0m\n\u001b[0;32m 584\u001b[0m send_kwargs \u001b[38;5;241m=\u001b[39m {\n\u001b[0;32m 585\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtimeout\u001b[39m\u001b[38;5;124m\"\u001b[39m: timeout,\n\u001b[0;32m 586\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mallow_redirects\u001b[39m\u001b[38;5;124m\"\u001b[39m: allow_redirects,\n\u001b[0;32m 587\u001b[0m }\n\u001b[0;32m 588\u001b[0m send_kwargs\u001b[38;5;241m.\u001b[39mupdate(settings)\n\u001b[1;32m--> 589\u001b[0m resp \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msend(prep, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39msend_kwargs)\n\u001b[0;32m 591\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m resp\n",
"File \u001b[1;32md:\\ProgramData\\anaconda3\\Lib\\site-packages\\requests\\sessions.py:703\u001b[0m, in \u001b[0;36mSession.send\u001b[1;34m(self, request, **kwargs)\u001b[0m\n\u001b[0;32m 700\u001b[0m start \u001b[38;5;241m=\u001b[39m preferred_clock()\n\u001b[0;32m 702\u001b[0m \u001b[38;5;66;03m# Send the request\u001b[39;00m\n\u001b[1;32m--> 703\u001b[0m r \u001b[38;5;241m=\u001b[39m adapter\u001b[38;5;241m.\u001b[39msend(request, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[0;32m 705\u001b[0m \u001b[38;5;66;03m# Total elapsed time of the request (approximately)\u001b[39;00m\n\u001b[0;32m 706\u001b[0m elapsed \u001b[38;5;241m=\u001b[39m preferred_clock() \u001b[38;5;241m-\u001b[39m start\n",
"File \u001b[1;32md:\\ProgramData\\anaconda3\\Lib\\site-packages\\requests\\adapters.py:486\u001b[0m, in \u001b[0;36mHTTPAdapter.send\u001b[1;34m(self, request, stream, timeout, verify, cert, proxies)\u001b[0m\n\u001b[0;32m 483\u001b[0m timeout \u001b[38;5;241m=\u001b[39m TimeoutSauce(connect\u001b[38;5;241m=\u001b[39mtimeout, read\u001b[38;5;241m=\u001b[39mtimeout)\n\u001b[0;32m 485\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m--> 486\u001b[0m resp \u001b[38;5;241m=\u001b[39m conn\u001b[38;5;241m.\u001b[39murlopen(\n\u001b[0;32m 487\u001b[0m method\u001b[38;5;241m=\u001b[39mrequest\u001b[38;5;241m.\u001b[39mmethod,\n\u001b[0;32m 488\u001b[0m url\u001b[38;5;241m=\u001b[39murl,\n\u001b[0;32m 489\u001b[0m body\u001b[38;5;241m=\u001b[39mrequest\u001b[38;5;241m.\u001b[39mbody,\n\u001b[0;32m 490\u001b[0m headers\u001b[38;5;241m=\u001b[39mrequest\u001b[38;5;241m.\u001b[39mheaders,\n\u001b[0;32m 491\u001b[0m redirect\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m,\n\u001b[0;32m 492\u001b[0m assert_same_host\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m,\n\u001b[0;32m 493\u001b[0m preload_content\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m,\n\u001b[0;32m 494\u001b[0m decode_content\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m,\n\u001b[0;32m 495\u001b[0m retries\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mmax_retries,\n\u001b[0;32m 496\u001b[0m timeout\u001b[38;5;241m=\u001b[39mtimeout,\n\u001b[0;32m 497\u001b[0m chunked\u001b[38;5;241m=\u001b[39mchunked,\n\u001b[0;32m 498\u001b[0m )\n\u001b[0;32m 500\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m (ProtocolError, \u001b[38;5;167;01mOSError\u001b[39;00m) \u001b[38;5;28;01mas\u001b[39;00m err:\n\u001b[0;32m 501\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mConnectionError\u001b[39;00m(err, request\u001b[38;5;241m=\u001b[39mrequest)\n",
"File \u001b[1;32md:\\ProgramData\\anaconda3\\Lib\\site-packages\\urllib3\\connectionpool.py:791\u001b[0m, in \u001b[0;36mHTTPConnectionPool.urlopen\u001b[1;34m(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)\u001b[0m\n\u001b[0;32m 788\u001b[0m response_conn \u001b[38;5;241m=\u001b[39m conn \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m release_conn \u001b[38;5;28;01melse\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m 790\u001b[0m \u001b[38;5;66;03m# Make the request on the HTTPConnection object\u001b[39;00m\n\u001b[1;32m--> 791\u001b[0m response \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_make_request(\n\u001b[0;32m 792\u001b[0m conn,\n\u001b[0;32m 793\u001b[0m method,\n\u001b[0;32m 794\u001b[0m url,\n\u001b[0;32m 795\u001b[0m timeout\u001b[38;5;241m=\u001b[39mtimeout_obj,\n\u001b[0;32m 796\u001b[0m body\u001b[38;5;241m=\u001b[39mbody,\n\u001b[0;32m 797\u001b[0m headers\u001b[38;5;241m=\u001b[39mheaders,\n\u001b[0;32m 798\u001b[0m chunked\u001b[38;5;241m=\u001b[39mchunked,\n\u001b[0;32m 799\u001b[0m retries\u001b[38;5;241m=\u001b[39mretries,\n\u001b[0;32m 800\u001b[0m response_conn\u001b[38;5;241m=\u001b[39mresponse_conn,\n\u001b[0;32m 801\u001b[0m preload_content\u001b[38;5;241m=\u001b[39mpreload_content,\n\u001b[0;32m 802\u001b[0m decode_content\u001b[38;5;241m=\u001b[39mdecode_content,\n\u001b[0;32m 803\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mresponse_kw,\n\u001b[0;32m 804\u001b[0m )\n\u001b[0;32m 806\u001b[0m \u001b[38;5;66;03m# Everything went great!\u001b[39;00m\n\u001b[0;32m 807\u001b[0m clean_exit \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mTrue\u001b[39;00m\n",
"File \u001b[1;32md:\\ProgramData\\anaconda3\\Lib\\site-packages\\urllib3\\connectionpool.py:537\u001b[0m, in \u001b[0;36mHTTPConnectionPool._make_request\u001b[1;34m(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)\u001b[0m\n\u001b[0;32m 535\u001b[0m \u001b[38;5;66;03m# Receive the response from the server\u001b[39;00m\n\u001b[0;32m 536\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m--> 537\u001b[0m response \u001b[38;5;241m=\u001b[39m conn\u001b[38;5;241m.\u001b[39mgetresponse()\n\u001b[0;32m 538\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m (BaseSSLError, \u001b[38;5;167;01mOSError\u001b[39;00m) \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m 539\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_raise_timeout(err\u001b[38;5;241m=\u001b[39me, url\u001b[38;5;241m=\u001b[39murl, timeout_value\u001b[38;5;241m=\u001b[39mread_timeout)\n",
"File \u001b[1;32md:\\ProgramData\\anaconda3\\Lib\\site-packages\\urllib3\\connection.py:461\u001b[0m, in \u001b[0;36mHTTPConnection.getresponse\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 458\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mresponse\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m HTTPResponse\n\u001b[0;32m 460\u001b[0m \u001b[38;5;66;03m# Get the response from http.client.HTTPConnection\u001b[39;00m\n\u001b[1;32m--> 461\u001b[0m httplib_response \u001b[38;5;241m=\u001b[39m \u001b[38;5;28msuper\u001b[39m()\u001b[38;5;241m.\u001b[39mgetresponse()\n\u001b[0;32m 463\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m 464\u001b[0m assert_header_parsing(httplib_response\u001b[38;5;241m.\u001b[39mmsg)\n",
"File \u001b[1;32md:\\ProgramData\\anaconda3\\Lib\\http\\client.py:1386\u001b[0m, in \u001b[0;36mHTTPConnection.getresponse\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 1384\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m 1385\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m-> 1386\u001b[0m response\u001b[38;5;241m.\u001b[39mbegin()\n\u001b[0;32m 1387\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mConnectionError\u001b[39;00m:\n\u001b[0;32m 1388\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mclose()\n",
"File \u001b[1;32md:\\ProgramData\\anaconda3\\Lib\\http\\client.py:325\u001b[0m, in \u001b[0;36mHTTPResponse.begin\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 323\u001b[0m \u001b[38;5;66;03m# read until we get a non-100 response\u001b[39;00m\n\u001b[0;32m 324\u001b[0m \u001b[38;5;28;01mwhile\u001b[39;00m \u001b[38;5;28;01mTrue\u001b[39;00m:\n\u001b[1;32m--> 325\u001b[0m version, status, reason \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_read_status()\n\u001b[0;32m 326\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m status \u001b[38;5;241m!=\u001b[39m CONTINUE:\n\u001b[0;32m 327\u001b[0m \u001b[38;5;28;01mbreak\u001b[39;00m\n",
"File \u001b[1;32md:\\ProgramData\\anaconda3\\Lib\\http\\client.py:286\u001b[0m, in \u001b[0;36mHTTPResponse._read_status\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 285\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_read_status\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[1;32m--> 286\u001b[0m line \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mstr\u001b[39m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mfp\u001b[38;5;241m.\u001b[39mreadline(_MAXLINE \u001b[38;5;241m+\u001b[39m \u001b[38;5;241m1\u001b[39m), \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124miso-8859-1\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m 287\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(line) \u001b[38;5;241m>\u001b[39m _MAXLINE:\n\u001b[0;32m 288\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m LineTooLong(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mstatus line\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n",
"File \u001b[1;32md:\\ProgramData\\anaconda3\\Lib\\socket.py:706\u001b[0m, in \u001b[0;36mSocketIO.readinto\u001b[1;34m(self, b)\u001b[0m\n\u001b[0;32m 704\u001b[0m \u001b[38;5;28;01mwhile\u001b[39;00m \u001b[38;5;28;01mTrue\u001b[39;00m:\n\u001b[0;32m 705\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m--> 706\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_sock\u001b[38;5;241m.\u001b[39mrecv_into(b)\n\u001b[0;32m 707\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m timeout:\n\u001b[0;32m 708\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_timeout_occurred \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mTrue\u001b[39;00m\n",
"\u001b[1;31mKeyboardInterrupt\u001b[0m: "
2024-11-01 17:33:48 +08:00
]
}
],
"source": [
"from datetime import datetime, timedelta\n",
"\n",
2025-01-08 14:43:47 +08:00
"start_date = datetime(2021, 6, 13)\n",
"end_date = datetime(2025, 1, 8)\n",
2024-11-01 17:33:48 +08:00
"\n",
"while start_date < end_date:\n",
" print(start_date.strftime('%Y%m%d'))\n",
" start(start_date)\n",
2025-01-03 09:32:07 +08:00
" # start_1(start_date)\n",
2024-11-01 17:33:48 +08:00
" start_date += timedelta(days=1)\n",
" \n",
" "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "base",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.7"
}
},
"nbformat": 4,
"nbformat_minor": 4
}