pyxllib 0.0.43__py3-none-any.whl → 0.3.197__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.
Files changed (186) hide show
  1. pyxllib/__init__.py +9 -2
  2. pyxllib/algo/__init__.py +8 -0
  3. pyxllib/algo/disjoint.py +54 -0
  4. pyxllib/algo/geo.py +541 -0
  5. pyxllib/{util/mathlib.py → algo/intervals.py} +172 -36
  6. pyxllib/algo/matcher.py +389 -0
  7. pyxllib/algo/newbie.py +166 -0
  8. pyxllib/algo/pupil.py +629 -0
  9. pyxllib/algo/shapelylib.py +67 -0
  10. pyxllib/algo/specialist.py +241 -0
  11. pyxllib/algo/stat.py +494 -0
  12. pyxllib/algo/treelib.py +149 -0
  13. pyxllib/algo/unitlib.py +66 -0
  14. pyxllib/autogui/__init__.py +5 -0
  15. pyxllib/autogui/activewin.py +246 -0
  16. pyxllib/autogui/all.py +9 -0
  17. pyxllib/autogui/autogui.py +852 -0
  18. pyxllib/autogui/uiautolib.py +362 -0
  19. pyxllib/autogui/virtualkey.py +102 -0
  20. pyxllib/autogui/wechat.py +827 -0
  21. pyxllib/autogui/wechat_msg.py +421 -0
  22. pyxllib/autogui/wxautolib.py +84 -0
  23. pyxllib/cv/__init__.py +1 -11
  24. pyxllib/cv/expert.py +267 -0
  25. pyxllib/cv/{imlib.py → imfile.py} +18 -83
  26. pyxllib/cv/imhash.py +39 -0
  27. pyxllib/cv/pupil.py +9 -0
  28. pyxllib/cv/rgbfmt.py +1525 -0
  29. pyxllib/cv/slidercaptcha.py +137 -0
  30. pyxllib/cv/trackbartools.py +163 -49
  31. pyxllib/cv/xlcvlib.py +1040 -0
  32. pyxllib/cv/xlpillib.py +423 -0
  33. pyxllib/data/__init__.py +0 -0
  34. pyxllib/data/echarts.py +240 -0
  35. pyxllib/data/jsonlib.py +89 -0
  36. pyxllib/{util/oss2_.py → data/oss.py} +11 -9
  37. pyxllib/data/pglib.py +1127 -0
  38. pyxllib/data/sqlite.py +568 -0
  39. pyxllib/{util → data}/sqllib.py +13 -31
  40. pyxllib/ext/JLineViewer.py +505 -0
  41. pyxllib/ext/__init__.py +6 -0
  42. pyxllib/{util → ext}/demolib.py +119 -35
  43. pyxllib/ext/drissionlib.py +277 -0
  44. pyxllib/ext/kq5034lib.py +12 -0
  45. pyxllib/{util/main.py → ext/old.py} +122 -284
  46. pyxllib/ext/qt.py +449 -0
  47. pyxllib/ext/robustprocfile.py +497 -0
  48. pyxllib/ext/seleniumlib.py +76 -0
  49. pyxllib/{util/tklib.py → ext/tk.py} +10 -11
  50. pyxllib/ext/unixlib.py +827 -0
  51. pyxllib/ext/utools.py +351 -0
  52. pyxllib/{util/webhooklib.py → ext/webhook.py} +45 -17
  53. pyxllib/ext/win32lib.py +40 -0
  54. pyxllib/ext/wjxlib.py +88 -0
  55. pyxllib/ext/wpsapi.py +124 -0
  56. pyxllib/ext/xlwork.py +9 -0
  57. pyxllib/ext/yuquelib.py +1105 -0
  58. pyxllib/file/__init__.py +17 -0
  59. pyxllib/file/docxlib.py +761 -0
  60. pyxllib/{util → file}/gitlib.py +40 -27
  61. pyxllib/file/libreoffice.py +165 -0
  62. pyxllib/file/movielib.py +148 -0
  63. pyxllib/file/newbie.py +10 -0
  64. pyxllib/file/onenotelib.py +1469 -0
  65. pyxllib/file/packlib/__init__.py +330 -0
  66. pyxllib/{util → file/packlib}/zipfile.py +598 -195
  67. pyxllib/file/pdflib.py +426 -0
  68. pyxllib/file/pupil.py +185 -0
  69. pyxllib/file/specialist/__init__.py +685 -0
  70. pyxllib/{basic/_5_dirlib.py → file/specialist/dirlib.py} +364 -93
  71. pyxllib/file/specialist/download.py +193 -0
  72. pyxllib/file/specialist/filelib.py +2829 -0
  73. pyxllib/file/xlsxlib.py +3131 -0
  74. pyxllib/file/xlsyncfile.py +341 -0
  75. pyxllib/prog/__init__.py +5 -0
  76. pyxllib/prog/cachetools.py +64 -0
  77. pyxllib/prog/deprecatedlib.py +233 -0
  78. pyxllib/prog/filelock.py +42 -0
  79. pyxllib/prog/ipyexec.py +253 -0
  80. pyxllib/prog/multiprogs.py +940 -0
  81. pyxllib/prog/newbie.py +451 -0
  82. pyxllib/prog/pupil.py +1197 -0
  83. pyxllib/{sitepackages.py → prog/sitepackages.py} +5 -3
  84. pyxllib/prog/specialist/__init__.py +391 -0
  85. pyxllib/prog/specialist/bc.py +203 -0
  86. pyxllib/prog/specialist/browser.py +497 -0
  87. pyxllib/prog/specialist/common.py +347 -0
  88. pyxllib/prog/specialist/datetime.py +199 -0
  89. pyxllib/prog/specialist/tictoc.py +240 -0
  90. pyxllib/prog/specialist/xllog.py +180 -0
  91. pyxllib/prog/xlosenv.py +108 -0
  92. pyxllib/stdlib/__init__.py +17 -0
  93. pyxllib/{util → stdlib}/tablepyxl/__init__.py +1 -3
  94. pyxllib/{util → stdlib}/tablepyxl/style.py +1 -1
  95. pyxllib/{util → stdlib}/tablepyxl/tablepyxl.py +2 -4
  96. pyxllib/text/__init__.py +8 -0
  97. pyxllib/text/ahocorasick.py +39 -0
  98. pyxllib/text/airscript.js +744 -0
  99. pyxllib/text/charclasslib.py +121 -0
  100. pyxllib/text/jiebalib.py +267 -0
  101. pyxllib/text/jinjalib.py +32 -0
  102. pyxllib/text/jsa_ai_prompt.md +271 -0
  103. pyxllib/text/jscode.py +922 -0
  104. pyxllib/text/latex/__init__.py +158 -0
  105. pyxllib/text/levenshtein.py +303 -0
  106. pyxllib/text/nestenv.py +1215 -0
  107. pyxllib/text/newbie.py +300 -0
  108. pyxllib/text/pupil/__init__.py +8 -0
  109. pyxllib/text/pupil/common.py +1121 -0
  110. pyxllib/text/pupil/xlalign.py +326 -0
  111. pyxllib/text/pycode.py +47 -0
  112. pyxllib/text/specialist/__init__.py +8 -0
  113. pyxllib/text/specialist/common.py +112 -0
  114. pyxllib/text/specialist/ptag.py +186 -0
  115. pyxllib/text/spellchecker.py +172 -0
  116. pyxllib/text/templates/echart_base.html +11 -0
  117. pyxllib/text/templates/highlight_code.html +17 -0
  118. pyxllib/text/templates/latex_editor.html +103 -0
  119. pyxllib/text/vbacode.py +17 -0
  120. pyxllib/text/xmllib.py +747 -0
  121. pyxllib/xl.py +39 -0
  122. pyxllib/xlcv.py +17 -0
  123. pyxllib-0.3.197.dist-info/METADATA +48 -0
  124. pyxllib-0.3.197.dist-info/RECORD +126 -0
  125. {pyxllib-0.0.43.dist-info → pyxllib-0.3.197.dist-info}/WHEEL +4 -5
  126. pyxllib/basic/_1_strlib.py +0 -945
  127. pyxllib/basic/_2_timelib.py +0 -488
  128. pyxllib/basic/_3_pathlib.py +0 -916
  129. pyxllib/basic/_4_loglib.py +0 -419
  130. pyxllib/basic/__init__.py +0 -54
  131. pyxllib/basic/arrow_.py +0 -250
  132. pyxllib/basic/chardet_.py +0 -66
  133. pyxllib/basic/dirlib.py +0 -529
  134. pyxllib/basic/dprint.py +0 -202
  135. pyxllib/basic/extension.py +0 -12
  136. pyxllib/basic/judge.py +0 -31
  137. pyxllib/basic/log.py +0 -204
  138. pyxllib/basic/pathlib_.py +0 -705
  139. pyxllib/basic/pytictoc.py +0 -102
  140. pyxllib/basic/qiniu_.py +0 -61
  141. pyxllib/basic/strlib.py +0 -761
  142. pyxllib/basic/timer.py +0 -132
  143. pyxllib/cv/cv.py +0 -834
  144. pyxllib/cv/cvlib/_1_geo.py +0 -543
  145. pyxllib/cv/cvlib/_2_cvprcs.py +0 -309
  146. pyxllib/cv/cvlib/_2_imgproc.py +0 -594
  147. pyxllib/cv/cvlib/_3_pilprcs.py +0 -80
  148. pyxllib/cv/cvlib/_4_cvimg.py +0 -211
  149. pyxllib/cv/cvlib/__init__.py +0 -10
  150. pyxllib/cv/debugtools.py +0 -82
  151. pyxllib/cv/fitz_.py +0 -300
  152. pyxllib/cv/installer.py +0 -42
  153. pyxllib/debug/_0_installer.py +0 -38
  154. pyxllib/debug/_1_typelib.py +0 -277
  155. pyxllib/debug/_2_chrome.py +0 -198
  156. pyxllib/debug/_3_showdir.py +0 -161
  157. pyxllib/debug/_4_bcompare.py +0 -140
  158. pyxllib/debug/__init__.py +0 -49
  159. pyxllib/debug/bcompare.py +0 -132
  160. pyxllib/debug/chrome.py +0 -198
  161. pyxllib/debug/installer.py +0 -38
  162. pyxllib/debug/showdir.py +0 -158
  163. pyxllib/debug/typelib.py +0 -278
  164. pyxllib/image/__init__.py +0 -12
  165. pyxllib/torch/__init__.py +0 -20
  166. pyxllib/torch/modellib.py +0 -37
  167. pyxllib/torch/trainlib.py +0 -344
  168. pyxllib/util/__init__.py +0 -20
  169. pyxllib/util/aip_.py +0 -141
  170. pyxllib/util/casiadb.py +0 -59
  171. pyxllib/util/excellib.py +0 -495
  172. pyxllib/util/filelib.py +0 -612
  173. pyxllib/util/jsondata.py +0 -27
  174. pyxllib/util/jsondata2.py +0 -92
  175. pyxllib/util/labelmelib.py +0 -139
  176. pyxllib/util/onepy/__init__.py +0 -29
  177. pyxllib/util/onepy/onepy.py +0 -574
  178. pyxllib/util/onepy/onmanager.py +0 -170
  179. pyxllib/util/pyautogui_.py +0 -219
  180. pyxllib/util/textlib.py +0 -1305
  181. pyxllib/util/unorder.py +0 -22
  182. pyxllib/util/xmllib.py +0 -639
  183. pyxllib-0.0.43.dist-info/METADATA +0 -39
  184. pyxllib-0.0.43.dist-info/RECORD +0 -80
  185. pyxllib-0.0.43.dist-info/top_level.txt +0 -1
  186. {pyxllib-0.0.43.dist-info → pyxllib-0.3.197.dist-info/licenses}/LICENSE +0 -0
pyxllib/basic/pytictoc.py DELETED
@@ -1,102 +0,0 @@
1
- #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
- # @Author : 陈坤泽
4
- # @Email : 877362867@qq.com
5
- # @Data : 2020/05/30
6
-
7
-
8
- """
9
- 基于 pytictoc 代码,做了些自定义扩展
10
-
11
- 原版备注:
12
- Module with class TicToc to replicate the functionality of MATLAB's tic and toc.
13
- Documentation: https://pypi.python.org/pypi/pytictoc
14
- __author__ = 'Eric Fields'
15
- __version__ = '1.4.0'
16
- __version_date__ = '29 April 2017'
17
- """
18
-
19
- import time
20
- import timeit
21
-
22
-
23
- class TicToc:
24
- """
25
- Replicate the functionality of MATLAB's tic and toc.
26
-
27
- #Methods
28
- TicToc.tic() #start or re-start the timer
29
- TicToc.toc() #print elapsed time since timer start
30
- TicToc.tocvalue() #return floating point value of elapsed time since timer start
31
-
32
- #Attributes
33
- TicToc.start #Time from timeit.default_timer() when t.tic() was last called
34
- TicToc.end #Time from timeit.default_timer() when t.toc() or t.tocvalue() was last called
35
- TicToc.elapsed #t.end - t.start; i.e., time elapsed from t.start when t.toc() or t.tocvalue() was last called
36
- """
37
-
38
- def __init__(self, title=''):
39
- """Create instance of TicToc class."""
40
- self.start = timeit.default_timer()
41
- self.end = float('nan')
42
- self.elapsed = float('nan')
43
- self.title = title
44
-
45
- def tic(self):
46
- """Start the timer."""
47
- self.start = timeit.default_timer()
48
-
49
- def toc(self, msg='用时', restart=False):
50
- """
51
- Report time elapsed since last call to tic().
52
-
53
- Optional arguments:
54
- msg - String to replace default message of 'Elapsed time is'
55
- restart - Boolean specifying whether to restart the timer
56
- """
57
- self.end = timeit.default_timer()
58
- self.elapsed = self.end - self.start
59
- print(f'{self.title} {msg} {self.elapsed:.3f} 秒.')
60
- if restart:
61
- self.start = timeit.default_timer()
62
-
63
- def tocvalue(self, restart=False):
64
- """
65
- Return time elapsed since last call to tic().
66
-
67
- Optional argument:
68
- restart - Boolean specifying whether to restart the timer
69
- """
70
- self.end = timeit.default_timer()
71
- self.elapsed = self.end - self.start
72
- if restart:
73
- self.start = timeit.default_timer()
74
- return self.elapsed
75
-
76
- @staticmethod
77
- def process_time(msg='程序已启动'):
78
- """计算从python程序启动到目前为止总用时"""
79
- print(f'{msg} {time.process_time():.3f} 秒')
80
-
81
- def __enter__(self):
82
- """Start the timer when using TicToc in a context manager."""
83
- self.start = timeit.default_timer()
84
-
85
- def __exit__(self, *args):
86
- """On exit, print time elapsed since entering context manager."""
87
- self.end = timeit.default_timer()
88
- self.elapsed = self.end - self.start
89
- print(f'{self.title} {self.elapsed:.3f} 秒.')
90
-
91
-
92
- if __name__ == '__main__':
93
- # demo:每个脚本开头结尾都可以这样写来统计程序用时
94
- TicToc.process_time(f'{__file__} 启动准备共用时')
95
- # D:/slns/pyxllib/pyxllib/debug/pytictoc.py 启动准备共用时 0.031 秒
96
-
97
- tictoc = TicToc(__file__)
98
-
99
- time.sleep(2)
100
-
101
- tictoc.toc()
102
- # D:/slns/pyxllib/pyxllib/debug/pytictoc.py 用时 2.000 秒.
pyxllib/basic/qiniu_.py DELETED
@@ -1,61 +0,0 @@
1
- #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
- # @Author : 陈坤泽
4
- # @Email : 877362867@qq.com
5
- # @Data : 2020/05/30 20:39
6
-
7
-
8
- import re
9
-
10
- import requests
11
- import qiniu
12
-
13
-
14
- def get_etag(arg):
15
- """七牛原有etag功能基础上做封装
16
- :param arg: 支持bytes二进制、文件、url地址
17
- """
18
- from io import BytesIO
19
- from .judge import is_url, is_file
20
-
21
- if isinstance(arg, bytes): # 二进制数据
22
- return qiniu.utils.etag_stream(BytesIO(arg))
23
- elif is_file(arg): # 输入是一个文件
24
- return qiniu.etag(arg)
25
- elif is_url(arg): # 输入是一个网页上的数据源
26
- return get_etag(requests.get(arg).content)
27
- elif isinstance(arg, str): # 明文字符串转二进制
28
- return get_etag(arg.encode('utf8'))
29
- else:
30
- raise TypeError('不识别的数据类型')
31
-
32
-
33
- def is_etag(s):
34
- """字母、数字和-、_共64种字符构成的长度28的字符串"""
35
- return re.match(r'[a-zA-Z0-9\-_]{28}$', s)
36
-
37
-
38
- def test_etag():
39
- print(get_etag(r'\chematom{+8}{2}{8}{}'))
40
- # Fjnu-ZXyDxrqLoZmNJ2Kj8FcZGR-
41
-
42
- print(get_etag(__file__))
43
- # 每次代码改了这段输出都是不一样的
44
-
45
-
46
- def test_etag2():
47
- """ 字符串值和写到文件判断的etag,是一样的
48
- """
49
- from .pathlib_ import Path
50
-
51
- s = 'code4101'
52
- print(get_etag(s))
53
- # FkAD2McB6ugxTiniE8ebhlNHdHh9
54
-
55
- f = Path('1.tex', root=Path.TEMP).write(s, if_exists='replace').fullpath
56
- print(get_etag(f))
57
- # FkAD2McB6ugxTiniE8ebhlNHdHh9
58
-
59
-
60
- if __name__ == '__main__':
61
- test_etag()