lazysdk 0.1.88__py3-none-any.whl → 0.1.89__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/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.89
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)
@@ -23,15 +23,16 @@ lazysdk/lazyproxies.py,sha256=bljLKkP3WksZ6jOHhjS5-jSHdUBRH6gx-BxEZTPJeXc,546
23
23
  lazysdk/lazyrandom.py,sha256=XZ8hTcNvc68FAI-BfaIt7QpCmzZ7m4RGDrfpy_U7zTw,1420
24
24
  lazysdk/lazyredis.py,sha256=78jM_tXNgUKULcp08CQEHmfAlzwlWuOsl6SuLwoLDdM,37918
25
25
  lazysdk/lazyrequests.py,sha256=qOUNkFhIThHNLALDTmOqPjKgMse5BVD-Kf9kheadMAY,3750
26
- lazysdk/lazytext.py,sha256=iJbdxU2hDK3q3ivLYoYTRHQJXSDYxR5F-yG6Hxl5mlQ,2052
26
+ lazysdk/lazytext.py,sha256=uyfXscNNqbozLrHm-mmIzf-CGG158qBsN3MJhimWROQ,2627
27
27
  lazysdk/lazytime.py,sha256=3GHfck89GNg556gYCoCd5NpntybBU848gJ1Udv1jikk,26530
28
28
  lazysdk/lazyua.py,sha256=IqLmqGDECdJa3Wcr8h6sTxMErJZlCTM3Jk7IWm90UzI,4827
29
29
  lazysdk/lazyurl.py,sha256=N89QLK2A6vXr9gqp-9vnk9RXv_fOjw171lVl9eEoxtE,1550
30
30
  lazysdk/lazywebhook.py,sha256=HwJIZ5j3wUpnEfPkFY-Xq9T_9xdhCJ71dYsWNX22_3Y,8386
31
31
  lazysdk/lazywifi.py,sha256=FOvLPTcb6BQE6D8kjfB0TLpfgGxw8jqC3vZbTs6LbD4,716
32
+ lazysdk/lazyxml.py,sha256=PLAcDWjpu2GMJPsV9dHOv716CVmflQee7Aan-hqGxL8,770
32
33
  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,,
34
+ lazysdk-0.1.89.dist-info/LICENSE,sha256=OC5E4ENUG6B4dGEVGwUpdsD-D9SZsCVC92NAgaqvE-c,1088
35
+ lazysdk-0.1.89.dist-info/METADATA,sha256=aQbBXRfd_jT3QhyqJmOD2pjLgJhkbBoAYIWWjRC1xyU,1912
36
+ lazysdk-0.1.89.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
37
+ lazysdk-0.1.89.dist-info/top_level.txt,sha256=--bGS42ZHUhVeO83y1wfvKFg6OjkTLxQ4V4riqPQljY,8
38
+ lazysdk-0.1.89.dist-info/RECORD,,