oafuncs 0.0.98.49__tar.gz → 0.0.98.51__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. {oafuncs-0.0.98.49/oafuncs.egg-info → oafuncs-0.0.98.51}/PKG-INFO +1 -1
  2. oafuncs-0.0.98.51/oafuncs/_script/email.py +48 -0
  3. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/oa_tool.py +4 -4
  4. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51/oafuncs.egg-info}/PKG-INFO +1 -1
  5. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/setup.py +1 -1
  6. oafuncs-0.0.98.49/oafuncs/_script/email.py +0 -96
  7. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/LICENSE.txt +0 -0
  8. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/MANIFEST.in +0 -0
  9. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/README.md +0 -0
  10. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/__init__.py +0 -0
  11. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/_data/hycom.png +0 -0
  12. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/_data/oafuncs.png +0 -0
  13. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/_script/cprogressbar.py +0 -0
  14. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/_script/data_interp.py +0 -0
  15. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/_script/netcdf_merge.py +0 -0
  16. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/_script/netcdf_modify.py +0 -0
  17. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/_script/netcdf_write.py +0 -0
  18. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/_script/parallel.py +0 -0
  19. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/_script/parallel_bak.py +0 -0
  20. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/_script/plot_dataset.py +0 -0
  21. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/_script/replace_file_content.py +0 -0
  22. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/oa_cmap.py +0 -0
  23. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/oa_data.py +0 -0
  24. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/oa_date.py +0 -0
  25. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/oa_down/User_Agent-list.txt +0 -0
  26. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/oa_down/__init__.py +0 -0
  27. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/oa_down/hycom_3hourly.py +0 -0
  28. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/oa_down/idm.py +0 -0
  29. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/oa_down/literature.py +0 -0
  30. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/oa_down/read_proxy.py +0 -0
  31. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/oa_down/test_ua.py +0 -0
  32. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/oa_down/user_agent.py +0 -0
  33. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/oa_draw.py +0 -0
  34. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/oa_file.py +0 -0
  35. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/oa_geo.py +0 -0
  36. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/oa_help.py +0 -0
  37. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/oa_linux.py +0 -0
  38. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/oa_model/__init__.py +0 -0
  39. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/oa_model/roms/__init__.py +0 -0
  40. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/oa_model/roms/test.py +0 -0
  41. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/oa_model/wrf/__init__.py +0 -0
  42. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/oa_model/wrf/little_r.py +0 -0
  43. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/oa_nc.py +0 -0
  44. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/oa_python.py +0 -0
  45. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/oa_sign/__init__.py +0 -0
  46. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/oa_sign/meteorological.py +0 -0
  47. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/oa_sign/ocean.py +0 -0
  48. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs/oa_sign/scientific.py +0 -0
  49. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs.egg-info/SOURCES.txt +0 -0
  50. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs.egg-info/dependency_links.txt +0 -0
  51. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs.egg-info/requires.txt +0 -0
  52. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/oafuncs.egg-info/top_level.txt +0 -0
  53. {oafuncs-0.0.98.49 → oafuncs-0.0.98.51}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oafuncs
3
- Version: 0.0.98.49
3
+ Version: 0.0.98.51
4
4
  Summary: Oceanic and Atmospheric Functions
5
5
  Home-page: https://github.com/Industry-Pays/OAFuncs
6
6
  Author: Kun Liu
@@ -0,0 +1,48 @@
1
+ from rich import print
2
+
3
+
4
+
5
+ def _send_message(msg_from, password, msg_to, title, content):
6
+ from email.header import Header
7
+ from email.mime.multipart import MIMEMultipart
8
+ from email.mime.text import MIMEText
9
+ import smtplib
10
+ # 1. 连接邮箱服务器
11
+ con = smtplib.SMTP_SSL("smtp.qq.com", 465)
12
+
13
+ # 2. 登录邮箱
14
+ # msg_from, password = _email_info()
15
+ # con.login(msg_from, _decode_password(password))
16
+ con.login(msg_from, password)
17
+
18
+ # 3. 准备数据
19
+ # 创建邮件对象
20
+ msg = MIMEMultipart()
21
+
22
+ # 设置邮件主题
23
+ subject = Header(title, "utf-8").encode()
24
+ msg["Subject"] = subject
25
+
26
+ # 设置邮件发送者
27
+ msg["From"] = msg_from
28
+
29
+ # 设置邮件接受者
30
+ msg["To"] = msg_to
31
+
32
+ # or
33
+ # content = '发送内容'
34
+ msg.attach(MIMEText(content, "plain", "utf-8"))
35
+
36
+ # 4.发送邮件
37
+ con.sendmail(msg_from, msg_to, msg.as_string())
38
+ con.quit()
39
+
40
+ print(f"已通过{msg_from}成功向{msg_to}发送邮件!")
41
+ print("发送内容为:\n{}\n\n".format(content))
42
+
43
+
44
+
45
+
46
+
47
+ if __name__ == "__main__":
48
+ pass
@@ -118,7 +118,7 @@ class PEx(ParallelExecutor):
118
118
 
119
119
 
120
120
 
121
- def email(title: str = "Title", content: Optional[str] = None, send_to: str = "10001@qq.com") -> None:
121
+ def email(email_from, email_pwd, email_to, title = None, content = None) -> None:
122
122
  """
123
123
  Send an email using the specified title, content, and recipient.
124
124
 
@@ -127,10 +127,10 @@ def email(title: str = "Title", content: Optional[str] = None, send_to: str = "1
127
127
  content (Optional[str]): The content of the email. Defaults to None.
128
128
  send_to (str): The recipient's email address. Defaults to "10001@qq.com".
129
129
  """
130
- from ._script.email import send
130
+ from ._script.email import _send_message
131
131
 
132
- print(f"[green]Sending email to {send_to} with title: {title}[/green]")
133
- send(title, content, send_to)
132
+ print(f"[green]Sending email to {email_to} with title: {title}[/green]")
133
+ _send_message(email_from, email_pwd, email_to, title, content)
134
134
 
135
135
 
136
136
  def pbar(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oafuncs
3
- Version: 0.0.98.49
3
+ Version: 0.0.98.51
4
4
  Summary: Oceanic and Atmospheric Functions
5
5
  Home-page: https://github.com/Industry-Pays/OAFuncs
6
6
  Author: Kun Liu
@@ -18,7 +18,7 @@ URL = "https://github.com/Industry-Pays/OAFuncs"
18
18
  EMAIL = "liukun0312@stu.ouc.edu.cn"
19
19
  AUTHOR = "Kun Liu"
20
20
  REQUIRES_PYTHON = ">=3.10.0" # 2025/03/13
21
- VERSION = "0.0.98.49"
21
+ VERSION = "0.0.98.51"
22
22
 
23
23
  # What packages are required for this module to be executed?
24
24
  REQUIRED = [
@@ -1,96 +0,0 @@
1
- from rich import print
2
-
3
- __all__ = ["send"]
4
-
5
- def _email_info():
6
- import random
7
- email_dict = {
8
- "liukun0312@vip.qq.com": [4, 13, -10, 2, -10, 4, -7, -8, 8, -1, 3, -2, -11, -6, -9, -7],
9
- "756866877@qq.com": [4, -2, -3, 13, 12, 8, -6, 9, -12, 13, -10, -12, -11, -12, -4, -11],
10
- "99138763@qq.com": [0, 6, 12, 2, 9, 9, 4, -1, 11, -7, -12, 6, -11, -3, -5, -11],
11
- "1031260@qq.com": [-1, -5, -9, 9, -3, 4, -8, -7, -12, -2, 0, -9, -11, -3, -7, -10],
12
- }
13
- keys = list(email_dict.keys())
14
- choose_email = random.randint(0, len(keys) - 1)
15
- msg_from = keys[choose_email]
16
- return msg_from, email_dict[msg_from]
17
-
18
-
19
- def _decode_password(password):
20
- return "".join([chr(i + 109) for i in password])
21
-
22
-
23
- def _send_message(title, content, msg_to):
24
- from email.header import Header
25
- from email.mime.multipart import MIMEMultipart
26
- from email.mime.text import MIMEText
27
- import smtplib
28
- # 1. 连接邮箱服务器
29
- con = smtplib.SMTP_SSL("smtp.qq.com", 465)
30
-
31
- # 2. 登录邮箱
32
- msg_from, password = _email_info()
33
- con.login(msg_from, _decode_password(password))
34
-
35
- # 3. 准备数据
36
- # 创建邮件对象
37
- msg = MIMEMultipart()
38
-
39
- # 设置邮件主题
40
- subject = Header(title, "utf-8").encode()
41
- msg["Subject"] = subject
42
-
43
- # 设置邮件发送者
44
- msg["From"] = msg_from
45
-
46
- # 设置邮件接受者
47
- msg["To"] = msg_to
48
-
49
- # # 添加html内容
50
- # content = """
51
- # <h2>我是正文中的标题</h2>
52
- # <p>邮件正文描述性文字1</p>
53
- # <p>邮件正文描述性文字2</p>
54
- # <img src='https://www.baidu.com/img/bd_logo1.png'>
55
- # <center>百度图片</center>
56
- # <a href='https://www.baidu.com'>百度一下</a>
57
- # """
58
- # html = MIMEText(content, 'html', 'utf-8')
59
- # msg.attach(html)
60
-
61
- # or
62
- # content = '发送内容'
63
- msg.attach(MIMEText(content, "plain", "utf-8"))
64
-
65
- # 4.发送邮件
66
- con.sendmail(msg_from, msg_to, msg.as_string())
67
- con.quit()
68
-
69
- print(f"已通过{msg_from}成功向{msg_to}发送邮件!")
70
- print("发送内容为:\n{}\n\n".format(content))
71
-
72
-
73
- def send(title="Title", content=None, send_to="16031215@qq.com"):
74
- """
75
- Description: 发送邮件
76
-
77
- Args:
78
- title: 邮件标题
79
- content: 邮件内容
80
- send_to: 发送对象
81
-
82
- Returns:
83
- None
84
-
85
- Example:
86
- send(title='Title', content='Content', '123@qq.com')
87
- """
88
- if content is None:
89
- # 避免发送空邮件,或有人误调用
90
- return
91
- else:
92
- _send_message(title, content, send_to)
93
-
94
-
95
- if __name__ == "__main__":
96
- send()
File without changes
File without changes
File without changes
File without changes