lazysdk 0.1.88__py3-none-any.whl → 0.1.90__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/lazylist.py ADDED
@@ -0,0 +1,17 @@
1
+
2
+
3
+ def split(
4
+ list_in: list,
5
+ split_gap: int
6
+ ):
7
+ """
8
+ 将输入的list按照split_gap进行分割
9
+ """
10
+ list_out = list()
11
+ split_num = 0
12
+ for i in range(len(list_in)):
13
+ if i % split_gap == 0:
14
+ list_out.append(list())
15
+ split_num += 1
16
+ list_out[split_num-1].append(list_in[i])
17
+ return list_out
lazysdk/lazytext.py CHANGED
@@ -75,3 +75,25 @@ def file_name_format(text):
75
75
  """
76
76
  text_new = re.sub(r'[\\/:*?"<>|\r\n]+', "_", text) # 规避windows非法字符
77
77
  return text_new
78
+
79
+
80
+ def name_head_list(
81
+ your_name: str
82
+ ):
83
+ """
84
+ 获取姓名的首字母缩写的所有可能列表
85
+ :param your_name:
86
+ :return:
87
+ """
88
+ from xpinyin import Pinyin
89
+ p = Pinyin()
90
+ name_pinyins = p.get_pinyins(your_name)
91
+ name_heads = list()
92
+ for each_name_pinyin in name_pinyins:
93
+ name_pinyin_split = each_name_pinyin.split('-')
94
+ name_head = ""
95
+ for each_split in name_pinyin_split:
96
+ each_split_0 = each_split[0]
97
+ name_head += each_split_0
98
+ name_heads.append(name_head)
99
+ return name_heads
lazysdk/lazyxml.py ADDED
@@ -0,0 +1,24 @@
1
+ from xml.etree import ElementTree
2
+ import re
3
+
4
+
5
+ def xml2dict(xml_str: str):
6
+ """
7
+ XML代码转dict
8
+ 在格式化之前,先抽取出xml标签内的内容,防止有干扰
9
+ 参考:https://docs.python.org/zh-cn/3.8/library/xml.etree.elementtree.html
10
+ https://blog.csdn.net/qdPython/article/details/115520713
11
+ :param xml_str:
12
+ :return:
13
+ """
14
+ res_dict = dict()
15
+ xml_str_res = re.findall(r'<xml>(.*?)</xml>', xml_str, re.S)
16
+ if xml_str_res:
17
+ xml_str_process = f"<xml>{xml_str_res[0]}</xml>"
18
+ root = ElementTree.fromstring(xml_str_process)
19
+ for child in root:
20
+ # print(child.tag, child.attrib, child.text)
21
+ res_dict[child.tag] = child.text
22
+ return res_dict
23
+ else:
24
+ return res_dict
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lazysdk
3
- Version: 0.1.88
3
+ Version: 0.1.90
4
4
  Summary: 基于Python的懒人包
5
5
  Home-page: https://gitee.com/ZeroSeeker/lazysdk
6
6
  Author: ZeroSeeker
@@ -23,6 +23,7 @@ Requires-Dist: filetype ==1.2.0
23
23
  Requires-Dist: netifaces ==0.11.0
24
24
  Requires-Dist: user-agents ==2.2.0
25
25
  Requires-Dist: rich >=13.5.2
26
+ Requires-Dist: urllib3 ==1.23
26
27
 
27
28
  # lazysdk
28
29
  ![](https://img.shields.io/badge/Python-3.8.6-green.svg)
@@ -15,6 +15,7 @@ lazysdk/lazyid.py,sha256=tpiIjITLvYRVs9JASZZM2hvA-ngzoVFwGnepAzMhWT8,1287
15
15
  lazysdk/lazyinfo.py,sha256=c9BsyxMygpcpQ7mpurz3JShyhVhu75XZai9Ezk4dFHc,3673
16
16
  lazysdk/lazyip.py,sha256=GXUKixW7yHBelB8G36TCwCogw1DzkRCm38yNKyjEnXQ,1364
17
17
  lazysdk/lazyjson.py,sha256=5clxmOJDlkKbuovgB1jIPGCJwhLqM-SHHtrxmbCJe_4,867
18
+ lazysdk/lazylist.py,sha256=B4j0a5omrtgUSXWriE2uWcuCWPD8RvOIBBLI7Tkk0pI,363
18
19
  lazysdk/lazym3u8.py,sha256=NrwEBpivhAxpW6KhKl7YowFBKGMpPxiKrcafgw7n8wY,31937
19
20
  lazysdk/lazymd5.py,sha256=JSKIcUmH2zwPDDJAd9XajTYd59eKidoKAkLLNU8OHM4,1112
20
21
  lazysdk/lazypath.py,sha256=FDCcQKISE1TZb0FXMz_B9us3AJIvgILt3RAc3-Ibo54,5922
@@ -23,15 +24,16 @@ lazysdk/lazyproxies.py,sha256=bljLKkP3WksZ6jOHhjS5-jSHdUBRH6gx-BxEZTPJeXc,546
23
24
  lazysdk/lazyrandom.py,sha256=XZ8hTcNvc68FAI-BfaIt7QpCmzZ7m4RGDrfpy_U7zTw,1420
24
25
  lazysdk/lazyredis.py,sha256=78jM_tXNgUKULcp08CQEHmfAlzwlWuOsl6SuLwoLDdM,37918
25
26
  lazysdk/lazyrequests.py,sha256=qOUNkFhIThHNLALDTmOqPjKgMse5BVD-Kf9kheadMAY,3750
26
- lazysdk/lazytext.py,sha256=iJbdxU2hDK3q3ivLYoYTRHQJXSDYxR5F-yG6Hxl5mlQ,2052
27
+ lazysdk/lazytext.py,sha256=uyfXscNNqbozLrHm-mmIzf-CGG158qBsN3MJhimWROQ,2627
27
28
  lazysdk/lazytime.py,sha256=3GHfck89GNg556gYCoCd5NpntybBU848gJ1Udv1jikk,26530
28
29
  lazysdk/lazyua.py,sha256=IqLmqGDECdJa3Wcr8h6sTxMErJZlCTM3Jk7IWm90UzI,4827
29
30
  lazysdk/lazyurl.py,sha256=N89QLK2A6vXr9gqp-9vnk9RXv_fOjw171lVl9eEoxtE,1550
30
31
  lazysdk/lazywebhook.py,sha256=HwJIZ5j3wUpnEfPkFY-Xq9T_9xdhCJ71dYsWNX22_3Y,8386
31
32
  lazysdk/lazywifi.py,sha256=FOvLPTcb6BQE6D8kjfB0TLpfgGxw8jqC3vZbTs6LbD4,716
33
+ lazysdk/lazyxml.py,sha256=PLAcDWjpu2GMJPsV9dHOv716CVmflQee7Aan-hqGxL8,770
32
34
  lazysdk/showdata.py,sha256=957JMXq7qfJ4ELpA3nBJwkyEUn6mRwtVXVBGYfZaCgg,1683
33
- lazysdk-0.1.88.dist-info/LICENSE,sha256=OC5E4ENUG6B4dGEVGwUpdsD-D9SZsCVC92NAgaqvE-c,1088
34
- lazysdk-0.1.88.dist-info/METADATA,sha256=mYyr3bOyYlQOdzdOPUbO_3gODcsuNVNCa6dTLI1XQXk,1882
35
- lazysdk-0.1.88.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
36
- lazysdk-0.1.88.dist-info/top_level.txt,sha256=--bGS42ZHUhVeO83y1wfvKFg6OjkTLxQ4V4riqPQljY,8
37
- lazysdk-0.1.88.dist-info/RECORD,,
35
+ lazysdk-0.1.90.dist-info/LICENSE,sha256=OC5E4ENUG6B4dGEVGwUpdsD-D9SZsCVC92NAgaqvE-c,1088
36
+ lazysdk-0.1.90.dist-info/METADATA,sha256=mRoUG-HcSo4tKAAL-VMCqCqFxBO7QHMmFtLOB4cc7wc,1912
37
+ lazysdk-0.1.90.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
38
+ lazysdk-0.1.90.dist-info/top_level.txt,sha256=--bGS42ZHUhVeO83y1wfvKFg6OjkTLxQ4V4riqPQljY,8
39
+ lazysdk-0.1.90.dist-info/RECORD,,