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.
- pyxllib/__init__.py +9 -2
- pyxllib/algo/__init__.py +8 -0
- pyxllib/algo/disjoint.py +54 -0
- pyxllib/algo/geo.py +541 -0
- pyxllib/{util/mathlib.py → algo/intervals.py} +172 -36
- pyxllib/algo/matcher.py +389 -0
- pyxllib/algo/newbie.py +166 -0
- pyxllib/algo/pupil.py +629 -0
- pyxllib/algo/shapelylib.py +67 -0
- pyxllib/algo/specialist.py +241 -0
- pyxllib/algo/stat.py +494 -0
- pyxllib/algo/treelib.py +149 -0
- pyxllib/algo/unitlib.py +66 -0
- pyxllib/autogui/__init__.py +5 -0
- pyxllib/autogui/activewin.py +246 -0
- pyxllib/autogui/all.py +9 -0
- pyxllib/autogui/autogui.py +852 -0
- pyxllib/autogui/uiautolib.py +362 -0
- pyxllib/autogui/virtualkey.py +102 -0
- pyxllib/autogui/wechat.py +827 -0
- pyxllib/autogui/wechat_msg.py +421 -0
- pyxllib/autogui/wxautolib.py +84 -0
- pyxllib/cv/__init__.py +1 -11
- pyxllib/cv/expert.py +267 -0
- pyxllib/cv/{imlib.py → imfile.py} +18 -83
- pyxllib/cv/imhash.py +39 -0
- pyxllib/cv/pupil.py +9 -0
- pyxllib/cv/rgbfmt.py +1525 -0
- pyxllib/cv/slidercaptcha.py +137 -0
- pyxllib/cv/trackbartools.py +163 -49
- pyxllib/cv/xlcvlib.py +1040 -0
- pyxllib/cv/xlpillib.py +423 -0
- pyxllib/data/__init__.py +0 -0
- pyxllib/data/echarts.py +240 -0
- pyxllib/data/jsonlib.py +89 -0
- pyxllib/{util/oss2_.py → data/oss.py} +11 -9
- pyxllib/data/pglib.py +1127 -0
- pyxllib/data/sqlite.py +568 -0
- pyxllib/{util → data}/sqllib.py +13 -31
- pyxllib/ext/JLineViewer.py +505 -0
- pyxllib/ext/__init__.py +6 -0
- pyxllib/{util → ext}/demolib.py +119 -35
- pyxllib/ext/drissionlib.py +277 -0
- pyxllib/ext/kq5034lib.py +12 -0
- pyxllib/{util/main.py → ext/old.py} +122 -284
- pyxllib/ext/qt.py +449 -0
- pyxllib/ext/robustprocfile.py +497 -0
- pyxllib/ext/seleniumlib.py +76 -0
- pyxllib/{util/tklib.py → ext/tk.py} +10 -11
- pyxllib/ext/unixlib.py +827 -0
- pyxllib/ext/utools.py +351 -0
- pyxllib/{util/webhooklib.py → ext/webhook.py} +45 -17
- pyxllib/ext/win32lib.py +40 -0
- pyxllib/ext/wjxlib.py +88 -0
- pyxllib/ext/wpsapi.py +124 -0
- pyxllib/ext/xlwork.py +9 -0
- pyxllib/ext/yuquelib.py +1105 -0
- pyxllib/file/__init__.py +17 -0
- pyxllib/file/docxlib.py +761 -0
- pyxllib/{util → file}/gitlib.py +40 -27
- pyxllib/file/libreoffice.py +165 -0
- pyxllib/file/movielib.py +148 -0
- pyxllib/file/newbie.py +10 -0
- pyxllib/file/onenotelib.py +1469 -0
- pyxllib/file/packlib/__init__.py +330 -0
- pyxllib/{util → file/packlib}/zipfile.py +598 -195
- pyxllib/file/pdflib.py +426 -0
- pyxllib/file/pupil.py +185 -0
- pyxllib/file/specialist/__init__.py +685 -0
- pyxllib/{basic/_5_dirlib.py → file/specialist/dirlib.py} +364 -93
- pyxllib/file/specialist/download.py +193 -0
- pyxllib/file/specialist/filelib.py +2829 -0
- pyxllib/file/xlsxlib.py +3131 -0
- pyxllib/file/xlsyncfile.py +341 -0
- pyxllib/prog/__init__.py +5 -0
- pyxllib/prog/cachetools.py +64 -0
- pyxllib/prog/deprecatedlib.py +233 -0
- pyxllib/prog/filelock.py +42 -0
- pyxllib/prog/ipyexec.py +253 -0
- pyxllib/prog/multiprogs.py +940 -0
- pyxllib/prog/newbie.py +451 -0
- pyxllib/prog/pupil.py +1197 -0
- pyxllib/{sitepackages.py → prog/sitepackages.py} +5 -3
- pyxllib/prog/specialist/__init__.py +391 -0
- pyxllib/prog/specialist/bc.py +203 -0
- pyxllib/prog/specialist/browser.py +497 -0
- pyxllib/prog/specialist/common.py +347 -0
- pyxllib/prog/specialist/datetime.py +199 -0
- pyxllib/prog/specialist/tictoc.py +240 -0
- pyxllib/prog/specialist/xllog.py +180 -0
- pyxllib/prog/xlosenv.py +108 -0
- pyxllib/stdlib/__init__.py +17 -0
- pyxllib/{util → stdlib}/tablepyxl/__init__.py +1 -3
- pyxllib/{util → stdlib}/tablepyxl/style.py +1 -1
- pyxllib/{util → stdlib}/tablepyxl/tablepyxl.py +2 -4
- pyxllib/text/__init__.py +8 -0
- pyxllib/text/ahocorasick.py +39 -0
- pyxllib/text/airscript.js +744 -0
- pyxllib/text/charclasslib.py +121 -0
- pyxllib/text/jiebalib.py +267 -0
- pyxllib/text/jinjalib.py +32 -0
- pyxllib/text/jsa_ai_prompt.md +271 -0
- pyxllib/text/jscode.py +922 -0
- pyxllib/text/latex/__init__.py +158 -0
- pyxllib/text/levenshtein.py +303 -0
- pyxllib/text/nestenv.py +1215 -0
- pyxllib/text/newbie.py +300 -0
- pyxllib/text/pupil/__init__.py +8 -0
- pyxllib/text/pupil/common.py +1121 -0
- pyxllib/text/pupil/xlalign.py +326 -0
- pyxllib/text/pycode.py +47 -0
- pyxllib/text/specialist/__init__.py +8 -0
- pyxllib/text/specialist/common.py +112 -0
- pyxllib/text/specialist/ptag.py +186 -0
- pyxllib/text/spellchecker.py +172 -0
- pyxllib/text/templates/echart_base.html +11 -0
- pyxllib/text/templates/highlight_code.html +17 -0
- pyxllib/text/templates/latex_editor.html +103 -0
- pyxllib/text/vbacode.py +17 -0
- pyxllib/text/xmllib.py +747 -0
- pyxllib/xl.py +39 -0
- pyxllib/xlcv.py +17 -0
- pyxllib-0.3.197.dist-info/METADATA +48 -0
- pyxllib-0.3.197.dist-info/RECORD +126 -0
- {pyxllib-0.0.43.dist-info → pyxllib-0.3.197.dist-info}/WHEEL +4 -5
- pyxllib/basic/_1_strlib.py +0 -945
- pyxllib/basic/_2_timelib.py +0 -488
- pyxllib/basic/_3_pathlib.py +0 -916
- pyxllib/basic/_4_loglib.py +0 -419
- pyxllib/basic/__init__.py +0 -54
- pyxllib/basic/arrow_.py +0 -250
- pyxllib/basic/chardet_.py +0 -66
- pyxllib/basic/dirlib.py +0 -529
- pyxllib/basic/dprint.py +0 -202
- pyxllib/basic/extension.py +0 -12
- pyxllib/basic/judge.py +0 -31
- pyxllib/basic/log.py +0 -204
- pyxllib/basic/pathlib_.py +0 -705
- pyxllib/basic/pytictoc.py +0 -102
- pyxllib/basic/qiniu_.py +0 -61
- pyxllib/basic/strlib.py +0 -761
- pyxllib/basic/timer.py +0 -132
- pyxllib/cv/cv.py +0 -834
- pyxllib/cv/cvlib/_1_geo.py +0 -543
- pyxllib/cv/cvlib/_2_cvprcs.py +0 -309
- pyxllib/cv/cvlib/_2_imgproc.py +0 -594
- pyxllib/cv/cvlib/_3_pilprcs.py +0 -80
- pyxllib/cv/cvlib/_4_cvimg.py +0 -211
- pyxllib/cv/cvlib/__init__.py +0 -10
- pyxllib/cv/debugtools.py +0 -82
- pyxllib/cv/fitz_.py +0 -300
- pyxllib/cv/installer.py +0 -42
- pyxllib/debug/_0_installer.py +0 -38
- pyxllib/debug/_1_typelib.py +0 -277
- pyxllib/debug/_2_chrome.py +0 -198
- pyxllib/debug/_3_showdir.py +0 -161
- pyxllib/debug/_4_bcompare.py +0 -140
- pyxllib/debug/__init__.py +0 -49
- pyxllib/debug/bcompare.py +0 -132
- pyxllib/debug/chrome.py +0 -198
- pyxllib/debug/installer.py +0 -38
- pyxllib/debug/showdir.py +0 -158
- pyxllib/debug/typelib.py +0 -278
- pyxllib/image/__init__.py +0 -12
- pyxllib/torch/__init__.py +0 -20
- pyxllib/torch/modellib.py +0 -37
- pyxllib/torch/trainlib.py +0 -344
- pyxllib/util/__init__.py +0 -20
- pyxllib/util/aip_.py +0 -141
- pyxllib/util/casiadb.py +0 -59
- pyxllib/util/excellib.py +0 -495
- pyxllib/util/filelib.py +0 -612
- pyxllib/util/jsondata.py +0 -27
- pyxllib/util/jsondata2.py +0 -92
- pyxllib/util/labelmelib.py +0 -139
- pyxllib/util/onepy/__init__.py +0 -29
- pyxllib/util/onepy/onepy.py +0 -574
- pyxllib/util/onepy/onmanager.py +0 -170
- pyxllib/util/pyautogui_.py +0 -219
- pyxllib/util/textlib.py +0 -1305
- pyxllib/util/unorder.py +0 -22
- pyxllib/util/xmllib.py +0 -639
- pyxllib-0.0.43.dist-info/METADATA +0 -39
- pyxllib-0.0.43.dist-info/RECORD +0 -80
- pyxllib-0.0.43.dist-info/top_level.txt +0 -1
- {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()
|