reykit 1.1.24__py3-none-any.whl → 1.1.26__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.
reykit/rtable.py CHANGED
@@ -15,7 +15,7 @@ from os.path import abspath as os_abspath
15
15
  from pandas import DataFrame, ExcelWriter, isnull
16
16
  from sqlalchemy.engine.cursor import CursorResult
17
17
 
18
- from .ros import RFile
18
+ from .ros import File
19
19
  from .rtext import to_json, to_text
20
20
  from .rtime import time_to
21
21
 
@@ -416,7 +416,7 @@ def to_csv(
416
416
 
417
417
  # Handle parameter.
418
418
  data_df = to_df(data, fields)
419
- rfile = RFile(path)
419
+ rfile = File(path)
420
420
  if rfile:
421
421
  header = False
422
422
  else:
@@ -9,7 +9,6 @@
9
9
  """
10
10
 
11
11
 
12
- from __future__ import annotations
13
12
  from typing import Any, Literal, overload
14
13
  from collections.abc import Callable, Iterable, Generator, Coroutine
15
14
  from threading import RLock as TRLock, get_ident as threading_get_ident
@@ -31,25 +30,25 @@ from asyncio import (
31
30
  )
32
31
  from aiohttp import ClientSession, ClientResponse
33
32
 
34
- from .rexception import throw, check_most_one, check_response_code
35
- from .rtime import randn, RTimeMark
36
- from .rtype import T, RBase
33
+ from .rexc import throw, check_most_one, check_response_code
34
+ from .rtime import randn, TimeMark
35
+ from .rtype import T, Base
37
36
  from .rwrap import wrap_thread
38
37
 
39
38
 
40
39
  __all__ = (
41
- 'RThreadPool',
40
+ 'ThreadPool',
42
41
  'async_run',
43
42
  'async_sleep',
44
43
  'async_wait',
45
44
  'async_request',
46
- 'RAsyncPool'
45
+ 'AsyncPool'
47
46
  )
48
47
 
49
48
 
50
- class RThreadPool(RBase):
49
+ class ThreadPool(Base):
51
50
  """
52
- Rey's `thread pool` type.
51
+ Thread pool type.
53
52
 
54
53
  Attributes
55
54
  ----------
@@ -69,7 +68,7 @@ class RThreadPool(RBase):
69
68
  **kwargs: Any
70
69
  ) -> None:
71
70
  """
72
- Build `thread pool` instance attributes.
71
+ Build instance attributes.
73
72
 
74
73
  Parameters
75
74
  ----------
@@ -158,7 +157,7 @@ class RThreadPool(RBase):
158
157
  >>> b = (3, 4, 5)
159
158
  >>> c = (11, 12)
160
159
  >>> d = (13, 14, 15)
161
- >>> thread_pool = RThreadPool(func, 0, z=0)
160
+ >>> thread_pool = ThreadPool(func, 0, z=0)
162
161
  >>> thread_pool.batch(a, b, c=c, d=d)
163
162
  (0, 1, 3) {'z': 0, 'c': 11, 'd': 13}
164
163
  (0, 2, 4) {'z': 0, 'c': 12, 'd': 14}
@@ -475,7 +474,7 @@ async def async_wait(
475
474
  """
476
475
 
477
476
  # Set parameter.
478
- rtm = RTimeMark()
477
+ rtm = TimeMark()
479
478
  rtm()
480
479
 
481
480
  # Not set timeout.
@@ -670,9 +669,9 @@ async def async_request(
670
669
  return result
671
670
 
672
671
 
673
- class RAsyncPool(RBase):
672
+ class AsyncPool(Base):
674
673
  """
675
- Rey's `asynchronous pool` type.
674
+ Asynchronous pool type.
676
675
 
677
676
  Attributes
678
677
  ----------
@@ -691,7 +690,7 @@ class RAsyncPool(RBase):
691
690
  **kwargs: Any
692
691
  ) -> None:
693
692
  """
694
- Build `asynchronous pool` instance attributes.
693
+ Build instance attributes.
695
694
 
696
695
  Parameters
697
696
  ----------
@@ -780,7 +779,7 @@ class RAsyncPool(RBase):
780
779
  >>> b = (3, 4, 5)
781
780
  >>> c = (11, 12)
782
781
  >>> d = (13, 14, 15)
783
- >>> async_pool = RAsyncPool(func, 0, z=0)
782
+ >>> async_pool = AsyncPool(func, 0, z=0)
784
783
  >>> async_pool.batch(a, b, c=c, d=d)
785
784
  (0, 1, 3) {'z': 0, 'c': 11, 'd': 13}
786
785
  (0, 2, 4) {'z': 0, 'c': 12, 'd': 14}
reykit/rtext.py CHANGED
@@ -15,9 +15,9 @@ from decimal import Decimal
15
15
  from pprint import pformat as pprint_pformat
16
16
  from json import dumps as json_dumps
17
17
 
18
- from .rexception import throw
18
+ from .rexc import throw
19
19
  from .rmonkey import monkey_patch_pprint_modify_width_judgment
20
- from .rrandom import randi
20
+ from .rrand import randi
21
21
 
22
22
 
23
23
  __all__ = (
reykit/rtime.py CHANGED
@@ -29,12 +29,12 @@ from pandas import (
29
29
  Timedelta as PTimedelta
30
30
  )
31
31
 
32
- from .rexception import throw
33
- from .rnumber import digits, to_number
34
- from .rrandom import randn
35
- from .rregex import search
32
+ from .rexc import throw
33
+ from .rnum import digits, to_number
34
+ from .rrand import randn
35
+ from .rre import search
36
36
  from .rstdout import echo
37
- from .rtype import T
37
+ from .rtype import T, Base
38
38
 
39
39
 
40
40
  __all__ = (
@@ -44,7 +44,7 @@ __all__ = (
44
44
  'to_time',
45
45
  'sleep',
46
46
  'wait',
47
- 'RTimeMark'
47
+ 'TimeMark'
48
48
  )
49
49
 
50
50
 
@@ -482,7 +482,7 @@ def wait(
482
482
  """
483
483
 
484
484
  # Set parameter.
485
- rtm = RTimeMark()
485
+ rtm = TimeMark()
486
486
  rtm()
487
487
 
488
488
  # Not set timeout.
@@ -520,15 +520,15 @@ def wait(
520
520
  return rtm.total_spend
521
521
 
522
522
 
523
- class RTimeMark():
523
+ class TimeMark(Base):
524
524
  """
525
- Rey`s `time mark` type.
525
+ Time mark type.
526
526
  """
527
527
 
528
528
 
529
529
  def __init__(self) -> None:
530
530
  """
531
- Build `time mark` instance attributes.
531
+ Build instance attributes.
532
532
  """
533
533
 
534
534
  # Record table.
reykit/rtype.py CHANGED
@@ -17,12 +17,12 @@ __all__ = (
17
17
  'T',
18
18
  'KT',
19
19
  'VT',
20
- 'RBase',
21
- 'RStaticMeta',
22
- 'RConfigMeta',
23
- 'RSingleton',
24
- 'RNull',
25
- 'Null'
20
+ 'Base',
21
+ 'StaticMeta',
22
+ 'ConfigMeta',
23
+ 'Singleton',
24
+ 'Null',
25
+ 'null'
26
26
  )
27
27
 
28
28
 
@@ -32,15 +32,15 @@ KT = TypeVar('KT') # Any dictionary key.
32
32
  VT = TypeVar('VT') # Any dictionary value.
33
33
 
34
34
 
35
- class RBase(object):
35
+ class Base(object):
36
36
  """
37
- Rey's `base` type.
37
+ Base type.
38
38
  """
39
39
 
40
40
 
41
- class RStaticMeta(RBase, type):
41
+ class StaticMeta(Base, type):
42
42
  """
43
- Rey's `static meta` type.
43
+ Static meta type.
44
44
  """
45
45
 
46
46
 
@@ -53,9 +53,9 @@ class RStaticMeta(RBase, type):
53
53
  raise TypeError('static class, no instances allowed.')
54
54
 
55
55
 
56
- class RConfigMeta(RStaticMeta):
56
+ class ConfigMeta(StaticMeta):
57
57
  """
58
- Rey's `config meta` type.
58
+ Config meta type.
59
59
  """
60
60
 
61
61
 
@@ -91,9 +91,9 @@ class RConfigMeta(RStaticMeta):
91
91
  setattr(cls, name, value)
92
92
 
93
93
 
94
- class RSingleton(RBase):
94
+ class Singleton(Base):
95
95
  """
96
- Rey's `singleton` type.
96
+ Singleton type.
97
97
  When instantiated, method `__singleton__` will be called only once, and will accept arguments.
98
98
 
99
99
  Attributes
@@ -121,10 +121,10 @@ class RSingleton(RBase):
121
121
  return self._instance
122
122
 
123
123
 
124
- class RNull(RSingleton):
124
+ class Null(Singleton):
125
125
  """
126
- Rey's `null` type.
126
+ Null type.
127
127
  """
128
128
 
129
129
 
130
- Null = RNull()
130
+ null = Null()
reykit/rwrap.py CHANGED
@@ -18,10 +18,10 @@ from threading import Thread
18
18
  from argparse import ArgumentParser
19
19
  from contextlib import redirect_stdout
20
20
 
21
- from .rexception import catch_exc
21
+ from .rexc import catch_exc
22
22
  from .rstdout import echo
23
- from .rsystem import get_arg_info
24
- from .rtime import now, time_to, RTimeMark
23
+ from .rsys import get_arg_info
24
+ from .rtime import now, time_to, TimeMark
25
25
 
26
26
 
27
27
  __all__ = (
@@ -188,7 +188,7 @@ def wrap_runtime(
188
188
  """
189
189
 
190
190
  # Execute function and marking time.
191
- rtm = RTimeMark()
191
+ rtm = TimeMark()
192
192
  rtm()
193
193
  result = func(*args, **kwargs)
194
194
  rtm()
reykit/rzip.py CHANGED
@@ -9,12 +9,11 @@
9
9
  """
10
10
 
11
11
 
12
- from __future__ import annotations
13
12
  from zipfile import ZipFile, is_zipfile, ZIP_DEFLATED
14
13
  from os import getcwd as os_getcwd, walk as os_walk
15
14
  from os.path import join as os_join, isfile as os_isfile
16
15
 
17
- from .ros import RFile, RFolder
16
+ from .ros import File, Folder
18
17
 
19
18
 
20
19
  __all__ = (
@@ -42,17 +41,17 @@ def compress(
42
41
  """
43
42
 
44
43
  # Get parameter.
45
- build_dir = RFolder(build_dir).path
44
+ build_dir = Folder(build_dir).path
46
45
  if overwrite:
47
46
  mode = 'w'
48
47
  else:
49
48
  mode = 'x'
50
49
  is_file = os_isfile(obj_path)
51
50
  if is_file:
52
- rfile = RFile(obj_path)
51
+ rfile = File(obj_path)
53
52
  obj_name = rfile.name_suffix
54
53
  else:
55
- rfolder = RFolder(obj_path)
54
+ rfolder = Folder(obj_path)
56
55
  obj_name = rfolder.name
57
56
  build_name = obj_name + '.zip'
58
57
  build_path = os_join(build_dir, build_name)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reykit
3
- Version: 1.1.24
3
+ Version: 1.1.26
4
4
  Summary: Rey's kit method set.
5
5
  Project-URL: homepage, https://github.com/reyxbo/reykit/
6
6
  Author-email: Rey <reyxbo@163.com>
@@ -0,0 +1,29 @@
1
+ reykit/__init__.py,sha256=LdwdCXLzzPyteyYerrwfJH0LGj5jp_j-tamv2JEghTg,821
2
+ reykit/rall.py,sha256=AEHa1iUCopuM5sPzO0vmSLWTmKeSjilUtzQ8f-jULHk,649
3
+ reykit/rdata.py,sha256=Hfyj7ZnnHHDP35BY6hNh8lIl-Nepq9rZpuS8yYl3SMo,10228
4
+ reykit/remail.py,sha256=iieRd4_WfUS7LwgLr1Q_rYuFWLMwSgsBkj62Z2n6K2o,6724
5
+ reykit/rexc.py,sha256=YneNgCmPw11RMdNtV2xPVKOdXnO5-pzmdYu0y0gagQ4,8129
6
+ reykit/rimage.py,sha256=pd-9jf2fq4yC4pubMJ45V5KIkQkIoqn12T8VdS406-Q,6181
7
+ reykit/rlog.py,sha256=B0r7bSPzpFuNrz8YmdhLoyYCh40pMlB8vn78mMkUaH4,25633
8
+ reykit/rmonkey.py,sha256=XXfUng0YImTZd07A41UmtZFp9smys62-tVPQuVhK_mY,8315
9
+ reykit/rnet.py,sha256=AeyKMv66N94bs8lnhxxVgm1qRxG4cxhxU9iVB4IUE1c,15051
10
+ reykit/rnum.py,sha256=9J6unM11dDTg9A8XigHzfut8VFHWaNRKu59vGQ-ISXo,3637
11
+ reykit/ros.py,sha256=SdbiuURa4BqfTJ1bahBOJfRjn6OTelnO7lLS0DU-V_U,40592
12
+ reykit/rrand.py,sha256=pwAemF6yLcs2D6xVpJUTdHX3TNaWtCBm9YwhJSzdKwE,9195
13
+ reykit/rre.py,sha256=0yYRiHhGg2OmuEVNf3zT92AcqQTdrvIJUltiFpjlYdM,6085
14
+ reykit/rschedule.py,sha256=sSuSmKorqy7U_HRTLBL8Z-nHbSb_DGbMWAWmOhSwbBM,5799
15
+ reykit/rstdout.py,sha256=y-spetP6UfFToucY00nAVHMMqR99tXqgyA37Zf3OUcY,9879
16
+ reykit/rsys.py,sha256=9cCspYRVJvD6UyE33GPYZWNikC4UHpmViaQ8V-Kd7k8,36385
17
+ reykit/rtable.py,sha256=NBj9WXQsRvYBY4sQxyVy7EyKO8Nhoy7IH_-ax2HHxPY,12029
18
+ reykit/rtask.py,sha256=BTmb0LCB4Tu-Vb3267YqLPY-Iayth9YygGCdTM_3KVA,23053
19
+ reykit/rtext.py,sha256=KtK9d1y4NCsfydZTxrq5lnnyWvJfPi79ywy2qnauNew,11073
20
+ reykit/rtime.py,sha256=5C2TkJMvPht3RinEDOzFrqrLD-v4AaOsajkvmbincJg,17083
21
+ reykit/rtype.py,sha256=cLYeWI3C0USTt2IxNvtw0ZbkNBfmxlVanYVOwutTJjg,2262
22
+ reykit/rwrap.py,sha256=7PiePIhc-uJ6JWaAYEb-v10DVmoG7rb69MvJNw-8M5Y,15337
23
+ reykit/rzip.py,sha256=ABUDLwEHQIpcvZbJE_oV78H7dik6nC7kaRz660Ro9Os,3481
24
+ reykit/rdll/__init__.py,sha256=tdKb-BOKLFn-diCvXjSLg9x71VuRKzkg2KtpOLGLTR4,679
25
+ reykit/rdll/rdll_core.py,sha256=o6-rKcTQgxZQe0kD3GnwyNb3KL9IogzgCQNOmYLMm7A,5086
26
+ reykit-1.1.26.dist-info/METADATA,sha256=adAHYX858-5vMNV-vFonQlNSBTiwpe2DTkXFWGWoQHM,1919
27
+ reykit-1.1.26.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
28
+ reykit-1.1.26.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
29
+ reykit-1.1.26.dist-info/RECORD,,
@@ -1,41 +0,0 @@
1
- # !/usr/bin/env python
2
- # -*- coding: utf-8 -*-
3
-
4
- """
5
- @Time : 2023-12-06 16:09:59
6
- @Author : Rey
7
- @Contact : reyxbo@163.com
8
- @Explain : Inject DLL file methods.
9
- """
10
-
11
-
12
- __all__ = (
13
- 'inject_dll',
14
- )
15
-
16
-
17
- def inject_dll(
18
- id_: int,
19
- path: str
20
- ) -> None:
21
- """
22
- Inject DLL file.
23
-
24
- Parameters
25
- ----------
26
- id_ : Process ID.
27
- path : DLL file path.
28
- """
29
-
30
-
31
- from ctypes import create_string_buffer
32
-
33
- from .rdll_inject_core import InjectDLL
34
-
35
-
36
- # Get parameter.
37
- path_bytes = path.encode()
38
- buffer = create_string_buffer(path_bytes)
39
-
40
- # Inject.
41
- InjectDLL(id_, buffer)
@@ -1,30 +0,0 @@
1
- reykit/__init__.py,sha256=QwnhdUDSXgjXJQ4ClaeP9oKXUXyQOPj5sApwGCDrILc,848
2
- reykit/rall.py,sha256=mOFwHXZ4-BOkJ5Ptbm6lQc2zwNf_VqcqM6AYYnYPfoo,672
3
- reykit/rcomm.py,sha256=Y7s2yTgOf_PZ1NvVHsd5cd6STUkruC9_pbWJZDojwtA,15106
4
- reykit/rdata.py,sha256=nROfD4tvZTOXwgD1TxtCAAyA1ZW83bgzTUZcK3bLv8Y,10015
5
- reykit/remail.py,sha256=DUmueocrWlH7e_LewhHUE3xmvrLjTguwbKjR_iWqWdc,6750
6
- reykit/rexception.py,sha256=9EVP0i7NmD_XAg4J8XauYSOtANxZaGiWr0rMzW027zM,8325
7
- reykit/rimage.py,sha256=ii8tSwy6q9JE2hQwk-UetmCIFMNy4EteVb3GaCIcjI8,6267
8
- reykit/rlog.py,sha256=wt_A7mhJ2pm52Th9lE5_z8dMiZ2pw93-AiGXkOgzFG0,25752
9
- reykit/rmonkey.py,sha256=J0wtqttL0qwbIH4H0eCH4Ougf9LufhwxTqkVtXYRabw,8223
10
- reykit/rmultitask.py,sha256=IMQGP_sDquptigjdEpzf2P-wfXSESsF2yjbEEo_2NN4,23156
11
- reykit/rnumber.py,sha256=6x4FuRB-MTJheo6wbTUEaBarnew15jomlrneo3_Q2wg,3646
12
- reykit/ros.py,sha256=C9pUJVc-UZ39FhyLBmYrqFiKJHyNOAlOi3poCjbubHw,40732
13
- reykit/rrandom.py,sha256=4lTBL3IMhcurFeMOXaML_W7Q4xU4_HOW-si-13IrV3A,9246
14
- reykit/rregex.py,sha256=0yYRiHhGg2OmuEVNf3zT92AcqQTdrvIJUltiFpjlYdM,6085
15
- reykit/rschedule.py,sha256=tWqsEiXgNo5zcJtf4-MR5ZMs0fbn3ymU4M8_X1sELEc,5822
16
- reykit/rstdout.py,sha256=4AmKvn_17fAk34CRU0IAwRlXRO2wmJzS-OI09KSdMK4,9919
17
- reykit/rsystem.py,sha256=yKvXtw2291gIlAiZ1ABBagAXslOH0jyE5xgndoGGT48,36411
18
- reykit/rtable.py,sha256=M0OOoxFlMJH91lhSGauzwEP7JA0q5-Odwzpff_X-b5g,12031
19
- reykit/rtext.py,sha256=P72xFza1LVAUKEgyeBS2zQhDfJSWBdo4C5x_CfSZTwE,11081
20
- reykit/rtime.py,sha256=1FC7JU-9t9dORUBUEzeVEvS73h7LDL9W8qTm9PZDscU,17110
21
- reykit/rtype.py,sha256=O7iI_sJ1Bfl_ZiP29IHqEE3v3PfJRpeA5M6ukEdZSMk,2317
22
- reykit/rwrap.py,sha256=EQVlI07YSB2z5LbpbWqeVnQmHLwku0jCoBcaaGr-imY,15348
23
- reykit/rzip.py,sha256=i6KkmeSWCnq025d-O1mbuCYezNRUhyY9OGVK0CRlNAM,3522
24
- reykit/rdll/__init__.py,sha256=vM9V7wSNno-WH9RrxgHTIgCkQm8LmBFoLFO8z7qovNo,306
25
- reykit/rdll/rdll_inject.py,sha256=bETl8tywtN1OiQudbA21u6GwBM_bqVX7jbiisNj_JBg,645
26
- reykit/rdll/rdll_inject_core.py,sha256=Trgh_pdJs_Lw-Y-0Kkn8kHr4BnilM9dBKnHnX25T_pM,5092
27
- reykit-1.1.24.dist-info/METADATA,sha256=rsxwdhw4Cpsw2berjz2EqXwz2TYn-L2LJYkA9XhWh08,1919
28
- reykit-1.1.24.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
29
- reykit-1.1.24.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
30
- reykit-1.1.24.dist-info/RECORD,,
File without changes