ka-uts-com 3.0.2.250508__py3-none-any.whl → 4.0.0.250510__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.
ka_uts_com/__version__.py CHANGED
@@ -1,7 +1,7 @@
1
1
  __title__ = 'ka_uts_com'
2
2
  __description__ = 'Communication Utilities.'
3
3
  __url__ = 'https://ka-ut-com.readthedocs.io/en/latest'
4
- __version__ = '3.0.2.250508'
4
+ __version__ = '4.0.0.250510'
5
5
  __build__ = 0x022200
6
6
  __author__ = 'Bernd Stroehle'
7
7
  __author_email__ = 'bernd.stroehle@gmail.com'
ka_uts_com/com.py CHANGED
@@ -40,9 +40,9 @@ class Com:
40
40
  d_app_pacmod: TyDic = {}
41
41
 
42
42
  ts: TnTimeStamp
43
- ts_start: TnDateTime = None
44
- ts_end: TnDateTime = None
45
- ts_etime: TnDateTime = None
43
+ # ts_start: TnDateTime = None
44
+ # ts_end: TnDateTime = None
45
+ # ts_etime: TnDateTime = None
46
46
  d_timer: TyDic = {}
47
47
 
48
48
  Cfg: TnDic = None
@@ -2,12 +2,25 @@
2
2
  Decorators
3
3
  """
4
4
  # coding=utf-8
5
- from ka_uts_com.timer import Timer
5
+ # from ka_uts_com.timer import Timer
6
+ import numpy as np
7
+ from datetime import datetime
8
+ from ka_uts_uts.utils.fnc import Fnc
9
+ from ka_uts_log.log import Log
6
10
 
7
11
 
8
12
  def timer(fnc):
9
13
  def wrapper(*args, **kwargs):
10
- Timer.start(fnc)
14
+ # Timer.start(fnc, *args, **kwargs)
15
+ start = datetime.now()
11
16
  fnc(*args, **kwargs)
12
- Timer.end(fnc)
17
+ _fnc_name = Fnc.sh_fnc_name(fnc)
18
+ end = datetime.now()
19
+ # elapse_time = (end - start).total_seconds()
20
+ elapse_time = end.timestamp() - start.timestamp()
21
+ # np_elapse_time = np.format_float_positional(elapse_time, trim='-')
22
+ np_elapse_time = np.format_float_positional(elapse_time, trim='k')
23
+ msg = f"{_fnc_name} elapse time [sec] = {np_elapse_time}"
24
+ Log.info(msg, stacklevel=2)
25
+ # Timer.end(fnc, *args, **kwargs)
13
26
  return wrapper
ka_uts_com/timer.py CHANGED
@@ -3,6 +3,7 @@ from datetime import datetime
3
3
 
4
4
  from ka_uts_com.com import Com
5
5
  from ka_uts_log.log import Log
6
+ from ka_uts_uts.utils.fnc import Fnc
6
7
 
7
8
  from typing import Any
8
9
  TyAny = Any
@@ -26,42 +27,58 @@ class Timer:
26
27
  """ Timer Management
27
28
  """
28
29
  @staticmethod
29
- def sh_task_id(d_pacmod: TyDic, class_id: TyAny, parms: TnAny, sep: TyStr) -> TyStr:
30
+ def sh_args_str(*args) -> TyStr:
31
+ """
32
+ Show class name, the item class_name is the class_id if its a string,
33
+ otherwise the attribute __qualname__ is used.
34
+ """
35
+ if not args:
36
+ return ""
37
+ else:
38
+ return f"{args}"
39
+
40
+ @staticmethod
41
+ def sh_kwargs_str(**kwargs) -> TyStr:
42
+ """
43
+ Show class name, the item class_name is the class_id if its a string,
44
+ otherwise the attribute __qualname__ is used.
45
+ """
46
+ if not kwargs:
47
+ return ""
48
+ else:
49
+ return f"{kwargs}"
50
+
51
+ @classmethod
52
+ def sh_task_id(cls, fnc, *args, **kwargs) -> TyStr:
30
53
  """
31
54
  Show task id, which is created by the concationation of the following items:
32
55
  package, module, class_name and parms if they are defined; the items package
33
56
  and module are get from the package-module directory; the item class_name is
34
57
  the class_id if its a string, otherwise the attribute __qualname__ is used.
35
58
  """
36
- package = d_pacmod.get('package')
37
- module = d_pacmod.get('module')
38
- if isinstance(class_id, str):
39
- class_name = class_id
40
- else:
41
- class_name = class_id.__qualname__
42
- if not parms:
43
- parms = ""
44
- else:
45
- parms = f" {parms}"
46
- arr: TyArr = []
47
- for item in [package, module, class_name, parms]:
48
- if not item:
49
- continue
50
- arr.append(item)
51
- return sep.join(arr)
59
+ _pac_name = Fnc.sh_pac_name(fnc)
60
+ _mod_name = Fnc.sh_mod_name(fnc)
61
+ _cls_name = Fnc.sh_cls_name(fnc)
62
+ _args = cls.sh_args_str(*args)
63
+ _kwargs = cls.sh_kwargs_str(**kwargs)
64
+ _sep = kwargs.get('sep', '.')
65
+ task_id: TyStr = _sep.join([_pac_name, _mod_name, _cls_name, _args, _kwargs])
66
+ return task_id
52
67
 
53
68
  @classmethod
54
- def start(cls, class_id: TyAny, parms: TnAny = None, sep: TyStr = ".") -> None:
55
- """ Start Timer
69
+ def start(cls, fnc: TyAny, *args, **kwargs) -> None:
70
+ """
71
+ Start Timer
56
72
  """
57
- task_id = cls.sh_task_id(Com.d_app_pacmod, class_id, parms, sep)
73
+ task_id = cls.sh_task_id(fnc, *args, **kwargs)
58
74
  Com.d_timer[task_id] = datetime.now()
59
75
 
60
76
  @classmethod
61
- def end(cls, class_id: TyAny, parms: TnAny = None, sep: TyStr = ".") -> None:
62
- """ End Timer
77
+ def end(cls, fnc: TyAny, *args, **kwargs) -> None:
78
+ """
79
+ End Timer
63
80
  """
64
- task_id = cls.sh_task_id(Com.d_app_pacmod, class_id, parms, sep)
81
+ task_id = cls.sh_task_id(fnc, *args, **kwargs)
65
82
  start = Com.d_timer.get(task_id)
66
83
  end = datetime.now()
67
84
  elapse_time_sec = Timestamp.sh_elapse_time_sec(end, start)
@@ -0,0 +1,880 @@
1
+ Metadata-Version: 2.4
2
+ Name: ka_uts_com
3
+ Version: 4.0.0.250510
4
+ Summary: Utilities for Communication and CLI Processing
5
+ Author-email: Bernd Stroehle <bernd.stroehle@gmail.com>
6
+ Maintainer-email: Bernd Stroehle <bernd.stroehle@gmail.com>
7
+ Project-URL: Source Code, https://github.com/bs29/ka_uts_com/tree/master
8
+ Project-URL: Homepage, https://kosakya.de/
9
+ Project-URL: Documentation, https://ka-com.readthedocs.io/en/latest
10
+ Project-URL: Apache-2.0 License, https://apache.org/licenses/LICENSE-2.0
11
+ Project-URL: GPLv3 License, https://www.gnu.org/licenses/gpl-3.0.en.html
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Natural Language :: English
17
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
+ Requires-Python: >=3.10
19
+ Description-Content-Type: text/x-rst
20
+ License-File: LICENSE.txt
21
+ Requires-Dist: ka_uts_arr>=4.0.0.250510
22
+ Requires-Dist: ka_uts_log>=4.0.0.250510
23
+ Requires-Dist: ka_uts_uts>=4.0.0.250510
24
+ Requires-Dist: numpy>=2.2.5
25
+ Dynamic: license-file
26
+
27
+ ##########
28
+ ka_uts_com
29
+ ##########
30
+
31
+ Overview
32
+ ********
33
+
34
+ .. start short_desc
35
+
36
+ **Utilities for Communication and CLI Processing**
37
+
38
+ .. end short_desc
39
+
40
+ Installation
41
+ ************
42
+
43
+ .. start installation
44
+
45
+ The package ``ka_uts_com`` can be installed from PyPI or Anaconda.
46
+
47
+ To install with ``pip``:
48
+
49
+ .. code-block:: shell
50
+
51
+ $ python -m pip install ka_uts_com
52
+
53
+ To install with ``conda``:
54
+
55
+ .. code-block:: shell
56
+
57
+ $ conda install -c conda-forge ka_uts_com
58
+
59
+ .. end installation
60
+
61
+ Package logging
62
+ ***************
63
+
64
+ (c.f.: **Appendix**: `Package Logging`)
65
+
66
+ Package files
67
+ *************
68
+
69
+ Classification
70
+ ==============
71
+
72
+ The Package ``ka_uts_com`` consist of the following file types (c.f.: **Appendix**):
73
+
74
+ #. **Special files:** (c.f.: **Appendix:** *Special python package files*)
75
+
76
+ #. **Dunder modules:** (c.f.: **Appendix:** *Special python package modules*)
77
+
78
+ #. **Decorator modules**
79
+
80
+ a. *dec.py*
81
+
82
+ #. **Modules**
83
+
84
+ #. **Communication Modules**
85
+
86
+ a. *com.py*
87
+ #. *timer.py*
88
+
89
+ #. **Base Modules**
90
+
91
+ a. *app.py*
92
+ #. *cfg.py*
93
+ #. *exit.py*
94
+
95
+ Decorator Modules
96
+ *****************
97
+
98
+ Overview
99
+ ========
100
+
101
+ .. Decorator Modules-label:
102
+ .. table:: *Decorator Modules*
103
+
104
+ +------+-----------------+
105
+ |Name |Decription |
106
+ +======+=================+
107
+ |dec.py|Decorators module|
108
+ +------+-----------------+
109
+
110
+ Communication Modules
111
+ *********************
112
+
113
+ Overview
114
+ ========
115
+
116
+ .. Communication Modules-label:
117
+ .. table:: *Communication Modules*
118
+
119
+ +--------+-----------------------------+
120
+ |Name |Decription |
121
+ +========+=============================+
122
+ |com.py |Communication handling module|
123
+ +--------+-----------------------------+
124
+ |timer.py|Timer management module |
125
+ +--------+-----------------------------+
126
+
127
+ Communication module: com.py
128
+ ============================
129
+
130
+ The Communication Module ``com.py`` contains the single static class ``Com``.
131
+
132
+ com.py Class: Com
133
+ -----------------
134
+
135
+ The static Class ``Com`` contains the subsequent variables and methods.
136
+
137
+ Com: Variables
138
+ ^^^^^^^^^^^^^^
139
+
140
+ .. Com-Variables-label:
141
+ .. table:: *Com: Variables*
142
+
143
+ +------------+-----------+-------+---------------------------------------+
144
+ |Name |Type |Default|Description |
145
+ +============+===========+=======+=======================================+
146
+ |sw_init |TyBool |None |Initialisation switch |
147
+ +------------+-----------+-------+---------------------------------------+
148
+ |d_com_pacmod|TyDic |{} |Communication package module dictionary|
149
+ +------------+-----------+-------+---------------------------------------+
150
+ |d_app_pacmod|TyDic |{} |Application package module dictionary |
151
+ +------------+-----------+-------+---------------------------------------+
152
+ |**Timestamp fields** |
153
+ +------------+-----------+-------+---------------------------------------+
154
+ |ts |TnTimeStamp|None |Timestamp |
155
+ +------------+-----------+-------+---------------------------------------+
156
+ |ts_start |TnDateTime |None |start timestamp in date time format |
157
+ +------------+-----------+-------+---------------------------------------+
158
+ |ts_end |TnDateTime |None |end timestamp in date time format |
159
+ +------------+-----------+-------+---------------------------------------+
160
+ |ts_etime |TnDateTime |None |elapse Time |
161
+ +------------+-----------+-------+---------------------------------------+
162
+ |d_timer |TyDic |False |Timer dictionary |
163
+ +------------+-----------+-------+---------------------------------------+
164
+ |**Links to other Classes** |
165
+ +------------+-----------+-------+---------------------------------------+
166
+ |App |TyAny |False |Application class |
167
+ +------------+-----------+-------+---------------------------------------+
168
+ |cfg |TyDic |None |Configuration dictionary |
169
+ +------------+-----------+-------+---------------------------------------+
170
+ |Log |TyLogger |False |Log class |
171
+ +------------+-----------+-------+---------------------------------------+
172
+ |Exit |TyAny |False |Exit class |
173
+ +------------+-----------+-------+---------------------------------------+
174
+
175
+ Com: Methods
176
+ ^^^^^^^^^^^^
177
+
178
+ .. Com-Methods-label:
179
+ .. table:: *Com Methods*
180
+
181
+ +---------+-------------------------------------------------------+
182
+ |Name |Description |
183
+ +=========+=======================================================+
184
+ |init |Initialise static variables if they are not initialized|
185
+ +---------+-------------------------------------------------------+
186
+ |sh_kwargs|Show keyword arguments |
187
+ +---------+-------------------------------------------------------+
188
+
189
+ Com Method: init
190
+ ^^^^^^^^^^^^^^^^
191
+
192
+ Parameter
193
+ """""""""
194
+
195
+ ..Com-Method-init-Parameter-label:
196
+ .. table:: *Com Method init: Parameter*
197
+
198
+ +---------+-----+-----------------+
199
+ |Name |Type |Description |
200
+ +=========+=====+=================+
201
+ |cls |class|current class |
202
+ +---------+-----+-----------------+
203
+ |\**kwargs|TyAny|keyword arguments|
204
+ +---------+-----+-----------------+
205
+
206
+ Com Method: sh_kwargs
207
+ ^^^^^^^^^^^^^^^^^^^^^
208
+
209
+ Parameter
210
+ """""""""
211
+
212
+ .. Com-Method-sh_kwargs-Parameter-label:
213
+ .. table:: *Com Method sh_kwargs: Parameter*
214
+
215
+ +--------+-----+--------------------+
216
+ |Name |Type |Description |
217
+ +========+=====+====================+
218
+ |cls |class|current class |
219
+ +--------+-----+--------------------+
220
+ |root_cls|class|root lass |
221
+ +--------+-----+--------------------+
222
+ |d_parms |TyDic|parameter dictionary|
223
+ +--------+-----+--------------------+
224
+ |\*args |list |arguments array |
225
+ +--------+-----+--------------------+
226
+
227
+ Communication module: timer.py
228
+ ==============================
229
+
230
+ timer.py: Classes
231
+ -----------------
232
+
233
+ The Module ``timer.py`` contains the following classes
234
+
235
+
236
+ .. timer.py-Classes-label:
237
+ .. table:: *timer.py classes*
238
+
239
+ +---------+------+---------------+
240
+ |Name |Type |Description |
241
+ +=========+======+===============+
242
+ |Timestamp|static|Timestamp class|
243
+ +---------+------+---------------+
244
+ |Timer |static|Timer class |
245
+ +---------+------+---------------+
246
+
247
+ timer.py Class: Timer
248
+ ---------------------
249
+
250
+ Timer: Methods
251
+ ^^^^^^^^^^^^^^
252
+
253
+ .. Timer-Methods-label:
254
+ .. table:: *Timer Methods*
255
+
256
+ +----------+------------------------------------+
257
+ |Name |Description |
258
+ +==========+====================================+
259
+ |sh_task_id|Show task id |
260
+ +----------+------------------------------------+
261
+ |start |Start Timer |
262
+ +----------+------------------------------------+
263
+ |end |End Timer and Log Timer info message|
264
+ +----------+------------------------------------+
265
+
266
+ Timer Method: sh_task_id
267
+ ^^^^^^^^^^^^^^^^^^^^^^^^
268
+
269
+ Show task id, which is created by the concatination of the following items if they are defined:
270
+ #. package,
271
+ #. module,
272
+ #. class_name,
273
+ #. parms
274
+ The items package and module are get from the package-module directory;
275
+ The item class_name is the class_id if its a string, otherwise the attribute
276
+ __qualname__ is used.
277
+
278
+ Parameter
279
+ """""""""
280
+
281
+ .. Parameter-of-Timer-Method-sh_task_id-label:
282
+ .. table:: *Parameter of: Timer Method sh_task_id*
283
+
284
+ +--------+-----+-----------------+
285
+ |Name |Type |Description |
286
+ +========+=====+=================+
287
+ |d_pacmod|TyDic|pacmod dictionary|
288
+ +--------+-----+-----------------+
289
+ |class_id|TyAny|Class Id |
290
+ +--------+-----+-----------------+
291
+ |parms |TnAny|Parameters |
292
+ +--------+-----+-----------------+
293
+ |sep |TyStr|Separator |
294
+ +--------+-----+-----------------+
295
+
296
+ Return Value
297
+ """"""""""""
298
+
299
+ .. Timer-Method-sh_task_id-Return-Value-label:
300
+ .. table:: *Timer Method sh_task_id: Return Value*
301
+
302
+ +----+-----+-----------+
303
+ |Name|Type |Description|
304
+ +====+=====+===========+
305
+ | |TyStr|Task Id |
306
+ +----+-----+-----------+
307
+
308
+ Timer Method: start
309
+ ^^^^^^^^^^^^^^^^^^^
310
+
311
+ Parameter
312
+ """""""""
313
+
314
+ .. Parameter-of-Timer-Method-start-Parameter-label:
315
+ .. table:: *Timer Method start: Parameter*
316
+
317
+ +--------+-----+-------------+
318
+ |Name |Type |Description |
319
+ +========+=====+=============+
320
+ |cls |class|current class|
321
+ +--------+-----+-------------+
322
+ |class_id|TyAny|Class Id |
323
+ +--------+-----+-------------+
324
+ |parms |TnAny|Parameter |
325
+ +--------+-----+-------------+
326
+ |sep |TyStr|Separator |
327
+ +--------+-----+-------------+
328
+
329
+ Timer Method: end
330
+ ^^^^^^^^^^^^^^^^^
331
+
332
+ Parameter
333
+ """""""""
334
+
335
+ .. Parameter-of-Timer-Method-end-label:
336
+ .. table:: *Parameter of: Timer Method end*
337
+
338
+ +--------+-----+-------------+
339
+ |Name |Type |Description |
340
+ +========+=====+=============+
341
+ |cls |class|current class|
342
+ +--------+-----+-------------+
343
+ |class_id|TyAny|Class Id |
344
+ +--------+-----+-------------+
345
+ |parms |TnAny|Parameter |
346
+ +--------+-----+-------------+
347
+ |sep |TyStr|Separator |
348
+ +--------+-----+-------------+
349
+
350
+ Base Modules
351
+ ************
352
+
353
+ Overview
354
+ ========
355
+
356
+ .. Base Modules-label:
357
+ .. table:: *Base Modules*
358
+
359
+ +---------+----------------------------+
360
+ |Name |Decription |
361
+ +=========+============================+
362
+ |app\_.py |Application setup module |
363
+ +---------+----------------------------+
364
+ |cfg\_.py |Configuration setup module |
365
+ +---------+----------------------------+
366
+ |exit\_.py|Exit Manafement setup module|
367
+ +---------+----------------------------+
368
+
369
+ Base module: app\_.py
370
+ =====================
371
+
372
+ The Module ``app.py`` contains a single static class ``App_``.
373
+
374
+ Class: App\_
375
+ ------------
376
+
377
+ The static class ``App_`` contains the subsequent static variables and methods
378
+
379
+ App\_: Static Variables
380
+ ^^^^^^^^^^^^^^^^^^^^^^^
381
+
382
+ .. Appl\_ Static-Variables-label:
383
+ .. table:: *Appl\_ tatic Variables*
384
+
385
+ +---------------+-------+-------+---------------------+
386
+ |Name |Type |Default|Description |
387
+ +===============+=======+=======+=====================+
388
+ |sw_init |TyBool |False |initialisation switch|
389
+ +---------------+-------+-------+---------------------+
390
+ |httpmod |TyDic |None |http modus |
391
+ +---------------+-------+-------+---------------------+
392
+ |sw_replace_keys|TnBool |False |replace keys switch |
393
+ +---------------+-------+-------+---------------------+
394
+ |keys |TnArr |None |Keys array |
395
+ +---------------+-------+-------+---------------------+
396
+ |reqs |TyDic |None |Requests dictionary |
397
+ +---------------+-------+-------+---------------------+
398
+ |app |TyDic |None |Appliction dictionary|
399
+ +---------------+-------+-------+---------------------+
400
+
401
+ App\_: Methods
402
+ ^^^^^^^^^^^^^^
403
+
404
+ .. App\_-Methods-label:
405
+ .. table:: *App\_ Methods*
406
+
407
+ +----+------+------------------------------------+
408
+ |Name|Type |Description |
409
+ +====+======+====================================+
410
+ |init|class |initialise static variables of class|
411
+ | | |if they are not allready initialized|
412
+ +----+------+------------------------------------+
413
+ |sh |class |show (return) class |
414
+ +----+------+------------------------------------+
415
+
416
+ App\_ Method: init
417
+ ^^^^^^^^^^^^^^^^^^
418
+
419
+ Parameter
420
+ """""""""
421
+
422
+ .. Parameter-of-App\_-Method-init-label:
423
+ .. table:: *Parameter of: App\_ Method init*
424
+
425
+ +---------+-----+-----------------+
426
+ |Name |Type |Description |
427
+ +=========+=====+=================+
428
+ |cls |class|Current class |
429
+ +---------+-----+-----------------+
430
+ |\**kwargs|TyAny|Keyword arguments|
431
+ +---------+-----+-----------------+
432
+
433
+ App\_ Method: sh
434
+ ^^^^^^^^^^^^^^^^
435
+
436
+ .. App\_-Method-sh-label:
437
+ .. table:: *App\_ Method: sh*
438
+
439
+ +---------+-----+-----------------+
440
+ |Name |Type |Description |
441
+ +=========+=====+=================+
442
+ |cls |class|Current class |
443
+ +---------+-----+-----------------+
444
+ |\**kwargs|TyAny|Keyword arguments|
445
+ +---------+-----+-----------------+
446
+
447
+ Return Value
448
+ """"""""""""
449
+
450
+ .. App\_-Method-sh-Return-Value-label:
451
+ .. table:: *App\_ Method sh: Return Value*
452
+
453
+ +----+--------+-----------+
454
+ |Name|Type |Description|
455
+ +====+========+===========+
456
+ |log |TyLogger|Logger |
457
+ +----+--------+-----------+
458
+
459
+ Base module: cfg\_.py
460
+ =====================
461
+
462
+ The Base module cfg\_.py contains a single static class ``Cfg_``.
463
+
464
+ cfg\_.py Class Cfg\_
465
+ ---------------------
466
+
467
+ The static class ``Cfg_`` contains the subsequent static variables and methods
468
+
469
+ Cfg\_Static Variables
470
+ ^^^^^^^^^^^^^^^^^^^^^
471
+
472
+ .. Cfg\_-Static-Variables-label:
473
+ .. table:: *Cfg\_ Static Variables*
474
+
475
+ +----+-----+-------+--------------------+
476
+ |Name|Type |Default|Description |
477
+ +====+=====+=======+====================+
478
+ |cfg |TyDic|None |Configuration object|
479
+ +----+-----+-------+--------------------+
480
+
481
+ Cfg\_ Methods
482
+ ^^^^^^^^^^^^^
483
+
484
+ .. Cfg\_-Methods-label:
485
+ .. table:: *Cfg\_ Methods*
486
+
487
+ +----+------+-----------------------------------+
488
+ |Name|Type |Description |
489
+ +====+======+===================================+
490
+ |sh |class |read pacmod yaml file into class |
491
+ | | |variable cls.dic and return cls.cfg|
492
+ +----+------+-----------------------------------+
493
+
494
+ Cfg\_ Method: sh
495
+ ^^^^^^^^^^^^^^^^
496
+
497
+ Parameter
498
+ """""""""
499
+
500
+ .. Cfg\_-Method-sh-Parameter-label:
501
+ .. table:: *Cfg\_ Method sh: Parameter*
502
+
503
+ +--------+--------+-----------------+
504
+ |Name |Type |Description |
505
+ +========+========+=================+
506
+ |cls |class |Current class |
507
+ +--------+--------+-----------------+
508
+ |log |TyLogger|Logger |
509
+ +--------+--------+-----------------+
510
+ |d_pacmod|TyDic |pacmod dictionary|
511
+ +--------+--------+-----------------+
512
+
513
+ Return Value
514
+ """"""""""""
515
+
516
+ .. Cfg\_-Method-sh-Return-Value-label:
517
+ .. table:: *Cfg\_ Method sh: Return Value*
518
+
519
+ +-------+-----+-----------+
520
+ |Name |Type |Description|
521
+ +=======+=====+===========+
522
+ |cls.cfg|TyDic| |
523
+ +-------+-----+-----------+
524
+
525
+ Base Modul: exit\_.py
526
+ =====================
527
+
528
+ The Base module exit\_.py contains a single static class ``Ext_``.
529
+
530
+ exit\_.py class: Exit\_
531
+ -----------------------
532
+
533
+ The static Class ``Exit_`` of Module exit\_.py contains the subsequent static variables and methods.
534
+
535
+ Exit\_: Variables
536
+ ^^^^^^^^^^^^^^^^^
537
+
538
+ .. Exit\_-Variables-label:
539
+ .. table:: *Exit\_ Variables*
540
+
541
+ +--------------+------+-------+---------------------+
542
+ |Name |Type |Default|Description |
543
+ +==============+======+=======+=====================+
544
+ |sw_init |TyBool|False |initialisation switch|
545
+ +--------------+------+-------+---------------------+
546
+ |sw_critical |TyBool|False |critical switch |
547
+ +--------------+------+-------+---------------------+
548
+ |sw_stop |TyBool|False |stop switch |
549
+ +--------------+------+-------+---------------------+
550
+ |sw_interactive|TyBool|False |interactive switch |
551
+ +--------------+------+-------+---------------------+
552
+
553
+ Exit\_: Methods
554
+ ^^^^^^^^^^^^^^^
555
+
556
+ .. Exit\_-Methods-label:
557
+ .. table:: *Exit\_ Methods*
558
+
559
+ +----+------+------------------------------------+
560
+ |Name|Method|Description |
561
+ +====+======+====================================+
562
+ |init|class |initialise static variables of class|
563
+ | | |if they are not allready initialized|
564
+ +----+------+------------------------------------+
565
+ |sh |class |show (return) class |
566
+ +----+------+------------------------------------+
567
+
568
+ Exit\_: Method: init
569
+ ^^^^^^^^^^^^^^^^^^^^
570
+
571
+ Parameter
572
+ """""""""
573
+
574
+ .. Exit\_-Method-init-Parameter:
575
+ .. table:: *Exit\_ Method init: Parameter*
576
+
577
+ +---------+-----+-----------------+
578
+ |Name |Type |Description |
579
+ +=========+=====+=================+
580
+ |cls |class|Current class |
581
+ +---------+-----+-----------------+
582
+ |\**kwargs|TyAny|Keyword arguments|
583
+ +---------+-----+-----------------+
584
+
585
+ Exit\_: Method: sh
586
+ ^^^^^^^^^^^^^^^^^^
587
+
588
+ Parameter
589
+ """""""""
590
+
591
+ .. Exit\_-Method-sh-Parameter:
592
+ .. table:: *Exit\_ Method sh: Parameter*
593
+
594
+ +---------+-----+-----------------+
595
+ |Name |Type |Description |
596
+ +=========+=====+=================+
597
+ |cls |class|Current class |
598
+ +---------+-----+-----------------+
599
+ |\**kwargs|TyAny|Keyword arguments|
600
+ +---------+-----+-----------------+
601
+
602
+ Return Value
603
+ """"""""""""
604
+
605
+ .. Exit\_-Method-sh-Return-Value:
606
+ .. table:: *Exit\_ Method sh: Return Value*
607
+
608
+ +----+-----+-------------+
609
+ |Name|Type |Description |
610
+ +====+=====+=============+
611
+ |cls |class|Current class|
612
+ +----+-----+-------------+
613
+
614
+ Appendix
615
+ ********
616
+
617
+ Package Logging
618
+ ===============
619
+
620
+ Description
621
+ -----------
622
+
623
+ The Standard or user specifig logging is carried out by the log.py module of the logging
624
+ package ka_uts_log using the configuration files **ka_std_log.yml** or **ka_usr_log.yml**
625
+ in the configuration directory **cfg** of the logging package **ka_uts_log**.
626
+ The Logging configuration of the logging package could be overriden by yaml files with
627
+ the same names in the configuration directory **cfg** of the application packages.
628
+
629
+ Log message types
630
+ -----------------
631
+
632
+ Logging defines log file path names for the following log message types: .
633
+
634
+ #. *debug*
635
+ #. *info*
636
+ #. *warning*
637
+ #. *error*
638
+ #. *critical*
639
+
640
+ Application parameter for logging
641
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
642
+
643
+ .. Application-parameter-used-in-log-naming-label:
644
+ .. table:: *Application parameter used in log naming*
645
+
646
+ +-----------------+---------------------------+----------+------------+
647
+ |Name |Decription |Values |Example |
648
+ +=================+===========================+==========+============+
649
+ |dir_dat |Application data directory | |/otev/data |
650
+ +-----------------+---------------------------+----------+------------+
651
+ |tenant |Application tenant name | |UMH |
652
+ +-----------------+---------------------------+----------+------------+
653
+ |package |Application package name | |otev_xls_srr|
654
+ +-----------------+---------------------------+----------+------------+
655
+ |cmd |Application command | |evupreg |
656
+ +-----------------+---------------------------+----------+------------+
657
+ |pid |Process ID | |æevupreg |
658
+ +-----------------+---------------------------+----------+------------+
659
+ |log_ts_type |Timestamp type used in |ts, |ts |
660
+ | |logging files|ts, dt |dt | |
661
+ +-----------------+---------------------------+----------+------------+
662
+ |log_sw_single_dir|Enable single log directory|True, |True |
663
+ | |or multiple log directories|False | |
664
+ +-----------------+---------------------------+----------+------------+
665
+
666
+ Log type and Log directories
667
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
668
+
669
+ Single or multiple Application log directories can be used for each message type:
670
+
671
+ .. Log-types-and-Log-directories-label:
672
+ .. table:: *Log types and directoriesg*
673
+
674
+ +--------------+---------------+
675
+ |Log type |Log directory |
676
+ +--------+-----+--------+------+
677
+ |long |short|multiple|single|
678
+ +========+=====+========+======+
679
+ |debug |dbqs |dbqs |logs |
680
+ +--------+-----+--------+------+
681
+ |info |infs |infs |logs |
682
+ +--------+-----+--------+------+
683
+ |warning |wrns |wrns |logs |
684
+ +--------+-----+--------+------+
685
+ |error |errs |errs |logs |
686
+ +--------+-----+--------+------+
687
+ |critical|crts |crts |logs |
688
+ +--------+-----+--------+------+
689
+
690
+ Log files naming
691
+ ^^^^^^^^^^^^^^^^
692
+
693
+ Naming Conventions
694
+ """"""""""""""""""
695
+
696
+ .. Naming-conventions-for-logging-file-paths-label:
697
+ .. table:: *Naming conventions for logging file paths*
698
+
699
+ +--------+-------------------------------------------------------+-------------------------+
700
+ |Type |Directory |File |
701
+ +========+=======================================================+=========================+
702
+ |debug |/<dir_dat>/<tenant>/RUN/<package>/<cmd>/<Log directory>|<Log type>_<ts>_<pid>.log|
703
+ +--------+-------------------------------------------------------+-------------------------+
704
+ |info |/<dir_dat>/<tenant>/RUN/<package>/<cmd>/<Log directory>|<Log type>_<ts>_<pid>.log|
705
+ +--------+-------------------------------------------------------+-------------------------+
706
+ |warning |/<dir_dat>/<tenant>/RUN/<package>/<cmd>/<Log directory>|<Log type>_<ts>_<pid>.log|
707
+ +--------+-------------------------------------------------------+-------------------------+
708
+ |error |/<dir_dat>/<tenant>/RUN/<package>/<cmd>/<Log directory>|<Log type>_<ts>_<pid>.log|
709
+ +--------+-------------------------------------------------------+-------------------------+
710
+ |critical|/<dir_dat>/<tenant>/RUN/<package>/<cmd>/<Log directory>|<Log type>_<ts>_<pid>.log|
711
+ +--------+-------------------------------------------------------+-------------------------+
712
+
713
+ Naming Examples
714
+ """""""""""""""
715
+
716
+ .. Naming-examples-for-logging-file-paths-label:
717
+ .. table:: *Naming examples for logging file paths*
718
+
719
+ +--------+--------------------------------------------+------------------------+
720
+ |Type |Directory |File |
721
+ +========+============================================+========================+
722
+ |debug |/data/otev/umh/RUN/otev_xls_srr/evupreg/logs|debs_1737118199_9470.log|
723
+ +--------+--------------------------------------------+------------------------+
724
+ |info |/data/otev/umh/RUN/otev_xls_srr/evupreg/logs|infs_1737118199_9470.log|
725
+ +--------+--------------------------------------------+------------------------+
726
+ |warning |/data/otev/umh/RUN/otev_xls_srr/evupreg/logs|wrns_1737118199_9470.log|
727
+ +--------+--------------------------------------------+------------------------+
728
+ |error |/data/otev/umh/RUN/otev_xls_srr/evupreg/logs|errs_1737118199_9470.log|
729
+ +--------+--------------------------------------------+------------------------+
730
+ |critical|/data/otev/umh/RUN/otev_xls_srr/evupreg/logs|crts_1737118199_9470.log|
731
+ +--------+--------------------------------------------+------------------------+
732
+
733
+ Python Terminology
734
+ ==================
735
+
736
+ Python packages
737
+ ---------------
738
+
739
+ .. Python packages-label:
740
+ .. table:: *Python packages*
741
+
742
+ +-----------+-----------------------------------------------------------------+
743
+ |Name |Definition |
744
+ +===========+==========+======================================================+
745
+ |Python |Python packages are directories that contains the special module |
746
+ |package |``__init__.py`` and other modules, packages files or directories.|
747
+ +-----------+-----------------------------------------------------------------+
748
+ |Python |Python sub-packages are python packages which are contained in |
749
+ |sub-package|another pyhon package. |
750
+ +-----------+-----------------------------------------------------------------+
751
+
752
+ Python package Sub-directories
753
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
754
+
755
+ .. Python package-Sub-directories-label:
756
+ .. table:: *Python packages Sub-directories*
757
+
758
+ +----------------------+-------------------------------+
759
+ |Name |Definition |
760
+ +======================+==========+====================+
761
+ |Python package |Sub-directories are directories|
762
+ |sub-directory |contained in python packages. |
763
+ +----------------------+-------------------------------+
764
+ |Special Python package|Python package sub-directories |
765
+ |sub-directory |with a special meaning. |
766
+ +----------------------+-------------------------------+
767
+
768
+ Special python package Sub-directories
769
+ """"""""""""""""""""""""""""""""""""""
770
+
771
+ .. Special-python-package-Sub-directories-label:
772
+ .. table:: *Special python Sub-directories*
773
+
774
+ +-------+------------------------------------------+
775
+ |Name |Description |
776
+ +=======+==========================================+
777
+ |bin |Directory for package scripts. |
778
+ +-------+------------------------------------------+
779
+ |cfg |Directory for package configuration files.|
780
+ +-------+------------------------------------------+
781
+ |data |Directory for package data files. |
782
+ +-------+------------------------------------------+
783
+ |service|Directory for systemd service scripts. |
784
+ +-------+------------------------------------------+
785
+
786
+ Python package files
787
+ ^^^^^^^^^^^^^^^^^^^^
788
+
789
+ .. Python-package-files-label:
790
+ .. table:: *Python package files*
791
+
792
+ +--------------+---------------------------------------------------------+
793
+ |Name |Definition |
794
+ +==============+==========+==============================================+
795
+ |Python |Files within a python package. |
796
+ |package files | |
797
+ +--------------+---------------------------------------------------------+
798
+ |Special python|Package files which are not modules and used as python |
799
+ |package files |and used as python marker files like ``__init__.py``. |
800
+ +--------------+---------------------------------------------------------+
801
+ |Python package|Files with suffix ``.py``; they could be empty or contain|
802
+ |module |python code; other modules can be imported into a module.|
803
+ +--------------+---------------------------------------------------------+
804
+ |Special python|Modules like ``__init__.py`` or ``main.py`` with special |
805
+ |package module|names and functionality. |
806
+ +--------------+---------------------------------------------------------+
807
+
808
+ Special python package files
809
+ """"""""""""""""""""""""""""
810
+
811
+ .. Special-python-package-files-label:
812
+ .. table:: *Special python package files*
813
+
814
+ +--------+--------+---------------------------------------------------------------+
815
+ |Name |Type |Description |
816
+ +========+========+===============================================================+
817
+ |py.typed|Type |The ``py.typed`` file is a marker file used in Python packages |
818
+ | |checking|to indicate that the package supports type checking. This is a |
819
+ | |marker |part of the PEP 561 standard, which provides a standardized way|
820
+ | |file |to package and distribute type information in Python. |
821
+ +--------+--------+---------------------------------------------------------------+
822
+
823
+ Special python package modules
824
+ """"""""""""""""""""""""""""""
825
+
826
+ .. Special-Python-package-modules-label:
827
+ .. table:: *Special Python package modules*
828
+
829
+ +--------------+-----------+-----------------------------------------------------------------+
830
+ |Name |Type |Description |
831
+ +==============+===========+=================================================================+
832
+ |__init__.py |Package |The dunder (double underscore) module ``__init__.py`` is used to |
833
+ | |directory |execute initialisation code or mark the directory it contains as |
834
+ | |marker |a package. The Module enforces explicit imports and thus clear |
835
+ | |file |namespace use and call them with the dot notation. |
836
+ +--------------+-----------+-----------------------------------------------------------------+
837
+ |__main__.py |entry point|The dunder module ``__main__.py`` serves as an entry point for |
838
+ | |for the |the package. The module is executed when the package is called by|
839
+ | |package |the interpreter with the command **python -m <package name>**. |
840
+ +--------------+-----------+-----------------------------------------------------------------+
841
+ |__version__.py|Version |The dunder module ``__version__.py`` consist of assignment |
842
+ | |file |statements used in Versioning. |
843
+ +--------------+-----------+-----------------------------------------------------------------+
844
+
845
+ Python elements
846
+ ---------------
847
+
848
+ .. Python elements-label:
849
+ .. table:: *Python elements*
850
+
851
+ +---------------------+--------------------------------------------------------+
852
+ |Name |Description |
853
+ +=====================+========================================================+
854
+ |Python method |Python functions defined in python modules. |
855
+ +---------------------+--------------------------------------------------------+
856
+ |Special python method|Python functions with special names and functionalities.|
857
+ +---------------------+--------------------------------------------------------+
858
+ |Python class |Classes defined in python modules. |
859
+ +---------------------+--------------------------------------------------------+
860
+ |Python class method |Python methods defined in python classes |
861
+ +---------------------+--------------------------------------------------------+
862
+
863
+ Special python methods
864
+ ^^^^^^^^^^^^^^^^^^^^^^
865
+
866
+ .. Special-python-methods-label:
867
+ .. table:: *Special python methods*
868
+
869
+ +--------+------------+----------------------------------------------------------+
870
+ |Name |Type |Description |
871
+ +========+============+==========================================================+
872
+ |__init__|class object|The special method ``__init__`` is called when an instance|
873
+ | |constructor |(object) of a class is created; instance attributes can be|
874
+ | |method |defined and initalized in the method. |
875
+ +--------+------------+----------------------------------------------------------+
876
+
877
+ Table of Contents
878
+ =================
879
+
880
+ .. contents:: **Table of Content**
@@ -0,0 +1,14 @@
1
+ ka_uts_com/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ ka_uts_com/__version__.py,sha256=cDeKJoJXH0P7QinCjk6rgnqE1iSbzwkcXPtGuFPor-g,365
3
+ ka_uts_com/app.py,sha256=XrMhqQI9YHzw1XmC8zGgCJwrwxzkHtHDEQIo9gP07DI,1151
4
+ ka_uts_com/cfg.py,sha256=RNWxOz3XtP0HgH0z1e6tAQA_L0alEh82_EOPOoyv3R4,768
5
+ ka_uts_com/com.py,sha256=DdL9754luzZqmHq_r6YKG4gxSSsxOGoVMohF5jaJZ8Q,1943
6
+ ka_uts_com/exit.py,sha256=RIpFKwEGeBCBBPPQXIcLsrYeNY2dTF8BDlESe6UhdMo,791
7
+ ka_uts_com/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ ka_uts_com/timer.py,sha256=qVKanfNBnsU3B6C-Y5mjHWnS056GiYlRmFwEnX6BAU0,2546
9
+ ka_uts_com/decorators/dec.py,sha256=8oKf3yvJSEakjr0HuQKcc3F0qgRmDskxr6hnQaw4r_I,841
10
+ ka_uts_com-4.0.0.250510.dist-info/licenses/LICENSE.txt,sha256=BiT3QGI_2iRbdvgS3HDig57lnXJVk60Pj4xM9eeCczI,814
11
+ ka_uts_com-4.0.0.250510.dist-info/METADATA,sha256=Z8KlB7LZ_ali-3r6BaJtudD4nKansscm0MISiGBl4k8,32001
12
+ ka_uts_com-4.0.0.250510.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
13
+ ka_uts_com-4.0.0.250510.dist-info/top_level.txt,sha256=cWCIrm1g6Jn-FbCQuB3wBrrNH1YwqVlc6mE0jV6vg74,21
14
+ ka_uts_com-4.0.0.250510.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.45.1)
2
+ Generator: setuptools (80.4.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,24 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: ka-uts-com
3
- Version: 3.0.2.250508
4
- Summary: Communication and CLIs Utilities
5
- Author-email: Bernd Stroehle <bernd.stroehle@gmail.com>
6
- Maintainer-email: Bernd Stroehle <bernd.stroehle@gmail.com>
7
- Project-URL: Source Code, https://github.com/bs29/ka_uts_com/tree/master
8
- Project-URL: Homepage, https://kosakya.de/
9
- Project-URL: Documentation, https://ka-com.readthedocs.io/en/latest
10
- Project-URL: Apache-2.0 License, https://apache.org/licenses/LICENSE-2.0
11
- Project-URL: GPLv3 License, https://www.gnu.org/licenses/gpl-3.0.en.html
12
- Classifier: Development Status :: 5 - Production/Stable
13
- Classifier: Intended Audience :: Developers
14
- Classifier: Operating System :: OS Independent
15
- Classifier: Programming Language :: Python :: 3.11
16
- Classifier: Natural Language :: English
17
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
- Requires-Python: >=3.10
19
- Description-Content-Type: text/x-rst
20
- License-File: LICENSE.txt
21
- Requires-Dist: ka-uts-arr>=3.0.1.250507
22
- Requires-Dist: ka-uts-log>=3.0.0.250505
23
- Requires-Dist: ka-uts-uts>=3.0.2.250507
24
-
@@ -1,14 +0,0 @@
1
- ka_uts_com/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- ka_uts_com/__version__.py,sha256=6nh1rvCvZPhiDXbv8-IqXc77fGRLA3W8Bcit_j03-w8,365
3
- ka_uts_com/app.py,sha256=XrMhqQI9YHzw1XmC8zGgCJwrwxzkHtHDEQIo9gP07DI,1151
4
- ka_uts_com/cfg.py,sha256=RNWxOz3XtP0HgH0z1e6tAQA_L0alEh82_EOPOoyv3R4,768
5
- ka_uts_com/com.py,sha256=PmbQ46Ecneuh9DHuJ40yFcrwCJYfx_Uqlw4NyliVovY,1937
6
- ka_uts_com/exit.py,sha256=RIpFKwEGeBCBBPPQXIcLsrYeNY2dTF8BDlESe6UhdMo,791
7
- ka_uts_com/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- ka_uts_com/timer.py,sha256=hSNDh5qV6stSRLLEv-G_eMRoglsOU9N2HvRPUQ-s7yU,2153
9
- ka_uts_com/decorators/dec.py,sha256=NHerkpjOYpJXz2CIh9HlN3_YCyLv-SbyQL4ldyGUSpM,217
10
- ka_uts_com-3.0.2.250508.dist-info/LICENSE.txt,sha256=BiT3QGI_2iRbdvgS3HDig57lnXJVk60Pj4xM9eeCczI,814
11
- ka_uts_com-3.0.2.250508.dist-info/METADATA,sha256=H5kplnyF66eoLluuBDmYDD5VPncA4CFQllqG-gMK_DI,1068
12
- ka_uts_com-3.0.2.250508.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
13
- ka_uts_com-3.0.2.250508.dist-info/top_level.txt,sha256=cWCIrm1g6Jn-FbCQuB3wBrrNH1YwqVlc6mE0jV6vg74,21
14
- ka_uts_com-3.0.2.250508.dist-info/RECORD,,