gomyck-tools 1.2.10__py3-none-any.whl → 1.2.12__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.
ctools/bottle_web_base.py CHANGED
@@ -128,24 +128,24 @@ def params_resolve(func):
128
128
  if content_type == 'application/json':
129
129
  params = request.json or {}
130
130
  dict_wrapper = DictWrapper(params)
131
- dict_wrapper.query_params = query_params
131
+ dict_wrapper.update(query_params.dict)
132
132
  return func(params=dict_wrapper, *args, **kwargs)
133
133
  elif 'multipart/form-data' in content_type:
134
134
  form_data = request.forms.decode()
135
135
  form_files = request.files.decode()
136
136
  dict_wrapper = DictWrapper(form_data)
137
- dict_wrapper.query_params = query_params
137
+ dict_wrapper.update(query_params.dict)
138
138
  dict_wrapper.files = form_files
139
139
  return func(params=dict_wrapper, *args, **kwargs)
140
140
  elif 'application/x-www-form-urlencoded' in content_type:
141
141
  params = request.forms.decode()
142
142
  dict_wrapper = DictWrapper(params.dict)
143
- dict_wrapper.query_params = query_params
143
+ dict_wrapper.update(query_params.dict)
144
144
  return func(params=dict_wrapper, *args, **kwargs)
145
145
  elif 'text/plain' in content_type:
146
146
  params = request.body.read().decode('utf-8')
147
147
  dict_wrapper = DictWrapper({'body': params})
148
- dict_wrapper.query_params = query_params
148
+ dict_wrapper.update(query_params.dict)
149
149
  return func(params=dict_wrapper, *args, **kwargs)
150
150
  else:
151
151
  return func(*args, **kwargs)
ctools/cjson.py CHANGED
@@ -12,6 +12,7 @@ def dumps(obj, **kwargs) -> str:
12
12
  :param obj: 对象
13
13
  :return: json 字符串
14
14
  """
15
+ # indent = 2 可以美化输出
15
16
  if obj is None: return None
16
17
  if type(obj) == str: return obj
17
18
  return f'{jsonpickle.encode(obj, unpicklable=False, make_refs=False, **kwargs)}'
@@ -11,14 +11,20 @@
11
11
  # tpl.save('/Users/haoyang/Desktop/new_test2.docx')
12
12
 
13
13
  from docx import Document
14
- def merge_word_files(input_files, output_file):
14
+
15
+ def merge_word_files(input_files: [], output_file: str):
15
16
  merged_doc = Document()
16
17
  for file in input_files:
17
18
  doc = Document(file)
18
19
  for element in doc.element.body:
19
20
  merged_doc.element.body.append(element)
20
21
  merged_doc.save(output_file)
21
- # 示例用法
22
- input_files = ["/Users/haoyang/Desktop/xxx.docx", "/Users/haoyang/Desktop/xxx 2.docx"]
23
- output_file = "/Users/haoyang/Desktop/merged_file.docx"
24
- merge_word_files(input_files, output_file)
22
+
23
+
24
+ def read_word_file(input_file: str):
25
+ doc = Document(input_file)
26
+ text = []
27
+ for paragraph in doc.paragraphs:
28
+ text.append(paragraph.text)
29
+ return "\n".join(text)
30
+
ctools/database.py CHANGED
@@ -87,6 +87,7 @@ def generate_custom_id():
87
87
  class BaseMixin(Base):
88
88
  __abstract__ = True
89
89
  obj_id = Column(Integer, primary_key=True, default=generate_custom_id)
90
+
90
91
  # ext1 = Column(String)
91
92
  # ext2 = Column(String)
92
93
  # ext3 = Column(String)
ctools/dict_wrapper.py CHANGED
@@ -4,12 +4,11 @@ __author__ = 'haoyang'
4
4
  __date__ = '2024/10/25 09:42'
5
5
 
6
6
  class DictWrapper(dict):
7
+
7
8
  def __getattr__(self, key):
8
9
  res = self.get(key)
9
10
  if res is None:
10
- res = self.query_params.get(key)
11
- if res is None:
12
- raise AttributeError(f" ==>> {key} <<== Not Found In This Entity!!!")
11
+ raise AttributeError(f" ==>> {key} <<== Not Found In This Entity!!!")
13
12
  if isinstance(res, dict):
14
13
  return DictWrapper(res)
15
14
  return res
@@ -0,0 +1,57 @@
1
+ Metadata-Version: 2.1
2
+ Name: gomyck-tools
3
+ Version: 1.2.12
4
+ Summary: A tools collection for python development by hao474798383
5
+ Home-page: https://blog.gomyck.com
6
+ Author: gomyck
7
+ Author-email: hao474798383@163.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.9
12
+ Description-Content-Type: text/markdown
13
+ Requires-Dist: jsonpickle ~=3.4.2
14
+ Requires-Dist: SQLAlchemy ~=2.0.36
15
+ Requires-Dist: chardet ~=5.2.0
16
+ Requires-Dist: psycopg2-binary ~=2.9.10
17
+ Requires-Dist: croniter ~=5.0.1
18
+ Requires-Dist: gmssl ~=3.2.2
19
+ Requires-Dist: psutil ~=6.1.0
20
+ Requires-Dist: jsonpath-ng ~=1.7.0
21
+ Requires-Dist: bottle ~=0.13.2
22
+ Requires-Dist: requests ~=2.32.3
23
+ Requires-Dist: urllib3 ~=1.26.20
24
+ Requires-Dist: kafka-python ~=2.0.2
25
+ Requires-Dist: bs4 ~=0.0.2
26
+ Requires-Dist: paho-mqtt ~=2.1.0
27
+ Requires-Dist: fuzzywuzzy ~=0.18.0
28
+ Requires-Dist: pymysql ~=1.1.1
29
+ Requires-Dist: pyzipper ==0.3.6
30
+ Requires-Dist: prometheus-client ==0.21.1
31
+ Requires-Dist: paramiko ==3.5.0
32
+ Requires-Dist: pyjwt ==2.10.1
33
+ Requires-Dist: cryptography ==44.0.2
34
+ Requires-Dist: redis ==5.2.1
35
+
36
+ # Gomyck-Tools
37
+
38
+ ## project
39
+
40
+ https://github.com/mzxc
41
+
42
+ ## install
43
+
44
+ This package need python version >= 3.9
45
+
46
+ ```shell
47
+ pip install gomyck-tools
48
+ ```
49
+
50
+ ## usage
51
+
52
+ ```python
53
+ from ctools import sys_log
54
+ sys_log.clog.info('hello world')
55
+ ```
56
+
57
+
@@ -4,13 +4,13 @@ ctools/api_result.py,sha256=UeQXI_zuZB-uY5qECTpz1fC7EGy82yGQqWMx20tyRTw,1572
4
4
  ctools/application.py,sha256=DcuSt2m8cDuSftx6eKfJ5gA6_F9dDlzkj0K86EG4F7s,15884
5
5
  ctools/b64.py,sha256=_BdhX3p3-MaSSlU2wivN5qPxQfacR3VRBr1WC456tU0,194
6
6
  ctools/bashPath.py,sha256=BCN_EhYzqvwsxYso81omMNd3SbEociwSOyb9kLvu8V4,337
7
- ctools/bottle_web_base.py,sha256=N4B9DL4k2y-eXzWkOAoeuqHJRSntYpJHWvDk33Ma0-w,6336
7
+ ctools/bottle_web_base.py,sha256=8Nb9CF8OqWl4HNsiiZuFOH509yAqViqYcC36vFcAI5A,6328
8
8
  ctools/bottle_webserver.py,sha256=l7t_sN4ayywD1sR0kzuhGioOuaqGR9VhJh7e6Gbd6aE,4642
9
9
  ctools/bottle_websocket.py,sha256=zqCE1rGlMeC9oxFOULNd137IWIhdetq83Oq5OoH_zGI,1953
10
10
  ctools/browser_element_tools.py,sha256=IFR_tWu5on0LxhuC_4yT6EOjwCsC-juIoU8KQRDqR7E,9952
11
11
  ctools/call.py,sha256=BCr8wzt5qd70okv8IZn-9-EpjywleZgvA3u1vfZ_Kt8,1581
12
12
  ctools/cftp.py,sha256=SkHPDvKu58jnMnl68u5WxWEiFWsm2C0CGa5_GR_Obcw,2481
13
- ctools/cjson.py,sha256=g5OldDeD7bmdw_4NNNPfAREGXNplQxY_l9vtTz-UBTs,1331
13
+ ctools/cjson.py,sha256=d0RZ53b-M18OudRFGRtPCvvGofJcaLHdbNlTCemyJag,1365
14
14
  ctools/ckafka.py,sha256=EiiGCFkSbq8yRjQKVjc2_V114hKb8fJAVIOks_XbQ3w,5944
15
15
  ctools/compile_tools.py,sha256=Nybh3vnkurIKnPnubdYzigjnzFu4GaTMKPvqFdibxmE,510
16
16
  ctools/console.py,sha256=EZumuyynwteKUhUxB_XoulHswDxHd75OQB34RiZ-OBM,1807
@@ -18,10 +18,11 @@ ctools/coord_trans.py,sha256=pzIHxC4aLwvOF3eJG47Dda3vIq-Zp42xnu_FwILDflU,3951
18
18
  ctools/credis.py,sha256=sW7yDQvxa7B4dWvGwUH7GROq-7ElRMDhFT6g2C8ryfE,4522
19
19
  ctools/cron_lite.py,sha256=f9g7-64GsCxcAW-HUAvT6S-kooScl8zaJyqwHY-X_rE,8308
20
20
  ctools/ctoken.py,sha256=NZSBGF3lJajJFLRIZoeXmpp8h5cKM0dAH2weySgeORc,882
21
+ ctools/cword.py,sha256=ZRzAFn96yjo-hAbZuGIm4DoBAL2y8tFySWZ5xbYgY6Q,857
21
22
  ctools/czip.py,sha256=g-2s804R06Bnp19ByVsYeRbwx5HQf_KwrStvHimVyns,632
22
- ctools/database.py,sha256=NVdYROhlQfElAoaUloiMeQLwxENS7etY8FTZKaW0rI8,6414
23
+ ctools/database.py,sha256=4j8pPBCJ8DwZrWpeBEiLVtYDMjzkDgkPGQTkOD_kzKI,6415
23
24
  ctools/date_utils.py,sha256=h3rvlw_K2F0QTac2Zat_1us76R0P-Qj6_6NeQPfM3VE,1697
24
- ctools/dict_wrapper.py,sha256=WTU2y7BSELD4fmh3e48k7aiuOxdsa0kJYmXnqDmhy8Y,522
25
+ ctools/dict_wrapper.py,sha256=otxDX0CCKbBCVFtASweo5VEv6_ettH-CptA6azX1mJI,460
25
26
  ctools/douglas_rarefy.py,sha256=43WRjGGsQ_o1yPEXypA1Xv_yuo90RVo7qaYGRslx5gQ,4890
26
27
  ctools/download_tools.py,sha256=oJbG12Hojd0J17sAlvMU480P3abi4_AB9oZkEBGFPuo,1930
27
28
  ctools/enums.py,sha256=QbHa3j7j4-BDdwaga5Y0nYfA2uNSVJDHumYdIZdKVkM,118
@@ -52,11 +53,10 @@ ctools/thread_pool.py,sha256=qb68ULHy1K7u3MC7WP49wDhmgUhgWazd9FRuFbClET4,925
52
53
  ctools/upload_tools.py,sha256=sqe6K3ZWiyY58pFE5IO5mNaS1znnS7U4c4UqY8noED4,1068
53
54
  ctools/win_canvas.py,sha256=PAxI4i1jalfree9d1YG4damjc2EzaHZrgHZCTgk2GiM,2530
54
55
  ctools/win_control.py,sha256=35f9x_ijSyc4ZDkcT32e9ZIhr_ffNxadynrQfFuIdYo,3489
55
- ctools/wordFill.py,sha256=dB1OLt6GLmWdkDV8H20VWbJmY4ggNNI8iHD1ocae2iM,875
56
56
  ctools/word_fill.py,sha256=xeo-P4DOjQUqd-o9XL3g66wQrE2diUPGwFywm8TdVyw,18210
57
57
  ctools/word_fill_entity.py,sha256=eX3G0Gy16hfGpavQSEkCIoKDdTnNgRRJrFvKliETZK8,985
58
58
  ctools/work_path.py,sha256=OmfYu-Jjg2huRY6Su8zJ_2EGFFhtBZFbobYTwbjJtG4,1817
59
- gomyck_tools-1.2.10.dist-info/METADATA,sha256=fO_Tg_lm-pNhui62xw4AG9MQW58gvDQ1bKCyTpLqTkA,1355
60
- gomyck_tools-1.2.10.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
61
- gomyck_tools-1.2.10.dist-info/top_level.txt,sha256=-MiIH9FYRVKp1i5_SVRkaI-71WmF1sZSRrNWFU9ls3s,7
62
- gomyck_tools-1.2.10.dist-info/RECORD,,
59
+ gomyck_tools-1.2.12.dist-info/METADATA,sha256=Ouk6gMVb3jK374-BFLiozi3oMR-5idLHeBCEqfMdePA,1377
60
+ gomyck_tools-1.2.12.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
61
+ gomyck_tools-1.2.12.dist-info/top_level.txt,sha256=-MiIH9FYRVKp1i5_SVRkaI-71WmF1sZSRrNWFU9ls3s,7
62
+ gomyck_tools-1.2.12.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.6.0)
2
+ Generator: bdist_wheel (0.41.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,57 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: gomyck-tools
3
- Version: 1.2.10
4
- Summary: A tools collection for python development by hao474798383
5
- Home-page: https://blog.gomyck.com
6
- Author: gomyck
7
- Author-email: hao474798383@163.com
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: License :: OSI Approved :: MIT License
10
- Classifier: Operating System :: OS Independent
11
- Requires-Python: >=3.9
12
- Description-Content-Type: text/markdown
13
- Requires-Dist: jsonpickle~=3.4.2
14
- Requires-Dist: SQLAlchemy~=2.0.36
15
- Requires-Dist: chardet~=5.2.0
16
- Requires-Dist: psycopg2-binary~=2.9.10
17
- Requires-Dist: croniter~=5.0.1
18
- Requires-Dist: gmssl~=3.2.2
19
- Requires-Dist: psutil~=6.1.0
20
- Requires-Dist: jsonpath_ng~=1.7.0
21
- Requires-Dist: bottle~=0.13.2
22
- Requires-Dist: requests~=2.32.3
23
- Requires-Dist: urllib3~=1.26.20
24
- Requires-Dist: kafka-python~=2.0.2
25
- Requires-Dist: bs4~=0.0.2
26
- Requires-Dist: paho-mqtt~=2.1.0
27
- Requires-Dist: fuzzywuzzy~=0.18.0
28
- Requires-Dist: pymysql~=1.1.1
29
- Requires-Dist: pyzipper==0.3.6
30
- Requires-Dist: prometheus_client==0.21.1
31
- Requires-Dist: paramiko==3.5.0
32
- Requires-Dist: pyjwt==2.10.1
33
- Requires-Dist: cryptography==43.0.1
34
- Requires-Dist: redis==5.2.1
35
-
36
- # Gomyck-Tools
37
-
38
- ## project
39
-
40
- https://github.com/mzxc
41
-
42
- ## install
43
-
44
- This package need python version >= 3.9
45
-
46
- ```shell
47
- pip install gomyck-tools
48
- ```
49
-
50
- ## usage
51
-
52
- ```python
53
- from ctools import sys_log
54
- sys_log.clog.info('hello world')
55
- ```
56
-
57
-