diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e8baec8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +*.yml +!config.yml +*.token +*.zip +**/__pycache__ +/.idea/ +venv/ + + + diff --git a/module/API_24hour_weathers.py b/module/API_24hour_weathers.py new file mode 100644 index 0000000..539c963 --- /dev/null +++ b/module/API_24hour_weathers.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python +# -- coding:utf-8 -- +# @Author: markushammered@gmail.com +# @Development Tool: PyCharm +# @Create Time: 2021/10/31 +# @File Name: API_24hour_weathers.py + +""" +获取未来24小时时级天气预报 (24) +启用等级: DEV +""" + +import requests +import json + + +def hourly_weather(location: int, key: str, lang: str = 'zh', unit: str = 'm'): + r = requests.get( + f'https://devapi.qweather.com/v7/weather/24h?location={location}&key={key}&lang={lang}&unit={unit}') + data = json.loads(r.text) + + status_code = data['code'] + updateTime = str(data['updateTime'][:-6]).replace('T', '') + main_data = data['hourly'] # 24 + return status_code, updateTime, main_data + diff --git a/module/API_Indices.py b/module/API_Indices.py new file mode 100644 index 0000000..4be2149 --- /dev/null +++ b/module/API_Indices.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python +# -- coding:utf-8 -- +# @Author: markushammered@gmail.com +# @Development Tool: PyCharm +# @Create Time: 2021/10/31 +# @File Name: API_indices.py + +""" +获取生活建议的API +获取所有生活建议 (15+) +启用等级: DEV +""" + +import requests +import json + + +def indices(location: int, key: str, lang: str = 'zh', unit: str = 'm'): + r = requests.get( + f'https://devapi.qweather.com/v7/indices/1d?type=0&location={location}&key={key}&lang={lang}&unit={unit}') + data = json.loads(r.text) + status_code = data['code'] + updateTime = str(data['updateTime'][:-6]).replace('T', '') + main_data = data['daily'] # 1-15(+) + return status_code, updateTime, main_data + diff --git a/module/API_get_warning_list.py b/module/API_get_warning_list.py new file mode 100644 index 0000000..766079e --- /dev/null +++ b/module/API_get_warning_list.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# @Author: markushammered@gmail.com +# @Development Tool: PyCharm +# @Create Time: 2021/9/29 +# @File Name: API_get_warning_list.py: + +""" +开发版key使用此API可以快速返回正在预警的城市id +Only Dev-mode +""" + +import requests +import json +from ruamel.yaml import YAML + + +def get_warning_list(_range='cn'): + yaml = YAML() + with open('./config.yml', 'r', encoding='utf-8') as f: + config = yaml.load(f.read()) + key = config['request-settings']['key'] + session = requests.Session() + session.trust_env = False + r = session.get(f'https://devapi.qweather.com/v7/warning/list?range={_range}&key={key}') + _data = json.loads(r.text) + return _data['code'], _data['warningLocList'][0]['locationId'] diff --git a/module/API_real_time_air_quality.py b/module/API_real_time_air_quality.py new file mode 100644 index 0000000..d0bf76c --- /dev/null +++ b/module/API_real_time_air_quality.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# @Author: markushammered@gmail.com +# @Development Tool: PyCharm +# @Create Time: 2021/9/29 +# @File Name: API_real_time_air_quality.py + +""" +开发版key获取实时空气质量 +only: Dev-mode +""" + +import requests +import json +import sys +from ruamel.yaml import YAML + + +def real_time_air_quality(): + yaml = YAML() + with open(sys.path[1] + '/config.yml', 'r', encoding='utf-8') as f: + config = yaml.load(f.read()) + + mode = config['request-settings']['mode'] + key = config['request-settings']['key'] + location = config['request-settings']['location'] + unit = config['request-settings']['unit'] + lang = config['request-settings']['lang'] + + if mode != 'dev': + return False, print('Only Dev-mode') + session = requests.Session() + session.trust_env = False + r = session.get(f'https://devapi.qweather.com/v7/air/now?' + f'location={location}config.yml&key={key}&lang={lang}&unit={unit}&gzip=y') + _data = json.loads(r.text) + + return _data['code'], _data['now'] diff --git a/module/__init__.py b/module/__init__.py new file mode 100644 index 0000000..2bda7d2 --- /dev/null +++ b/module/__init__.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# @Author: markushammered@gmail.com +# @Development Tool: PyCharm +# @Create Time: 2021/10/16 +# @File Name: __init__.py diff --git a/resource/China-City-List.xlsx b/resource/China-City-List.xlsx new file mode 100644 index 0000000..9752d03 Binary files /dev/null and b/resource/China-City-List.xlsx differ diff --git a/resource/extra-icon/sunrise.png b/resource/extra-icon/sunrise.png new file mode 100644 index 0000000..5cbe9f7 Binary files /dev/null and b/resource/extra-icon/sunrise.png differ diff --git a/resource/extra-icon/sunset.png b/resource/extra-icon/sunset.png new file mode 100644 index 0000000..2e8a73d Binary files /dev/null and b/resource/extra-icon/sunset.png differ diff --git a/resource/lang/en_us.json b/resource/lang/en_us.json new file mode 100644 index 0000000..2580ba1 --- /dev/null +++ b/resource/lang/en_us.json @@ -0,0 +1,39 @@ +{ + "request_result_weather": "Weather API request result", + "request_result_indices": "Indices request result", + "request_result_warning": "Warning API request result", + "indices_tip": "No indices", + "mail_error": "Mail sending error Error reason", + "running": "Running Send mode", + "send_time": "Send time", + "mail_succeed": "Mail sending succeed.", + "config_not_filled": "Config file has no filled item(s).", + "statement_1": "Do not modify the configuration file at will.", + "statement_2": "All requests for this project are made using the local network.", + "statement_3": "If you used a VPN or PROXY, it will doesn't work.", + "statement_4": "If you have seen this message, the program runs normally.", + "debug_done": "Execution completed.", + "new_warning": "Get new disaster warning", + "warning_updated": "Disaster warning has been updated", + "area": "Area", + "weather": "Weather", + "sender": "Sender Account", + "date": "Date", + "lowestTemp": "LowestTemp", + "highestTemp": "HighestTemp", + "wind_info": "WindSpeed/Level/Dir", + "humidity": "Humidity", + "uv_info": "UV", + "vis": "Visibility", + "pressure": "Pressure", + "cloud": "Cloud", + "subject_7": "7 Day's weather report", + "subject_3": "3 Day's weather report", + "subject_war": "Natural disaster warning", + "release_time": "Release time", + "early_warning": "Early warning", + "warning_status": "Warning status", + "warning_type": "Warning type", + "warning_duration": "Duration", + "wait_seconds": "Wait 61 seconds..." +} diff --git a/resource/lang/zh_cn.json b/resource/lang/zh_cn.json new file mode 100644 index 0000000..a55240c --- /dev/null +++ b/resource/lang/zh_cn.json @@ -0,0 +1,39 @@ +{ + "request_result_weather": "天气信息请求结果", + "request_result_indices": "生活建议请求结果", + "request_result_warning": "自然灾害API请求结果", + "indices_tip": "无具体描述", + "mail_error": "邮件发送错误 错误原因", + "running": "运行中 发送模式", + "send_time": "发送时间", + "mail_succeed": "邮件发送成功", + "config_not_filled": "配置文件填写错误", + "statement_1": "配置文件请不要随意修改", + "statement_2": "本项目所有程序均使用本地网络进行请求", + "statement_3": "如果使用了VPN或代理将不会生效", + "statement_4": "如果你看到这段话就说明程序在正常运行", + "debug_done": "执行完成", + "new_warning": "获取到新的灾害预警", + "warning_updated": "灾害预警信息已更新", + "area": "地区", + "weather": "天气", + "sender": "发送者账号", + "date": "日期", + "lowestTemp": "最低气温", + "highestTemp": "最高气温", + "wind_info": "风速/级/向", + "humidity": "空气湿度", + "uv_info": "紫外线强度", + "vis": "能见度", + "pressure": "气压", + "cloud": "云量", + "subject_7": "7天天气预报", + "subject_3": "3天天气预报", + "subject_war": "自然灾害预报", + "release_time": "发布时间", + "early_warning": "预警", + "warning_status": "灾害状态", + "warning_type": "灾害类型", + "warning_duration": "持续时间", + "wait_seconds": "等待61秒..." +} diff --git a/resource/style1/100.png b/resource/style1/100.png new file mode 100644 index 0000000..82c24cb Binary files /dev/null and b/resource/style1/100.png differ diff --git a/resource/style1/101.png b/resource/style1/101.png new file mode 100644 index 0000000..fb3cca2 Binary files /dev/null and b/resource/style1/101.png differ diff --git a/resource/style1/102.png b/resource/style1/102.png new file mode 100644 index 0000000..39361c5 Binary files /dev/null and b/resource/style1/102.png differ diff --git a/resource/style1/103.png b/resource/style1/103.png new file mode 100644 index 0000000..460eb65 Binary files /dev/null and b/resource/style1/103.png differ diff --git a/resource/style1/104.png b/resource/style1/104.png new file mode 100644 index 0000000..63ce008 Binary files /dev/null and b/resource/style1/104.png differ diff --git a/resource/style1/150.png b/resource/style1/150.png new file mode 100644 index 0000000..1161117 Binary files /dev/null and b/resource/style1/150.png differ diff --git a/resource/style1/153.png b/resource/style1/153.png new file mode 100644 index 0000000..731d235 Binary files /dev/null and b/resource/style1/153.png differ diff --git a/resource/style1/154.png b/resource/style1/154.png new file mode 100644 index 0000000..d16a4a7 Binary files /dev/null and b/resource/style1/154.png differ diff --git a/resource/style1/300.png b/resource/style1/300.png new file mode 100644 index 0000000..f9293aa Binary files /dev/null and b/resource/style1/300.png differ diff --git a/resource/style1/301.png b/resource/style1/301.png new file mode 100644 index 0000000..64b92b6 Binary files /dev/null and b/resource/style1/301.png differ diff --git a/resource/style1/302.png b/resource/style1/302.png new file mode 100644 index 0000000..d6b1b0c Binary files /dev/null and b/resource/style1/302.png differ diff --git a/resource/style1/303.png b/resource/style1/303.png new file mode 100644 index 0000000..c64df87 Binary files /dev/null and b/resource/style1/303.png differ diff --git a/resource/style1/304.png b/resource/style1/304.png new file mode 100644 index 0000000..abb9712 Binary files /dev/null and b/resource/style1/304.png differ diff --git a/resource/style1/305.png b/resource/style1/305.png new file mode 100644 index 0000000..6750078 Binary files /dev/null and b/resource/style1/305.png differ diff --git a/resource/style1/306.png b/resource/style1/306.png new file mode 100644 index 0000000..ee4be32 Binary files /dev/null and b/resource/style1/306.png differ diff --git a/resource/style1/307.png b/resource/style1/307.png new file mode 100644 index 0000000..9e10466 Binary files /dev/null and b/resource/style1/307.png differ diff --git a/resource/style1/308.png b/resource/style1/308.png new file mode 100644 index 0000000..b1c2272 Binary files /dev/null and b/resource/style1/308.png differ diff --git a/resource/style1/309.png b/resource/style1/309.png new file mode 100644 index 0000000..b1ab74f Binary files /dev/null and b/resource/style1/309.png differ diff --git a/resource/style1/310.png b/resource/style1/310.png new file mode 100644 index 0000000..3756c09 Binary files /dev/null and b/resource/style1/310.png differ diff --git a/resource/style1/311.png b/resource/style1/311.png new file mode 100644 index 0000000..c90f2e2 Binary files /dev/null and b/resource/style1/311.png differ diff --git a/resource/style1/312.png b/resource/style1/312.png new file mode 100644 index 0000000..8f57720 Binary files /dev/null and b/resource/style1/312.png differ diff --git a/resource/style1/313.png b/resource/style1/313.png new file mode 100644 index 0000000..2556d3c Binary files /dev/null and b/resource/style1/313.png differ diff --git a/resource/style1/314.png b/resource/style1/314.png new file mode 100644 index 0000000..d40f1a4 Binary files /dev/null and b/resource/style1/314.png differ diff --git a/resource/style1/315.png b/resource/style1/315.png new file mode 100644 index 0000000..6ecbaa7 Binary files /dev/null and b/resource/style1/315.png differ diff --git a/resource/style1/316.png b/resource/style1/316.png new file mode 100644 index 0000000..c915840 Binary files /dev/null and b/resource/style1/316.png differ diff --git a/resource/style1/317.png b/resource/style1/317.png new file mode 100644 index 0000000..cce37da Binary files /dev/null and b/resource/style1/317.png differ diff --git a/resource/style1/318.png b/resource/style1/318.png new file mode 100644 index 0000000..c9d5f54 Binary files /dev/null and b/resource/style1/318.png differ diff --git a/resource/style1/350.png b/resource/style1/350.png new file mode 100644 index 0000000..9ede068 Binary files /dev/null and b/resource/style1/350.png differ diff --git a/resource/style1/351.png b/resource/style1/351.png new file mode 100644 index 0000000..346f6b5 Binary files /dev/null and b/resource/style1/351.png differ diff --git a/resource/style1/399.png b/resource/style1/399.png new file mode 100644 index 0000000..3233c67 Binary files /dev/null and b/resource/style1/399.png differ diff --git a/resource/style1/400.png b/resource/style1/400.png new file mode 100644 index 0000000..862df64 Binary files /dev/null and b/resource/style1/400.png differ diff --git a/resource/style1/401.png b/resource/style1/401.png new file mode 100644 index 0000000..dae37c3 Binary files /dev/null and b/resource/style1/401.png differ diff --git a/resource/style1/402.png b/resource/style1/402.png new file mode 100644 index 0000000..5dcf437 Binary files /dev/null and b/resource/style1/402.png differ diff --git a/resource/style1/403.png b/resource/style1/403.png new file mode 100644 index 0000000..db19739 Binary files /dev/null and b/resource/style1/403.png differ diff --git a/resource/style1/404.png b/resource/style1/404.png new file mode 100644 index 0000000..49c9fb8 Binary files /dev/null and b/resource/style1/404.png differ diff --git a/resource/style1/405.png b/resource/style1/405.png new file mode 100644 index 0000000..c716ae4 Binary files /dev/null and b/resource/style1/405.png differ diff --git a/resource/style1/406.png b/resource/style1/406.png new file mode 100644 index 0000000..37a30ca Binary files /dev/null and b/resource/style1/406.png differ diff --git a/resource/style1/407.png b/resource/style1/407.png new file mode 100644 index 0000000..b472dcd Binary files /dev/null and b/resource/style1/407.png differ diff --git a/resource/style1/408.png b/resource/style1/408.png new file mode 100644 index 0000000..319dbf8 Binary files /dev/null and b/resource/style1/408.png differ diff --git a/resource/style1/409.png b/resource/style1/409.png new file mode 100644 index 0000000..7052b6a Binary files /dev/null and b/resource/style1/409.png differ diff --git a/resource/style1/410.png b/resource/style1/410.png new file mode 100644 index 0000000..baf6d84 Binary files /dev/null and b/resource/style1/410.png differ diff --git a/resource/style1/456.png b/resource/style1/456.png new file mode 100644 index 0000000..2163358 Binary files /dev/null and b/resource/style1/456.png differ diff --git a/resource/style1/457.png b/resource/style1/457.png new file mode 100644 index 0000000..d41863d Binary files /dev/null and b/resource/style1/457.png differ diff --git a/resource/style1/499.png b/resource/style1/499.png new file mode 100644 index 0000000..92135ef Binary files /dev/null and b/resource/style1/499.png differ diff --git a/resource/style1/500.png b/resource/style1/500.png new file mode 100644 index 0000000..babeb3d Binary files /dev/null and b/resource/style1/500.png differ diff --git a/resource/style1/501.png b/resource/style1/501.png new file mode 100644 index 0000000..52dacd7 Binary files /dev/null and b/resource/style1/501.png differ diff --git a/resource/style1/502.png b/resource/style1/502.png new file mode 100644 index 0000000..b40651f Binary files /dev/null and b/resource/style1/502.png differ diff --git a/resource/style1/503.png b/resource/style1/503.png new file mode 100644 index 0000000..da36fc7 Binary files /dev/null and b/resource/style1/503.png differ diff --git a/resource/style1/504.png b/resource/style1/504.png new file mode 100644 index 0000000..8cf67ef Binary files /dev/null and b/resource/style1/504.png differ diff --git a/resource/style1/507.png b/resource/style1/507.png new file mode 100644 index 0000000..0e96b03 Binary files /dev/null and b/resource/style1/507.png differ diff --git a/resource/style1/508.png b/resource/style1/508.png new file mode 100644 index 0000000..32c06f2 Binary files /dev/null and b/resource/style1/508.png differ diff --git a/resource/style1/509.png b/resource/style1/509.png new file mode 100644 index 0000000..2518d60 Binary files /dev/null and b/resource/style1/509.png differ diff --git a/resource/style1/510.png b/resource/style1/510.png new file mode 100644 index 0000000..780d3f7 Binary files /dev/null and b/resource/style1/510.png differ diff --git a/resource/style1/511.png b/resource/style1/511.png new file mode 100644 index 0000000..895a217 Binary files /dev/null and b/resource/style1/511.png differ diff --git a/resource/style1/512.png b/resource/style1/512.png new file mode 100644 index 0000000..1a7eecd Binary files /dev/null and b/resource/style1/512.png differ diff --git a/resource/style1/513.png b/resource/style1/513.png new file mode 100644 index 0000000..bcce320 Binary files /dev/null and b/resource/style1/513.png differ diff --git a/resource/style1/514.png b/resource/style1/514.png new file mode 100644 index 0000000..2d3e466 Binary files /dev/null and b/resource/style1/514.png differ diff --git a/resource/style1/515.png b/resource/style1/515.png new file mode 100644 index 0000000..4e597a1 Binary files /dev/null and b/resource/style1/515.png differ diff --git a/resource/style1/900.png b/resource/style1/900.png new file mode 100644 index 0000000..5754e9e Binary files /dev/null and b/resource/style1/900.png differ diff --git a/resource/style1/901.png b/resource/style1/901.png new file mode 100644 index 0000000..8242ca5 Binary files /dev/null and b/resource/style1/901.png differ diff --git a/resource/style1/999.png b/resource/style1/999.png new file mode 100644 index 0000000..39a536f Binary files /dev/null and b/resource/style1/999.png differ diff --git a/resource/style2/100.png b/resource/style2/100.png new file mode 100644 index 0000000..c07f8d3 Binary files /dev/null and b/resource/style2/100.png differ diff --git a/resource/style2/101.png b/resource/style2/101.png new file mode 100644 index 0000000..5639f12 Binary files /dev/null and b/resource/style2/101.png differ diff --git a/resource/style2/102.png b/resource/style2/102.png new file mode 100644 index 0000000..8104e04 Binary files /dev/null and b/resource/style2/102.png differ diff --git a/resource/style2/103.png b/resource/style2/103.png new file mode 100644 index 0000000..fce779b Binary files /dev/null and b/resource/style2/103.png differ diff --git a/resource/style2/104.png b/resource/style2/104.png new file mode 100644 index 0000000..567e4cc Binary files /dev/null and b/resource/style2/104.png differ diff --git a/resource/style2/150.png b/resource/style2/150.png new file mode 100644 index 0000000..d9c79e9 Binary files /dev/null and b/resource/style2/150.png differ diff --git a/resource/style2/153.png b/resource/style2/153.png new file mode 100644 index 0000000..f29fd43 Binary files /dev/null and b/resource/style2/153.png differ diff --git a/resource/style2/154.png b/resource/style2/154.png new file mode 100644 index 0000000..c8c5765 Binary files /dev/null and b/resource/style2/154.png differ diff --git a/resource/style2/300.png b/resource/style2/300.png new file mode 100644 index 0000000..22fafcc Binary files /dev/null and b/resource/style2/300.png differ diff --git a/resource/style2/301.png b/resource/style2/301.png new file mode 100644 index 0000000..5f53310 Binary files /dev/null and b/resource/style2/301.png differ diff --git a/resource/style2/302.png b/resource/style2/302.png new file mode 100644 index 0000000..3ba5e0f Binary files /dev/null and b/resource/style2/302.png differ diff --git a/resource/style2/303.png b/resource/style2/303.png new file mode 100644 index 0000000..becc44e Binary files /dev/null and b/resource/style2/303.png differ diff --git a/resource/style2/304.png b/resource/style2/304.png new file mode 100644 index 0000000..3803276 Binary files /dev/null and b/resource/style2/304.png differ diff --git a/resource/style2/305.png b/resource/style2/305.png new file mode 100644 index 0000000..178da49 Binary files /dev/null and b/resource/style2/305.png differ diff --git a/resource/style2/306.png b/resource/style2/306.png new file mode 100644 index 0000000..6d70ea8 Binary files /dev/null and b/resource/style2/306.png differ diff --git a/resource/style2/307.png b/resource/style2/307.png new file mode 100644 index 0000000..fc56477 Binary files /dev/null and b/resource/style2/307.png differ diff --git a/resource/style2/308.png b/resource/style2/308.png new file mode 100644 index 0000000..1e79c94 Binary files /dev/null and b/resource/style2/308.png differ diff --git a/resource/style2/309.png b/resource/style2/309.png new file mode 100644 index 0000000..96c9152 Binary files /dev/null and b/resource/style2/309.png differ diff --git a/resource/style2/310.png b/resource/style2/310.png new file mode 100644 index 0000000..2c12709 Binary files /dev/null and b/resource/style2/310.png differ diff --git a/resource/style2/311.png b/resource/style2/311.png new file mode 100644 index 0000000..ee18cd6 Binary files /dev/null and b/resource/style2/311.png differ diff --git a/resource/style2/312.png b/resource/style2/312.png new file mode 100644 index 0000000..bb743ea Binary files /dev/null and b/resource/style2/312.png differ diff --git a/resource/style2/313.png b/resource/style2/313.png new file mode 100644 index 0000000..8632dd7 Binary files /dev/null and b/resource/style2/313.png differ diff --git a/resource/style2/314.png b/resource/style2/314.png new file mode 100644 index 0000000..cfe5f32 Binary files /dev/null and b/resource/style2/314.png differ diff --git a/resource/style2/315.png b/resource/style2/315.png new file mode 100644 index 0000000..974efd6 Binary files /dev/null and b/resource/style2/315.png differ diff --git a/resource/style2/316.png b/resource/style2/316.png new file mode 100644 index 0000000..fa61a71 Binary files /dev/null and b/resource/style2/316.png differ diff --git a/resource/style2/317.png b/resource/style2/317.png new file mode 100644 index 0000000..7695fdb Binary files /dev/null and b/resource/style2/317.png differ diff --git a/resource/style2/318.png b/resource/style2/318.png new file mode 100644 index 0000000..b2a61f7 Binary files /dev/null and b/resource/style2/318.png differ diff --git a/resource/style2/350.png b/resource/style2/350.png new file mode 100644 index 0000000..8d337ea Binary files /dev/null and b/resource/style2/350.png differ diff --git a/resource/style2/351.png b/resource/style2/351.png new file mode 100644 index 0000000..94a5a27 Binary files /dev/null and b/resource/style2/351.png differ diff --git a/resource/style2/399.png b/resource/style2/399.png new file mode 100644 index 0000000..f969627 Binary files /dev/null and b/resource/style2/399.png differ diff --git a/resource/style2/400.png b/resource/style2/400.png new file mode 100644 index 0000000..fda5361 Binary files /dev/null and b/resource/style2/400.png differ diff --git a/resource/style2/401.png b/resource/style2/401.png new file mode 100644 index 0000000..600b4cd Binary files /dev/null and b/resource/style2/401.png differ diff --git a/resource/style2/402.png b/resource/style2/402.png new file mode 100644 index 0000000..f61015b Binary files /dev/null and b/resource/style2/402.png differ diff --git a/resource/style2/403.png b/resource/style2/403.png new file mode 100644 index 0000000..6179e81 Binary files /dev/null and b/resource/style2/403.png differ diff --git a/resource/style2/404.png b/resource/style2/404.png new file mode 100644 index 0000000..3a83170 Binary files /dev/null and b/resource/style2/404.png differ diff --git a/resource/style2/405.png b/resource/style2/405.png new file mode 100644 index 0000000..cd4c3f4 Binary files /dev/null and b/resource/style2/405.png differ diff --git a/resource/style2/406.png b/resource/style2/406.png new file mode 100644 index 0000000..625b2f9 Binary files /dev/null and b/resource/style2/406.png differ diff --git a/resource/style2/407.png b/resource/style2/407.png new file mode 100644 index 0000000..987cc5c Binary files /dev/null and b/resource/style2/407.png differ diff --git a/resource/style2/408.png b/resource/style2/408.png new file mode 100644 index 0000000..381499d Binary files /dev/null and b/resource/style2/408.png differ diff --git a/resource/style2/409.png b/resource/style2/409.png new file mode 100644 index 0000000..3f6b278 Binary files /dev/null and b/resource/style2/409.png differ diff --git a/resource/style2/410.png b/resource/style2/410.png new file mode 100644 index 0000000..facfd92 Binary files /dev/null and b/resource/style2/410.png differ diff --git a/resource/style2/456.png b/resource/style2/456.png new file mode 100644 index 0000000..885b94e Binary files /dev/null and b/resource/style2/456.png differ diff --git a/resource/style2/457.png b/resource/style2/457.png new file mode 100644 index 0000000..80fe07f Binary files /dev/null and b/resource/style2/457.png differ diff --git a/resource/style2/499.png b/resource/style2/499.png new file mode 100644 index 0000000..ae2472a Binary files /dev/null and b/resource/style2/499.png differ diff --git a/resource/style2/500.png b/resource/style2/500.png new file mode 100644 index 0000000..da204a3 Binary files /dev/null and b/resource/style2/500.png differ diff --git a/resource/style2/501.png b/resource/style2/501.png new file mode 100644 index 0000000..56d8def Binary files /dev/null and b/resource/style2/501.png differ diff --git a/resource/style2/502.png b/resource/style2/502.png new file mode 100644 index 0000000..aa677ab Binary files /dev/null and b/resource/style2/502.png differ diff --git a/resource/style2/503.png b/resource/style2/503.png new file mode 100644 index 0000000..73083bf Binary files /dev/null and b/resource/style2/503.png differ diff --git a/resource/style2/504.png b/resource/style2/504.png new file mode 100644 index 0000000..a66d12b Binary files /dev/null and b/resource/style2/504.png differ diff --git a/resource/style2/507.png b/resource/style2/507.png new file mode 100644 index 0000000..5651918 Binary files /dev/null and b/resource/style2/507.png differ diff --git a/resource/style2/508.png b/resource/style2/508.png new file mode 100644 index 0000000..3acb935 Binary files /dev/null and b/resource/style2/508.png differ diff --git a/resource/style2/509.png b/resource/style2/509.png new file mode 100644 index 0000000..0434eee Binary files /dev/null and b/resource/style2/509.png differ diff --git a/resource/style2/510.png b/resource/style2/510.png new file mode 100644 index 0000000..1276138 Binary files /dev/null and b/resource/style2/510.png differ diff --git a/resource/style2/511.png b/resource/style2/511.png new file mode 100644 index 0000000..5c55f88 Binary files /dev/null and b/resource/style2/511.png differ diff --git a/resource/style2/512.png b/resource/style2/512.png new file mode 100644 index 0000000..2364bb8 Binary files /dev/null and b/resource/style2/512.png differ diff --git a/resource/style2/513.png b/resource/style2/513.png new file mode 100644 index 0000000..c9942d5 Binary files /dev/null and b/resource/style2/513.png differ diff --git a/resource/style2/514.png b/resource/style2/514.png new file mode 100644 index 0000000..35f6bb9 Binary files /dev/null and b/resource/style2/514.png differ diff --git a/resource/style2/515.png b/resource/style2/515.png new file mode 100644 index 0000000..50c32e7 Binary files /dev/null and b/resource/style2/515.png differ diff --git a/resource/style2/900.png b/resource/style2/900.png new file mode 100644 index 0000000..1f2608d Binary files /dev/null and b/resource/style2/900.png differ diff --git a/resource/style2/901.png b/resource/style2/901.png new file mode 100644 index 0000000..b07eb01 Binary files /dev/null and b/resource/style2/901.png differ diff --git a/resource/style2/999.png b/resource/style2/999.png new file mode 100644 index 0000000..aae4622 Binary files /dev/null and b/resource/style2/999.png differ diff --git a/resource/style3/100.png b/resource/style3/100.png new file mode 100644 index 0000000..faf04c8 Binary files /dev/null and b/resource/style3/100.png differ diff --git a/resource/style3/101.png b/resource/style3/101.png new file mode 100644 index 0000000..17841e4 Binary files /dev/null and b/resource/style3/101.png differ diff --git a/resource/style3/102.png b/resource/style3/102.png new file mode 100644 index 0000000..51bc5a8 Binary files /dev/null and b/resource/style3/102.png differ diff --git a/resource/style3/103.png b/resource/style3/103.png new file mode 100644 index 0000000..5fd9957 Binary files /dev/null and b/resource/style3/103.png differ diff --git a/resource/style3/104.png b/resource/style3/104.png new file mode 100644 index 0000000..9628fbd Binary files /dev/null and b/resource/style3/104.png differ diff --git a/resource/style3/150.png b/resource/style3/150.png new file mode 100644 index 0000000..eaee769 Binary files /dev/null and b/resource/style3/150.png differ diff --git a/resource/style3/153.png b/resource/style3/153.png new file mode 100644 index 0000000..346a2c2 Binary files /dev/null and b/resource/style3/153.png differ diff --git a/resource/style3/154.png b/resource/style3/154.png new file mode 100644 index 0000000..358be1a Binary files /dev/null and b/resource/style3/154.png differ diff --git a/resource/style3/300.png b/resource/style3/300.png new file mode 100644 index 0000000..24ba9bc Binary files /dev/null and b/resource/style3/300.png differ diff --git a/resource/style3/301.png b/resource/style3/301.png new file mode 100644 index 0000000..ad65de8 Binary files /dev/null and b/resource/style3/301.png differ diff --git a/resource/style3/302.png b/resource/style3/302.png new file mode 100644 index 0000000..4a018ee Binary files /dev/null and b/resource/style3/302.png differ diff --git a/resource/style3/303.png b/resource/style3/303.png new file mode 100644 index 0000000..aa8d273 Binary files /dev/null and b/resource/style3/303.png differ diff --git a/resource/style3/304.png b/resource/style3/304.png new file mode 100644 index 0000000..3155a49 Binary files /dev/null and b/resource/style3/304.png differ diff --git a/resource/style3/305.png b/resource/style3/305.png new file mode 100644 index 0000000..f76f6e3 Binary files /dev/null and b/resource/style3/305.png differ diff --git a/resource/style3/306.png b/resource/style3/306.png new file mode 100644 index 0000000..ffb6804 Binary files /dev/null and b/resource/style3/306.png differ diff --git a/resource/style3/307.png b/resource/style3/307.png new file mode 100644 index 0000000..1e33073 Binary files /dev/null and b/resource/style3/307.png differ diff --git a/resource/style3/308.png b/resource/style3/308.png new file mode 100644 index 0000000..2586187 Binary files /dev/null and b/resource/style3/308.png differ diff --git a/resource/style3/309.png b/resource/style3/309.png new file mode 100644 index 0000000..9beebe3 Binary files /dev/null and b/resource/style3/309.png differ diff --git a/resource/style3/310.png b/resource/style3/310.png new file mode 100644 index 0000000..624b04e Binary files /dev/null and b/resource/style3/310.png differ diff --git a/resource/style3/311.png b/resource/style3/311.png new file mode 100644 index 0000000..5fcc3fc Binary files /dev/null and b/resource/style3/311.png differ diff --git a/resource/style3/312.png b/resource/style3/312.png new file mode 100644 index 0000000..0e93ff7 Binary files /dev/null and b/resource/style3/312.png differ diff --git a/resource/style3/313.png b/resource/style3/313.png new file mode 100644 index 0000000..ba783d6 Binary files /dev/null and b/resource/style3/313.png differ diff --git a/resource/style3/314.png b/resource/style3/314.png new file mode 100644 index 0000000..9e93846 Binary files /dev/null and b/resource/style3/314.png differ diff --git a/resource/style3/315.png b/resource/style3/315.png new file mode 100644 index 0000000..527e6fe Binary files /dev/null and b/resource/style3/315.png differ diff --git a/resource/style3/316.png b/resource/style3/316.png new file mode 100644 index 0000000..8309afb Binary files /dev/null and b/resource/style3/316.png differ diff --git a/resource/style3/317.png b/resource/style3/317.png new file mode 100644 index 0000000..2e9a702 Binary files /dev/null and b/resource/style3/317.png differ diff --git a/resource/style3/318.png b/resource/style3/318.png new file mode 100644 index 0000000..b99b851 Binary files /dev/null and b/resource/style3/318.png differ diff --git a/resource/style3/350.png b/resource/style3/350.png new file mode 100644 index 0000000..a9a0c52 Binary files /dev/null and b/resource/style3/350.png differ diff --git a/resource/style3/351.png b/resource/style3/351.png new file mode 100644 index 0000000..f7bdda3 Binary files /dev/null and b/resource/style3/351.png differ diff --git a/resource/style3/399.png b/resource/style3/399.png new file mode 100644 index 0000000..321233b Binary files /dev/null and b/resource/style3/399.png differ diff --git a/resource/style3/400.png b/resource/style3/400.png new file mode 100644 index 0000000..532879b Binary files /dev/null and b/resource/style3/400.png differ diff --git a/resource/style3/401.png b/resource/style3/401.png new file mode 100644 index 0000000..4a92fc7 Binary files /dev/null and b/resource/style3/401.png differ diff --git a/resource/style3/402.png b/resource/style3/402.png new file mode 100644 index 0000000..ccc2dab Binary files /dev/null and b/resource/style3/402.png differ diff --git a/resource/style3/403.png b/resource/style3/403.png new file mode 100644 index 0000000..da32ebe Binary files /dev/null and b/resource/style3/403.png differ diff --git a/resource/style3/404.png b/resource/style3/404.png new file mode 100644 index 0000000..99a3d9d Binary files /dev/null and b/resource/style3/404.png differ diff --git a/resource/style3/405.png b/resource/style3/405.png new file mode 100644 index 0000000..c3ac8d4 Binary files /dev/null and b/resource/style3/405.png differ diff --git a/resource/style3/406.png b/resource/style3/406.png new file mode 100644 index 0000000..01348b1 Binary files /dev/null and b/resource/style3/406.png differ diff --git a/resource/style3/407.png b/resource/style3/407.png new file mode 100644 index 0000000..37cdd78 Binary files /dev/null and b/resource/style3/407.png differ diff --git a/resource/style3/408.png b/resource/style3/408.png new file mode 100644 index 0000000..f8d216c Binary files /dev/null and b/resource/style3/408.png differ diff --git a/resource/style3/409.png b/resource/style3/409.png new file mode 100644 index 0000000..e7e729b Binary files /dev/null and b/resource/style3/409.png differ diff --git a/resource/style3/410.png b/resource/style3/410.png new file mode 100644 index 0000000..3e4dcf2 Binary files /dev/null and b/resource/style3/410.png differ diff --git a/resource/style3/456.png b/resource/style3/456.png new file mode 100644 index 0000000..1b080c7 Binary files /dev/null and b/resource/style3/456.png differ diff --git a/resource/style3/457.png b/resource/style3/457.png new file mode 100644 index 0000000..1b610d2 Binary files /dev/null and b/resource/style3/457.png differ diff --git a/resource/style3/499.png b/resource/style3/499.png new file mode 100644 index 0000000..c486a59 Binary files /dev/null and b/resource/style3/499.png differ diff --git a/resource/style3/500.png b/resource/style3/500.png new file mode 100644 index 0000000..dcecc31 Binary files /dev/null and b/resource/style3/500.png differ diff --git a/resource/style3/501.png b/resource/style3/501.png new file mode 100644 index 0000000..41fba52 Binary files /dev/null and b/resource/style3/501.png differ diff --git a/resource/style3/502.png b/resource/style3/502.png new file mode 100644 index 0000000..6ffda43 Binary files /dev/null and b/resource/style3/502.png differ diff --git a/resource/style3/503.png b/resource/style3/503.png new file mode 100644 index 0000000..f7e2296 Binary files /dev/null and b/resource/style3/503.png differ diff --git a/resource/style3/504.png b/resource/style3/504.png new file mode 100644 index 0000000..b26ea7b Binary files /dev/null and b/resource/style3/504.png differ diff --git a/resource/style3/507.png b/resource/style3/507.png new file mode 100644 index 0000000..43b1e6e Binary files /dev/null and b/resource/style3/507.png differ diff --git a/resource/style3/508.png b/resource/style3/508.png new file mode 100644 index 0000000..f932cd9 Binary files /dev/null and b/resource/style3/508.png differ diff --git a/resource/style3/509.png b/resource/style3/509.png new file mode 100644 index 0000000..b1a8adb Binary files /dev/null and b/resource/style3/509.png differ diff --git a/resource/style3/510.png b/resource/style3/510.png new file mode 100644 index 0000000..eecaf5d Binary files /dev/null and b/resource/style3/510.png differ diff --git a/resource/style3/511.png b/resource/style3/511.png new file mode 100644 index 0000000..b0bcd8e Binary files /dev/null and b/resource/style3/511.png differ diff --git a/resource/style3/512.png b/resource/style3/512.png new file mode 100644 index 0000000..0d98a13 Binary files /dev/null and b/resource/style3/512.png differ diff --git a/resource/style3/513.png b/resource/style3/513.png new file mode 100644 index 0000000..e1128ff Binary files /dev/null and b/resource/style3/513.png differ diff --git a/resource/style3/514.png b/resource/style3/514.png new file mode 100644 index 0000000..cb9adbc Binary files /dev/null and b/resource/style3/514.png differ diff --git a/resource/style3/515.png b/resource/style3/515.png new file mode 100644 index 0000000..2faa917 Binary files /dev/null and b/resource/style3/515.png differ diff --git a/resource/style3/900.png b/resource/style3/900.png new file mode 100644 index 0000000..cbdb3e7 Binary files /dev/null and b/resource/style3/900.png differ diff --git a/resource/style3/901.png b/resource/style3/901.png new file mode 100644 index 0000000..bc6d105 Binary files /dev/null and b/resource/style3/901.png differ diff --git a/resource/style3/999.png b/resource/style3/999.png new file mode 100644 index 0000000..4ce8569 Binary files /dev/null and b/resource/style3/999.png differ diff --git a/resource/type_warning.json b/resource/type_warning.json new file mode 100644 index 0000000..2697cf2 --- /dev/null +++ b/resource/type_warning.json @@ -0,0 +1,68 @@ +{ + "11B01": "台风", + "11B02": "龙卷风", + "11B03": "暴雨", + "11B04": "暴雪", + "11B05": "寒潮", + "11B06": "大风", + "11B07": "沙尘暴", + "11B08": "低温冻害", + "11B09": "高温", + "11B10": "热浪", + "11B11": "干热风", + "11B12": "下击暴流", + "11B13": "雪崩", + "11B14": "雷电", + "11B15": "冰雹", + "11B16": "霜冻", + "11B17": "大雾", + "11B18": "低空风切变", + "11B19": "霾", + "11B20": "雷雨大风", + "11B21": "道路结冰", + "11B22": "干旱", + "11B23": "海上大风", + "11B24": "高温中暑", + "11B25": "森林火险", + "11B26": "草原火险", + "11B27": "冰冻", + "11B28": "空间天气", + "11B29": "重污染", + "11B30": "低温雨雪冰冻", + "11B31": "强对流", + "11B32": "臭氧", + "11B33": "大雪", + "11B34": "寒冷", + "11B35": "连阴雨", + "11B36": "渍涝风险", + "11B37": "地质灾害气象风险", + "11B38": "强降雨", + "11B39": "强降温", + "11B40": "雪灾", + "11B41": "森林(草原)火险", + "11B42": "医疗气象", + "11B43": "雷暴", + "11B44": "停课信号", + "11B45": "停工信号", + "11B46": "海上风险", + "11B47": "春季沙尘天气", + "11B48": "降温", + "11B49": "台风暴雨", + "11B50": "严寒", + "11B51": "沙尘", + "11B52": "海上雷雨大风", + "11B53": "海上大雾", + "11B54": "海上雷电", + "11B55": "海上台风", + "11B56": "低温", + "11B57": "道路冰雪", + "11A01": "洪水", + "11B101": "大风", + "11B102": "强降雪和结冰", + "11B103": "大雾", + "11E101": "海岸风险", + "11B104": "森林火险", + "11B105": "雨", + "11A106": "大雨洪水", + "11B99": "其他" +} \ No newline at end of file diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..9ea392f --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python +# -- coding:utf-8 -- +# @Author: markushammered@gmail.com +# @Development Tool: PyCharm +# @Create Time: 2021/11/7 +# @File Name: __init__.py.py diff --git a/tests/get_location.py b/tests/get_location.py new file mode 100644 index 0000000..861707e --- /dev/null +++ b/tests/get_location.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# @Author: markushammered@gmail.com +# @Development Tool: PyCharm +# @Create Time: 2021/9/29 +# @File Name: get_location.py + + +import requests + + +def request(): + session = requests.Session() + session.trust_env = False + r = session.get('https://ip.tool.lu/', timeout=5).text + return {'IP:': r.split(':')[1].split()[0], 'Location': r.split(':')[2].split()} # return IP & Cities