PriceForecast/测试环境登录接口调试.ipynb

385 lines
46 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "31c0e11d-c87a-4e95-92a0-d1d09625e255",
"metadata": {},
"outputs": [],
"source": [
"from config_jingbo import *\n",
"import requests\n",
"import json\n",
"import datetime"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "83c81b9e",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'http://192.168.100.53:8080/jingbo-dev/api/server/login'"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"login_pushreport_url\n"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "2b330ee3-c006-4ab1-8558-59c51ac8d86f",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'data': {'account': 'api_test',\n",
" 'password': 'ZTEwYWRjMzk0OWJhNTlhYmJlNTZlMDU3ZjIwZjg4M2U=',\n",
" 'tenantHashCode': '8a4577dbd919675758d57999a1e891fe',\n",
" 'terminal': 'API'},\n",
" 'funcModule': 'API',\n",
" 'funcOperation': '获取token'}"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"login_data"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "dcb6100a-ed2b-4077-a1a9-361c6cb565f9",
"metadata": {},
"outputs": [],
"source": [
"\n",
"def get_head_auth_report():\n",
" login_res = requests.post(url=login_pushreport_url, json=login_data, timeout=(3, 5))\n",
" text = json.loads(login_res.text)\n",
" print(text)\n",
" if text[\"status\"]:\n",
" token = text[\"data\"][\"accessToken\"]\n",
" return token\n"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "22c0c7c4",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'confirmFlg': False, 'data': {'accessToken': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhcGlfdGVzdCIsInRoIjoiOGE0NTc3ZGJkOTE5Njc1NzU4ZDU3OTk5YTFlODkxZmUiLCJsdCI6ImFwaSIsImlzcyI6IiIsInRtIjoiUEMiLCJleHAiOjE3MzIwMTYwNTQsImp0aSI6IjE5NjhkOTdiMDA1YzQ0OTI5NTg5ZDQ1ZWE3NjhlMWIwIn0.jZqjKms_oQfej5RFqT-If0sBqdDgbu-m8HBfS2myjQo', 'md5Token': 'e443264891e67c98ff50ca317239d31b'}, 'status': True}\n"
]
}
],
"source": [
"token = get_head_auth_report()"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "12077ead",
"metadata": {},
"outputs": [],
"source": [
"# token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhcGlfdGVzdCIsInRoIjoiOGE0NTc3ZGJkOTE5Njc1NzU4ZDU3OTk5YTFlODkxZmUiLCJsdCI6ImFwaSIsImlzcyI6IiIsInRtIjoiUEMiLCJleHAiOjE3MzE5NTkzNjUsImp0aSI6IjRiMjcwNTgzN2YyZDQxOWM4MzQ3NjI2NDQwZDlhZGQzIn0.PPgnoiJt412dJiceqVW8w7qkJFY4s-VqU9z6ZIkpqho'"
]
},
{
"cell_type": "code",
"execution_count": 36,
"id": "a7ae21d1",
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"last_update_times_df = pd.read_csv(os.path.join(dataset,'last_update_times.csv'))\n",
"\n",
"y_last_update_time = '2024-11-18'\n",
"warning_data_df = last_update_times_df[last_update_times_df['warning_date']<y_last_update_time][['stop_update_period','warning_date','last_update_time','update_period','feature']]\n",
"warning_data_df.columns = ['停更周期','预警日期','最后更新时间','更新周期','特征名称']\n",
"if len(warning_data_df) > 0:\n",
" content = '原油特征指标预警信息:\\n\\n'\n",
" warning_data_df = warning_data_df.sort_values(by='停更周期',ascending=False)\n",
" fixed_length = 30\n",
" warning_data_df['特征名称'] = warning_data_df['特征名称'].str.replace(\" \", \"\")\n",
" content = warning_data_df.to_string(index=False, col_space=fixed_length)\n",
" \n",
"else:\n",
" logger.info(f'没有需要上传的预警信息')\n",
" content = '没有需要维护的特征指标'\n",
"warning_date = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')\n",
"warning_data['data']['WARNING_DATE'] = warning_date\n",
"warning_data['data']['WARNING_CONTENT'] = content"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b8009a67",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 39,
"id": "3e1a9e67",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"--- Logging error ---\n",
"Traceback (most recent call last):\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\logging\\handlers.py\", line 74, in emit\n",
" self.doRollover()\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\logging\\handlers.py\", line 179, in doRollover\n",
" self.rotate(self.baseFilename, dfn)\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\logging\\handlers.py\", line 115, in rotate\n",
" os.rename(source, dest)\n",
"PermissionError: [WinError 32] 另一个程序正在使用此文件,进程无法访问。: 'd:\\\\code\\\\PriceForecast\\\\logs\\\\pricepredict.log' -> 'd:\\\\code\\\\PriceForecast\\\\logs\\\\pricepredict.log.1'\n",
"Call stack:\n",
" File \"<frozen runpy>\", line 198, in _run_module_as_main\n",
" File \"<frozen runpy>\", line 88, in _run_code\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\ipykernel_launcher.py\", line 17, in <module>\n",
" app.launch_new_instance()\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\traitlets\\config\\application.py\", line 992, in launch_instance\n",
" app.start()\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\ipykernel\\kernelapp.py\", line 701, in start\n",
" self.io_loop.start()\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\tornado\\platform\\asyncio.py\", line 195, in start\n",
" self.asyncio_loop.run_forever()\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\asyncio\\windows_events.py\", line 321, in run_forever\n",
" super().run_forever()\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\asyncio\\base_events.py\", line 607, in run_forever\n",
" self._run_once()\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\asyncio\\base_events.py\", line 1922, in _run_once\n",
" handle._run()\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\asyncio\\events.py\", line 80, in _run\n",
" self._context.run(self._callback, *self._args)\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\ipykernel\\kernelbase.py\", line 534, in dispatch_queue\n",
" await self.process_one()\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\ipykernel\\kernelbase.py\", line 523, in process_one\n",
" await dispatch(*args)\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\ipykernel\\kernelbase.py\", line 429, in dispatch_shell\n",
" await result\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\ipykernel\\kernelbase.py\", line 767, in execute_request\n",
" reply_content = await reply_content\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\ipykernel\\ipkernel.py\", line 429, in do_execute\n",
" res = shell.run_cell(\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\ipykernel\\zmqshell.py\", line 549, in run_cell\n",
" return super().run_cell(*args, **kwargs)\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\IPython\\core\\interactiveshell.py\", line 3051, in run_cell\n",
" result = self._run_cell(\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\IPython\\core\\interactiveshell.py\", line 3106, in _run_cell\n",
" result = runner(coro)\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\IPython\\core\\async_helpers.py\", line 129, in _pseudo_sync_runner\n",
" coro.send(None)\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\IPython\\core\\interactiveshell.py\", line 3311, in run_cell_async\n",
" has_raised = await self.run_ast_nodes(code_ast.body, cell_name,\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\IPython\\core\\interactiveshell.py\", line 3493, in run_ast_nodes\n",
" if await self.run_code(code, result, async_=asy):\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\IPython\\core\\interactiveshell.py\", line 3553, in run_code\n",
" exec(code_obj, self.user_global_ns, self.user_ns)\n",
" File \"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_10336\\2387189848.py\", line 4, in <module>\n",
" logger.info(\"预警上传中...\")\n",
"Message: '预警上传中...'\n",
"Arguments: ()\n",
"预警上传中...\n",
"--- Logging error ---\n",
"Traceback (most recent call last):\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\logging\\handlers.py\", line 74, in emit\n",
" self.doRollover()\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\logging\\handlers.py\", line 179, in doRollover\n",
" self.rotate(self.baseFilename, dfn)\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\logging\\handlers.py\", line 115, in rotate\n",
" os.rename(source, dest)\n",
"PermissionError: [WinError 32] 另一个程序正在使用此文件,进程无法访问。: 'd:\\\\code\\\\PriceForecast\\\\logs\\\\pricepredict.log' -> 'd:\\\\code\\\\PriceForecast\\\\logs\\\\pricepredict.log.1'\n",
"Call stack:\n",
" File \"<frozen runpy>\", line 198, in _run_module_as_main\n",
" File \"<frozen runpy>\", line 88, in _run_code\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\ipykernel_launcher.py\", line 17, in <module>\n",
" app.launch_new_instance()\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\traitlets\\config\\application.py\", line 992, in launch_instance\n",
" app.start()\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\ipykernel\\kernelapp.py\", line 701, in start\n",
" self.io_loop.start()\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\tornado\\platform\\asyncio.py\", line 195, in start\n",
" self.asyncio_loop.run_forever()\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\asyncio\\windows_events.py\", line 321, in run_forever\n",
" super().run_forever()\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\asyncio\\base_events.py\", line 607, in run_forever\n",
" self._run_once()\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\asyncio\\base_events.py\", line 1922, in _run_once\n",
" handle._run()\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\asyncio\\events.py\", line 80, in _run\n",
" self._context.run(self._callback, *self._args)\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\ipykernel\\kernelbase.py\", line 534, in dispatch_queue\n",
" await self.process_one()\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\ipykernel\\kernelbase.py\", line 523, in process_one\n",
" await dispatch(*args)\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\ipykernel\\kernelbase.py\", line 429, in dispatch_shell\n",
" await result\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\ipykernel\\kernelbase.py\", line 767, in execute_request\n",
" reply_content = await reply_content\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\ipykernel\\ipkernel.py\", line 429, in do_execute\n",
" res = shell.run_cell(\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\ipykernel\\zmqshell.py\", line 549, in run_cell\n",
" return super().run_cell(*args, **kwargs)\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\IPython\\core\\interactiveshell.py\", line 3051, in run_cell\n",
" result = self._run_cell(\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\IPython\\core\\interactiveshell.py\", line 3106, in _run_cell\n",
" result = runner(coro)\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\IPython\\core\\async_helpers.py\", line 129, in _pseudo_sync_runner\n",
" coro.send(None)\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\IPython\\core\\interactiveshell.py\", line 3311, in run_cell_async\n",
" has_raised = await self.run_ast_nodes(code_ast.body, cell_name,\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\IPython\\core\\interactiveshell.py\", line 3493, in run_ast_nodes\n",
" if await self.run_code(code, result, async_=asy):\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\IPython\\core\\interactiveshell.py\", line 3553, in run_code\n",
" exec(code_obj, self.user_global_ns, self.user_ns)\n",
" File \"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_10336\\2387189848.py\", line 5, in <module>\n",
" logger.info(f\"token:{token}\")\n",
"Message: 'token:eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhcGlfdGVzdCIsInRoIjoiOGE0NTc3ZGJkOTE5Njc1NzU4ZDU3OTk5YTFlODkxZmUiLCJsdCI6ImFwaSIsImlzcyI6IiIsInRtIjoiUEMiLCJleHAiOjE3MzIwMTYwNTQsImp0aSI6IjE5NjhkOTdiMDA1YzQ0OTI5NTg5ZDQ1ZWE3NjhlMWIwIn0.jZqjKms_oQfej5RFqT-If0sBqdDgbu-m8HBfS2myjQo'\n",
"Arguments: ()\n",
"token:eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhcGlfdGVzdCIsInRoIjoiOGE0NTc3ZGJkOTE5Njc1NzU4ZDU3OTk5YTFlODkxZmUiLCJsdCI6ImFwaSIsImlzcyI6IiIsInRtIjoiUEMiLCJleHAiOjE3MzIwMTYwNTQsImp0aSI6IjE5NjhkOTdiMDA1YzQ0OTI5NTg5ZDQ1ZWE3NjhlMWIwIn0.jZqjKms_oQfej5RFqT-If0sBqdDgbu-m8HBfS2myjQo\n",
"--- Logging error ---\n",
"Traceback (most recent call last):\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\logging\\handlers.py\", line 74, in emit\n",
" self.doRollover()\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\logging\\handlers.py\", line 179, in doRollover\n",
" self.rotate(self.baseFilename, dfn)\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\logging\\handlers.py\", line 115, in rotate\n",
" os.rename(source, dest)\n",
"PermissionError: [WinError 32] 另一个程序正在使用此文件,进程无法访问。: 'd:\\\\code\\\\PriceForecast\\\\logs\\\\pricepredict.log' -> 'd:\\\\code\\\\PriceForecast\\\\logs\\\\pricepredict.log.1'\n",
"Call stack:\n",
" File \"<frozen runpy>\", line 198, in _run_module_as_main\n",
" File \"<frozen runpy>\", line 88, in _run_code\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\ipykernel_launcher.py\", line 17, in <module>\n",
" app.launch_new_instance()\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\traitlets\\config\\application.py\", line 992, in launch_instance\n",
" app.start()\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\ipykernel\\kernelapp.py\", line 701, in start\n",
" self.io_loop.start()\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\tornado\\platform\\asyncio.py\", line 195, in start\n",
" self.asyncio_loop.run_forever()\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\asyncio\\windows_events.py\", line 321, in run_forever\n",
" super().run_forever()\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\asyncio\\base_events.py\", line 607, in run_forever\n",
" self._run_once()\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\asyncio\\base_events.py\", line 1922, in _run_once\n",
" handle._run()\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\asyncio\\events.py\", line 80, in _run\n",
" self._context.run(self._callback, *self._args)\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\ipykernel\\kernelbase.py\", line 534, in dispatch_queue\n",
" await self.process_one()\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\ipykernel\\kernelbase.py\", line 523, in process_one\n",
" await dispatch(*args)\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\ipykernel\\kernelbase.py\", line 429, in dispatch_shell\n",
" await result\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\ipykernel\\kernelbase.py\", line 767, in execute_request\n",
" reply_content = await reply_content\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\ipykernel\\ipkernel.py\", line 429, in do_execute\n",
" res = shell.run_cell(\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\ipykernel\\zmqshell.py\", line 549, in run_cell\n",
" return super().run_cell(*args, **kwargs)\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\IPython\\core\\interactiveshell.py\", line 3051, in run_cell\n",
" result = self._run_cell(\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\IPython\\core\\interactiveshell.py\", line 3106, in _run_cell\n",
" result = runner(coro)\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\IPython\\core\\async_helpers.py\", line 129, in _pseudo_sync_runner\n",
" coro.send(None)\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\IPython\\core\\interactiveshell.py\", line 3311, in run_cell_async\n",
" has_raised = await self.run_ast_nodes(code_ast.body, cell_name,\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\IPython\\core\\interactiveshell.py\", line 3493, in run_ast_nodes\n",
" if await self.run_code(code, result, async_=asy):\n",
" File \"d:\\ProgramData\\anaconda3\\Lib\\site-packages\\IPython\\core\\interactiveshell.py\", line 3553, in run_code\n",
" exec(code_obj, self.user_global_ns, self.user_ns)\n",
" File \"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_10336\\2387189848.py\", line 6, in <module>\n",
" logger.info(f\"warning_data:{warning_data}\" )\n",
"Message: \"warning_data:{'funcModule': '原油特征停更预警', 'funcOperation': '原油特征停更预警', 'data': {'WARNING_TYPE_NAME': '特征数据停更预警test', 'WARNING_CONTENT': ' 停更周期 预警日期 最后更新时间 更新周期 特征名称\\\\n 2218 2018-10-27 2018-10-24 1.0 西北欧即期Brent211利润\\\\n 1023 2022-02-03 2022-01-31 1.0 W-B活跃合约价差\\\\n 1023 2022-02-03 2022-01-31 1.0 B-W活跃合约价差\\\\n 734 2022-11-19 2022-11-16 1.0 Brent/迪拜原油升贴水\\\\n 686 2023-01-06 2023-01-03 1.0 PVMDubaiEFS/SwapvsICEFirstMonthBrent\\\\n 446 2023-09-03 2023-08-31 1.0 美国RBOB期货2309月份合约价格\\\\n 293 2024-02-03 2024-01-31 1.0 美国墨西哥湾87#汽油现货价格\\\\n 265 2024-03-02 2024-02-28 1.0 Ebob连1合约\\\\n 223 2024-04-13 2024-04-10 1.0 中国航班执行数\\\\n 91 2024-08-23 2024-08-20 1.0 Kpler-海运在途原油\\\\n 86 2023-04-15 2023-03-31 7.0 原油:开工率:东北地区:独立炼厂(周)\\\\n 68 2023-08-19 2023-08-04 7.0 原油:港口库存:中国(周)\\\\n 30 2024-05-13 2024-04-28 7.0 中东-巴林周度原油海运出口\\\\n 26 2024-06-08 2024-05-24 7.0 原油:山东港口:库存:新口径(周)\\\\n 26 2024-06-08 2024-05-24 7.0 原油:山东港口:库存:新口径(周)超季节性/3年\\\\n 23 2024-06-29 2024-06-14 7.0 美国:炼油厂的投入与使用情况:开工率:当周值\\\\n 23 2024-06-29 2024-06-14 7.0 美国:东海岸地区:炼油厂的投入与使用情况:开工率:当周值\\\\n 23 2024-06-29 2024-06-14 7.0 美国:中西部地区:炼油厂的投入与使用情况:开工率:当周值\\\\n 23 2024-06-29 2024-06-14 7.0 美国:洛基山地区:炼油厂的投入与使用情况:开工率:当周值\\\\n 23 2024-06-29 2024-06-14 7.0 美国:墨西哥湾沿岸:炼油厂的投入与使用情况:开工率:当周值\\\\n 23 2024-06-29 2024-06-14 7.0 美国:西海岸地区:炼油厂的投入与使用情况:开工率:当周值\\\\n 22 2023-10-09 2023-08-27 21.0 中东-也门周度原油海运出口\\\\n 20 2024-11-02 2024-10-30 1.0 EFSc202:30收盘价滞后1天\\\\n 20 2024-11-02 2024-10-30 1.0 EFSc102:30收盘价滞后1天\\\\n 20 2024-11-02 2024-10-30 1.0 Brentc202:30收盘价滞后1天\\\\n 20 2024-11-02 2024-10-30 1.0 Brentc102:30收盘价滞后1天\\\\n 19 2024-11-03 2024-10-31 1.0 WTIc2-c3(结算B)\\\\n 19 2024-11-03 2024-10-31 1.0 Brentc2-c3(结算B)\\\\n 18 2024-11-04 2024-11-01 1.0 欧洲汽油裂解\\\\n 18 2024-08-05 2024-07-21 7.0 全球原油库存(剔除富查伊拉)\\\\n 13 2024-09-09 2024-08-25 7.0 Kpler-美国原油净进口(周度)\\\\n 8 2024-10-12 2024-09-27 7.0 美国墨西哥湾原油钻机数\\\\n 7 2024-10-19 2024-10-04 7.0 美国汽油产量占比\\\\n 7 2024-10-19 2024-10-04 7.0 美国柴油产量占比\\\\n 7 2024-11-15 2024-11-12 1.0 DFL(Dated-主力布伦特)\\\\n 7 2024-11-15 2024-11-12 1.0 DFL(即期布伦特-布伦特期货C1\\\\n 6 2024-11-16 2024-11-13 1.0 国内马瑞与SC比价\\\\n 6 2024-11-16 2024-11-13 1.0 丙烷CFR华南/布伦特原油比价\\\\n 6 2024-11-16 2024-11-13 1.0 马瑞原油:现货价:山东(日)\\\\n 6 2024-11-16 2024-11-13 1.0 马瑞原油重质DES价委内瑞拉\\\\n 6 2024-11-16 2024-11-13 1.0 SC期货库存1000天百分位\\\\n 6 2024-11-16 2024-11-13 1.0 SC/ZC活跃合约\\\\n 6 2024-11-16 2024-11-13 1.0 SC仓单百万桶\\\\n 6 2024-11-16 2024-11-13 1.0 SC期货库存10期滚动标准差\\\\n 6 2024-11-16 2024-11-13 1.0 SCc2夜盘-Brentc1(结算)*汇率\\\\n 6 2024-11-16 2024-11-13 1.0 SCc1夜盘-Brentc1(结算)*汇率\\\\n 6 2024-11-16 2024-11-13 1.0 BU-SC活跃合约\\\\n 6 2024-11-16 2024-11-13 1.0 Brentc2-c3(结算)\\\\n 6 2024-11-16 2024-11-13 1.0 SCc2夜盘-Brentc2(结算)*汇率\\\\n 6 2024-11-16 2024-11-13 1.0 SC内外价差\\\\n 5 2024-11-17 2024-11-14 1.0 VLCC:中东-中国\\\\n 5 2024-11-17 2024-11-14 1.0 WTI连24合约\\\\n 5 2024-11-17 2024-11-14 1.0 Suezmax阿拉伯海湾-地中海\\\\n 5 2024-11-17 2024-11-14 1.0 ICEBrentc14\\\\n 5 2024-11-17 2024-11-14 1.0 OMAN原油中质远期现货DES价山东\\\\n 5 2024-11-17 2024-11-14 1.0 Brent-TI\\\\n 5 2024-11-17 2024-11-14 1.0 美国MARS贴水WTI\\\\n 5 2024-11-17 2024-11-14 1.0 Brent现货价格-Brent连3\\\\n 5 2024-11-17 2024-11-14 1.0 lmcads03lmecomdty\\\\n 5 2024-11-17 2024-11-14 1.0 布伦特现货价格-Brent连2\\\\n 5 2024-11-17 2024-11-14 1.0 美国MARS原油现货价格\\\\n 5 2024-11-17 2024-11-14 1.0 LLS原油现货价格\\\\n 5 2024-11-17 2024-11-14 1.0 Brent原油现货价格\\\\n 5 2024-11-17 2024-11-14 1.0 WTI原油现货价格Cushing\\\\n 5 2024-11-17 2024-11-14 1.0 欧洲柴油现货价格\\\\n 5 2024-11-17 2024-11-14 1.0 Midland原油现货价格\\\\n 5 2024-11-17 2024-11-14 1.0 美湾低硫柴油现货价格\\\\n 5 2024-11-17 2024-11-14 1.0 美国MEH轻原油现货价格美湾\\\\n 5 2024-11-17 2024-11-14 1.0 Brent现货价格-Brent连4\\\\n 5 2024-11-17 2024-11-14 1.0 DFL\\\\n 5 2024-11-17 2024-11-14 1.0 WTI原油Cushing-C1\\\\n 5 2024-11-17 2024-11-14 1.0 LLS-Brent价差\\\\n 3 2024-11-16 2024-11-01 7.0 美国取暖用油库存同差', 'WARNING_DATE': '2024-11-19 11:14:08'}}\"\n",
"Arguments: ()\n",
"warning_data:{'funcModule': '原油特征停更预警', 'funcOperation': '原油特征停更预警', 'data': {'WARNING_TYPE_NAME': '特征数据停更预警test', 'WARNING_CONTENT': ' 停更周期 预警日期 最后更新时间 更新周期 特征名称\\n 2218 2018-10-27 2018-10-24 1.0 西北欧即期Brent211利润\\n 1023 2022-02-03 2022-01-31 1.0 W-B活跃合约价差\\n 1023 2022-02-03 2022-01-31 1.0 B-W活跃合约价差\\n 734 2022-11-19 2022-11-16 1.0 Brent/迪拜原油升贴水\\n 686 2023-01-06 2023-01-03 1.0 PVMDubaiEFS/SwapvsICEFirstMonthBrent\\n 446 2023-09-03 2023-08-31 1.0 美国RBOB期货2309月份合约价格\\n 293 2024-02-03 2024-01-31 1.0 美国墨西哥湾87#汽油现货价格\\n 265 2024-03-02 2024-02-28 1.0 Ebob连1合约\\n 223 2024-04-13 2024-04-10 1.0 中国航班执行数\\n 91 2024-08-23 2024-08-20 1.0 Kpler-海运在途原油\\n 86 2023-04-15 2023-03-31 7.0 原油:开工率:东北地区:独立炼厂(周)\\n 68 2023-08-19 2023-08-04 7.0 原油:港口库存:中国(周)\\n 30 2024-05-13 2024-04-28 7.0 中东-巴林周度原油海运出口\\n 26 2024-06-08 2024-05-24 7.0 原油:山东港口:库存:新口径(周)\\n 26 2024-06-08 2024-05-24 7.0 原油:山东港口:库存:新口径(周)超季节性/3年\\n 23 2024-06-29 2024-06-14 7.0 美国:炼油厂的投入与使用情况:开工率:当周值\\n 23 2024-06-29 2024-06-14 7.0 美国:东海岸地区:炼油厂的投入与使用情况:开工率:当周值\\n 23 2024-06-29 2024-06-14 7.0 美国:中西部地区:炼油厂的投入与使用情况:开工率:当周值\\n 23 2024-06-29 2024-06-14 7.0 美国:洛基山地区:炼油厂的投入与使用情况:开工率:当周值\\n 23 2024-06-29 2024-06-14 7.0 美国:墨西哥湾沿岸:炼油厂的投入与使用情况:开工率:当周值\\n 23 2024-06-29 2024-06-14 7.0 美国:西海岸地区:炼油厂的投入与使用情况:开工率:当周值\\n 22 2023-10-09 2023-08-27 21.0 中东-也门周度原油海运出口\\n 20 2024-11-02 2024-10-30 1.0 EFSc202:30收盘价滞后1天\\n 20 2024-11-02 2024-10-30 1.0 EFSc102:30收盘价滞后1天\\n 20 2024-11-02 2024-10-30 1.0 Brentc202:30收盘价滞后1天\\n 20 2024-11-02 2024-10-30 1.0 Brentc102:30收盘价滞后1天\\n 19 2024-11-03 2024-10-31 1.0 WTIc2-c3(结算B)\\n 19 2024-11-03 2024-10-31 1.0 Brentc2-c3(结算B)\\n 18 2024-11-04 2024-11-01 1.0 欧洲汽油裂解\\n 18 2024-08-05 2024-07-21 7.0 全球原油库存(剔除富查伊拉)\\n 13 2024-09-09 2024-08-25 7.0 Kpler-美国原油净进口(周度)\\n 8 2024-10-12 2024-09-27 7.0 美国墨西哥湾原油钻机数\\n 7 2024-10-19 2024-10-04 7.0 美国汽油产量占比\\n 7 2024-10-19 2024-10-04 7.0 美国柴油产量占比\\n 7 2024-11-15 2024-11-12 1.0 DFL(Dated-主力布伦特)\\n 7 2024-11-15 2024-11-12 1.0 DFL(即期布伦特-布伦特期货C1\\n 6 2024-11-16 2024-11-13 1.0 国内马瑞与SC比价\\n 6 2024-11-16 2024-11-13 1.0 丙烷CFR华南/布伦特原油比价\\n 6 2024-11-16 2024-11-13 1.0 马瑞原油:现货价:山东(日)\\n 6 2024-11-16 2024-11-13 1.0 马瑞原油重质DES价委内瑞拉\\n 6 2024-11-16 2024-11-13 1.0 SC期货库存1000天百分位\\n 6 2024-11-16 2024-11-13 1.0 SC/ZC活跃合约\\n 6 2024-11-16 2024-11-13 1.0 SC仓单百万桶\\n 6 2024-11-16 2024-11-13 1.0 SC期货库存10期滚动标准差\\n 6 2024-11-16 2024-11-13 1.0 SCc2夜盘-Brentc1(结算)*汇率\\n 6 2024-11-16 2024-11-13 1.0 SCc1夜盘-Brentc1(结算)*汇率\\n 6 2024-11-16 2024-11-13 1.0 BU-SC活跃合约\\n 6 2024-11-16 2024-11-13 1.0 Brentc2-c3(结算)\\n 6 2024-11-16 2024-11-13 1.0 SCc2夜盘-Brentc2(结算)*汇率\\n 6 2024-11-16 2024-11-13 1.0 SC内外价差\\n 5 2024-11-17 2024-11-14 1.0 VLCC:中东-中国\\n 5 2024-11-17 2024-11-14 1.0 WTI连24合约\\n 5 2024-11-17 2024-11-14 1.0 Suezmax阿拉伯海湾-地中海\\n 5 2024-11-17 2024-11-14 1.0 ICEBrentc14\\n 5 2024-11-17 2024-11-14 1.0 OMAN原油中质远期现货DES价山东\\n 5 2024-11-17 2024-11-14 1.0 Brent-TI\\n 5 2024-11-17 2024-11-14 1.0 美国MARS贴水WTI\\n 5 2024-11-17 2024-11-14 1.0 Brent现货价格-Brent连3\\n 5 2024-11-17 2024-11-14 1.0 lmcads03lmecomdty\\n 5 2024-11-17 2024-11-14 1.0 布伦特现货价格-Brent连2\\n 5 2024-11-17 2024-11-14 1.0 美国MARS原油现货价格\\n 5 2024-11-17 2024-11-14 1.0 LLS原油现货价格\\n 5 2024-11-17 2024-11-14 1.0 Brent原油现货价格\\n 5 2024-11-17 2024-11-14 1.0 WTI原油现货价格Cushing\\n 5 2024-11-17 2024-11-14 1.0 欧洲柴油现货价格\\n 5 2024-11-17 2024-11-14 1.0 Midland原油现货价格\\n 5 2024-11-17 2024-11-14 1.0 美湾低硫柴油现货价格\\n 5 2024-11-17 2024-11-14 1.0 美国MEH轻原油现货价格美湾\\n 5 2024-11-17 2024-11-14 1.0 Brent现货价格-Brent连4\\n 5 2024-11-17 2024-11-14 1.0 DFL\\n 5 2024-11-17 2024-11-14 1.0 WTI原油Cushing-C1\\n 5 2024-11-17 2024-11-14 1.0 LLS-Brent价差\\n 3 2024-11-16 2024-11-01 7.0 美国取暖用油库存同差', 'WARNING_DATE': '2024-11-19 11:14:08'}}\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"{\"confirmFlg\":false,\"data\":true,\"status\":true}\n"
]
}
],
"source": [
"# def upload_warning_data(token, warning_data):\n",
"warning_data = warning_data\n",
"headers = {\"Authorization\": token}\n",
"logger.info(\"预警上传中...\")\n",
"logger.info(f\"token:{token}\")\n",
"logger.info(f\"warning_data:{warning_data}\" )\n",
"upload_res = requests.post(url=upload_warning_url, headers=headers, json=warning_data, timeout=(3, 15))\n",
"print(upload_res.text)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1d47fe3c",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "0baedf8f-3f6a-47c6-808d-c3363662f90f",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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": 5
}