lazysdk 0.1.110__py3-none-any.whl → 0.1.112__py3-none-any.whl
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.
- lazysdk/lazy_header.py +34 -0
- lazysdk/lazyre.py +2 -2
- lazysdk/lazyrequests.py +12 -6
- {lazysdk-0.1.110.dist-info → lazysdk-0.1.112.dist-info}/METADATA +15 -15
- {lazysdk-0.1.110.dist-info → lazysdk-0.1.112.dist-info}/RECORD +8 -7
- {lazysdk-0.1.110.dist-info → lazysdk-0.1.112.dist-info}/WHEEL +1 -1
- {lazysdk-0.1.110.dist-info → lazysdk-0.1.112.dist-info}/LICENSE +0 -0
- {lazysdk-0.1.110.dist-info → lazysdk-0.1.112.dist-info}/top_level.txt +0 -0
lazysdk/lazy_header.py
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
# coding = utf8
|
3
|
+
from lazysdk import showdata
|
4
|
+
|
5
|
+
def convert2dict(header_str: str):
|
6
|
+
header_temp = header_str.split('\n')
|
7
|
+
header_dict = dict()
|
8
|
+
for each in header_temp:
|
9
|
+
if len(each) == 0:
|
10
|
+
continue
|
11
|
+
else:
|
12
|
+
each_split = each.split(': ')
|
13
|
+
header_dict[each_split[0]] = each_split[1]
|
14
|
+
return header_dict
|
15
|
+
|
16
|
+
|
17
|
+
def get_lines():
|
18
|
+
lines = []
|
19
|
+
print("请输入多行数据,以空行结束:")
|
20
|
+
while True:
|
21
|
+
line = input()
|
22
|
+
if line:
|
23
|
+
lines.append(line)
|
24
|
+
else:
|
25
|
+
break
|
26
|
+
|
27
|
+
print("您输入的多行数据是:")
|
28
|
+
return "\n".join(lines)
|
29
|
+
|
30
|
+
|
31
|
+
if __name__ == '__main__':
|
32
|
+
test_lines = get_lines()
|
33
|
+
showdata.show_dict(convert2dict(header_str=test_lines))
|
34
|
+
|
lazysdk/lazyre.py
CHANGED
@@ -4,7 +4,7 @@ import re
|
|
4
4
|
def find_between(
|
5
5
|
text: str,
|
6
6
|
left: str,
|
7
|
-
right: str,
|
7
|
+
right: str = None,
|
8
8
|
until_line_end: bool = False # 是否匹配到行尾
|
9
9
|
):
|
10
10
|
"""
|
@@ -19,7 +19,7 @@ def find_between(
|
|
19
19
|
def find_all(
|
20
20
|
text: str,
|
21
21
|
left: str,
|
22
|
-
right: str,
|
22
|
+
right: str = None,
|
23
23
|
until_line_end: bool = False # 是否匹配到行尾
|
24
24
|
):
|
25
25
|
"""
|
lazysdk/lazyrequests.py
CHANGED
@@ -23,7 +23,8 @@ def lazy_requests(
|
|
23
23
|
ReadTimeout_retry: bool = True, # 超时重试
|
24
24
|
JSONDecodeError_retry: bool = True, # 返回非json类型重试
|
25
25
|
ConnectionError_retry: bool = True, # 连接错误重试
|
26
|
-
|
26
|
+
ChunkedEncodingError_retry: bool = True,
|
27
|
+
TooManyRedirects_retry: bool = True,
|
27
28
|
|
28
29
|
**kwargs
|
29
30
|
):
|
@@ -53,22 +54,27 @@ def lazy_requests(
|
|
53
54
|
except requests.exceptions.ReadTimeout:
|
54
55
|
if ReadTimeout_retry is True:
|
55
56
|
retry_count += 1
|
56
|
-
showlog.warning(f'
|
57
|
+
showlog.warning(f'ReadTimeout,将在{retry_delay}秒后重试第{retry_count}次...')
|
57
58
|
time.sleep(retry_delay)
|
58
59
|
except requests.exceptions.JSONDecodeError:
|
59
60
|
if JSONDecodeError_retry is True:
|
60
61
|
retry_count += 1
|
61
|
-
showlog.warning(f'
|
62
|
+
showlog.warning(f'JSONDecodeError,将在{retry_delay}秒后重试第{retry_count}次...')
|
62
63
|
time.sleep(retry_delay)
|
63
64
|
except requests.exceptions.ConnectionError: # 包含ProxyError
|
64
65
|
if ConnectionError_retry is True:
|
65
66
|
retry_count += 1
|
66
|
-
showlog.warning(f'
|
67
|
+
showlog.warning(f'ConnectionError,将在{retry_delay}秒后重试第{retry_count}次...')
|
67
68
|
time.sleep(retry_delay)
|
68
69
|
except requests.exceptions.ChunkedEncodingError:
|
69
|
-
if
|
70
|
+
if ChunkedEncodingError_retry is True:
|
70
71
|
retry_count += 1
|
71
|
-
showlog.warning(f'
|
72
|
+
showlog.warning(f'ChunkedEncodingError,将在{retry_delay}秒后重试第{retry_count}次...')
|
73
|
+
time.sleep(retry_delay)
|
74
|
+
except requests.exceptions.TooManyRedirects:
|
75
|
+
if TooManyRedirects_retry is True:
|
76
|
+
retry_count += 1
|
77
|
+
showlog.warning(f'TooManyRedirects,将在{retry_delay}秒后重试第{retry_count}次...')
|
72
78
|
time.sleep(retry_delay)
|
73
79
|
if retry_limit == 0:
|
74
80
|
break
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: lazysdk
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.112
|
4
4
|
Summary: 基于Python的懒人包
|
5
5
|
Home-page: https://gitee.com/ZeroSeeker/lazysdk
|
6
6
|
Author: ZeroSeeker
|
@@ -10,20 +10,20 @@ Classifier: License :: OSI Approved :: MIT License
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
11
11
|
Description-Content-Type: text/markdown
|
12
12
|
License-File: LICENSE
|
13
|
-
Requires-Dist: showlog
|
14
|
-
Requires-Dist: requests
|
15
|
-
Requires-Dist: envx
|
16
|
-
Requires-Dist: pytz
|
17
|
-
Requires-Dist: ua-parser
|
18
|
-
Requires-Dist: openpyxl
|
19
|
-
Requires-Dist: xlrd
|
20
|
-
Requires-Dist: m3u8
|
21
|
-
Requires-Dist: pycryptodome
|
22
|
-
Requires-Dist: filetype
|
23
|
-
Requires-Dist: netifaces
|
24
|
-
Requires-Dist: user-agents
|
25
|
-
Requires-Dist: rich
|
26
|
-
Requires-Dist: urllib3
|
13
|
+
Requires-Dist: showlog>=0.0.6
|
14
|
+
Requires-Dist: requests>=2.31.0
|
15
|
+
Requires-Dist: envx>=1.0.1
|
16
|
+
Requires-Dist: pytz==2022.1
|
17
|
+
Requires-Dist: ua-parser==0.10.0
|
18
|
+
Requires-Dist: openpyxl==3.0.9
|
19
|
+
Requires-Dist: xlrd==2.0.1
|
20
|
+
Requires-Dist: m3u8==3.5.0
|
21
|
+
Requires-Dist: pycryptodome==3.10.1
|
22
|
+
Requires-Dist: filetype==1.2.0
|
23
|
+
Requires-Dist: netifaces==0.11.0
|
24
|
+
Requires-Dist: user-agents==2.2.0
|
25
|
+
Requires-Dist: rich>=13.5.2
|
26
|
+
Requires-Dist: urllib3==1.26.9
|
27
27
|
|
28
28
|
# lazysdk
|
29
29
|

|
@@ -1,5 +1,6 @@
|
|
1
1
|
lazysdk/__init__.py,sha256=DnzFWyjDsoyNGq0VJ_s0Ha6dPOIGrZtA3DFQhg0HbEU,184
|
2
2
|
lazysdk/lazyCrypto.py,sha256=OftFbJTzPgoQ-o2AI4LI6uyPNIZAp0XZnXl_qStnR78,389
|
3
|
+
lazysdk/lazy_header.py,sha256=Ias8LAIOg5iUXGFsyNwdQ7QcAgcR7pp-q29ZFiCH1xU,782
|
3
4
|
lazysdk/lazy_id_card.py,sha256=b96SvObDaEavMLIdinbxpleupCEnHihklO-jycl5BJ8,2797
|
4
5
|
lazysdk/lazybase64.py,sha256=8jtuH9S1jICXpzxhRLe7xNur_o9TWbT1BRmTshZWYh0,669
|
5
6
|
lazysdk/lazycache.py,sha256=it4B-iTXITtua8yjeiUooDsye4Z_aGy4uAOibxoViNQ,571
|
@@ -22,9 +23,9 @@ lazysdk/lazypath.py,sha256=4h7_yg5Hkt_vUnpr7kPodV1GwwYlyORLjJt3MYCIquM,6130
|
|
22
23
|
lazysdk/lazyprocess.py,sha256=Fmh2BLF1WkWA5N0FzF0D3d-8MvMJxSD6HmuFCXCeLUU,17702
|
23
24
|
lazysdk/lazyproxies.py,sha256=bljLKkP3WksZ6jOHhjS5-jSHdUBRH6gx-BxEZTPJeXc,546
|
24
25
|
lazysdk/lazyrandom.py,sha256=XZ8hTcNvc68FAI-BfaIt7QpCmzZ7m4RGDrfpy_U7zTw,1420
|
25
|
-
lazysdk/lazyre.py,sha256=
|
26
|
+
lazysdk/lazyre.py,sha256=UQNpf9P1GyxRoRfuulyY4D1nnF227R4bzUGT3LevE7w,956
|
26
27
|
lazysdk/lazyredis.py,sha256=78jM_tXNgUKULcp08CQEHmfAlzwlWuOsl6SuLwoLDdM,37918
|
27
|
-
lazysdk/lazyrequests.py,sha256=
|
28
|
+
lazysdk/lazyrequests.py,sha256=kNtHmg-M39selgsOtdGb-6KHfAz80BE3IwdcTdrJth4,4065
|
28
29
|
lazysdk/lazytext.py,sha256=1UgwxLt3c6i0JwUGRC7srSc_mhM3ICv1WrhOqkuIrLk,2672
|
29
30
|
lazysdk/lazytime.py,sha256=uT6Q00XNPYifMgig0uTLmCRRBnqpciSfy96QoVbrQK4,27383
|
30
31
|
lazysdk/lazyua.py,sha256=IqLmqGDECdJa3Wcr8h6sTxMErJZlCTM3Jk7IWm90UzI,4827
|
@@ -33,8 +34,8 @@ lazysdk/lazywebhook.py,sha256=DWn4AE4E_w2wZuev5aD51J5oGCJjitbucFokHSSnuHg,9377
|
|
33
34
|
lazysdk/lazywifi.py,sha256=FOvLPTcb6BQE6D8kjfB0TLpfgGxw8jqC3vZbTs6LbD4,716
|
34
35
|
lazysdk/lazyxml.py,sha256=PLAcDWjpu2GMJPsV9dHOv716CVmflQee7Aan-hqGxL8,770
|
35
36
|
lazysdk/showdata.py,sha256=957JMXq7qfJ4ELpA3nBJwkyEUn6mRwtVXVBGYfZaCgg,1683
|
36
|
-
lazysdk-0.1.
|
37
|
-
lazysdk-0.1.
|
38
|
-
lazysdk-0.1.
|
39
|
-
lazysdk-0.1.
|
40
|
-
lazysdk-0.1.
|
37
|
+
lazysdk-0.1.112.dist-info/LICENSE,sha256=OC5E4ENUG6B4dGEVGwUpdsD-D9SZsCVC92NAgaqvE-c,1088
|
38
|
+
lazysdk-0.1.112.dist-info/METADATA,sha256=EHtJD_o_24hYL-O33IAFntL7MtHxmr6pDjozMIpyq0Y,1901
|
39
|
+
lazysdk-0.1.112.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
|
40
|
+
lazysdk-0.1.112.dist-info/top_level.txt,sha256=--bGS42ZHUhVeO83y1wfvKFg6OjkTLxQ4V4riqPQljY,8
|
41
|
+
lazysdk-0.1.112.dist-info/RECORD,,
|
File without changes
|
File without changes
|