reykit 1.1.38__py3-none-any.whl → 1.1.40__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/rdata.py CHANGED
@@ -409,10 +409,10 @@ class FunctionGenerator(Base):
409
409
  self.args = args
410
410
  self.kwargs = kwargs
411
411
  self.params: list[tuple[tuple, dict]] = []
412
- self.generator = self._generator()
412
+ self.generator = self.__generator()
413
413
 
414
414
 
415
- def _generator(self) -> Generator[Any, Any, None]:
415
+ def __generator(self) -> Generator[Any, Any, None]:
416
416
  """
417
417
  Create generator.
418
418
 
reykit/rlog.py CHANGED
@@ -106,7 +106,7 @@ class Log(Base):
106
106
  self.logger.setLevel(self.DEBUG)
107
107
 
108
108
 
109
- def _get_message_stack(self) -> dict:
109
+ def __get_message_stack(self) -> dict:
110
110
  """
111
111
  Get message stack parameters.
112
112
 
@@ -145,7 +145,7 @@ class Log(Base):
145
145
  return stack_param
146
146
 
147
147
 
148
- def _supply_format_standard(
148
+ def __supply_format_standard(
149
149
  self,
150
150
  format_: str,
151
151
  record: LogRecord
@@ -171,7 +171,7 @@ class Log(Base):
171
171
 
172
172
  # Format 'format_path'.
173
173
  if '%(format_path)s' in format_:
174
- message_stack = self._get_message_stack()
174
+ message_stack = self.__get_message_stack()
175
175
  record.format_path = '%s:%s' % (
176
176
  message_stack['filename'],
177
177
  message_stack['lineno']
@@ -213,7 +213,7 @@ class Log(Base):
213
213
  return color_code
214
214
 
215
215
 
216
- def _supply_format_print(
216
+ def __supply_format_print(
217
217
  self,
218
218
  format_: str,
219
219
  record: LogRecord
@@ -267,7 +267,7 @@ class Log(Base):
267
267
  )
268
268
 
269
269
 
270
- def _supply_format_file(
270
+ def __supply_format_file(
271
271
  self,
272
272
  format_: str,
273
273
  record: LogRecord
@@ -326,17 +326,17 @@ class Log(Base):
326
326
  """
327
327
 
328
328
  # Format standard.
329
- self._supply_format_standard(format_, record)
329
+ self.__supply_format_standard(format_, record)
330
330
 
331
331
  match mode:
332
332
 
333
333
  # Format print.
334
334
  case 'print':
335
- self._supply_format_print(format_, record)
335
+ self.__supply_format_print(format_, record)
336
336
 
337
337
  # Format file.
338
338
  case 'file':
339
- self._supply_format_file(format_, record)
339
+ self.__supply_format_file(format_, record)
340
340
 
341
341
  return True
342
342
 
reykit/rmonkey.py CHANGED
@@ -259,7 +259,7 @@ def monkey_patch_pprint_modify_width_judgment() -> None:
259
259
 
260
260
 
261
261
  # Define.
262
- def _format(_self, obj, stream, indent, allowance, context, level):
262
+ def __format(_self, obj, stream, indent, allowance, context, level):
263
263
 
264
264
  from .rtext import get_width
265
265
 
@@ -289,7 +289,7 @@ def monkey_patch_pprint_modify_width_judgment() -> None:
289
289
 
290
290
 
291
291
  # Modify.
292
- PrettyPrinter._format = _format
292
+ PrettyPrinter.__format = __format
293
293
 
294
294
 
295
295
  def monkey_path_pil_image_get_bytes():
reykit/rnet.py CHANGED
@@ -9,7 +9,7 @@
9
9
  """
10
10
 
11
11
 
12
- from typing import Any, Literal, TypedDict, NotRequired
12
+ from typing import Any, Literal, TypedDict, NotRequired, overload
13
13
  from collections.abc import Callable, Iterable
14
14
  from warnings import filterwarnings
15
15
  from os.path import abspath as os_abspath, isfile as os_isfile
@@ -206,6 +206,67 @@ def get_content_type(file: str | bytes) -> str | None:
206
206
  return file_type
207
207
 
208
208
 
209
+ @overload
210
+ def request(
211
+ url: str,
212
+ params: dict | None = None,
213
+ *,
214
+ headers: dict[str, str] = {},
215
+ timeout: float | None = None,
216
+ proxies: dict[str, str] = {},
217
+ stream: bool = False,
218
+ verify: bool = False,
219
+ method: Literal['get', 'post', 'put', 'patch', 'delete', 'options', 'head'] = Literal['get'],
220
+ check: bool | int | Iterable[int] = False
221
+ ) -> Response: ...
222
+
223
+ @overload
224
+ def request(
225
+ url: str,
226
+ params: dict | None = None,
227
+ *,
228
+ data: dict | str | bytes,
229
+ files: dict[str, str | bytes | tuple[str | bytes, dict]] | None = None,
230
+ headers: dict[str, str] = {},
231
+ timeout: float | None = None,
232
+ proxies: dict[str, str] = {},
233
+ stream: bool = False,
234
+ verify: bool = False,
235
+ method: Literal['get', 'post', 'put', 'patch', 'delete', 'options', 'head'] | None = Literal['post'],
236
+ check: bool | int | Iterable[int] = False
237
+ ) -> Response: ...
238
+
239
+ @overload
240
+ def request(
241
+ url: str,
242
+ params: dict | None = None,
243
+ *,
244
+ data: dict | str | bytes | None = None,
245
+ files: dict[str, str | bytes | tuple[str | bytes, dict]],
246
+ headers: dict[str, str] = {},
247
+ timeout: float | None = None,
248
+ proxies: dict[str, str] = {},
249
+ stream: bool = False,
250
+ verify: bool = False,
251
+ method: Literal['get', 'post', 'put', 'patch', 'delete', 'options', 'head'] | None = Literal['post'],
252
+ check: bool | int | Iterable[int] = False
253
+ ) -> Response: ...
254
+
255
+ @overload
256
+ def request(
257
+ url: str,
258
+ params: dict | None = None,
259
+ *,
260
+ json: dict,
261
+ headers: dict[str, str] = {},
262
+ timeout: float | None = None,
263
+ proxies: dict[str, str] = {},
264
+ stream: bool = False,
265
+ verify: bool = False,
266
+ method: Literal['get', 'post', 'put', 'patch', 'delete', 'options', 'head'] | None = Literal['post'],
267
+ check: bool | int | Iterable[int] = False
268
+ ) -> Response: ...
269
+
209
270
  def request(
210
271
  url: str,
211
272
  params: dict | None = None,
@@ -498,7 +559,7 @@ class RequestCache(Base):
498
559
 
499
560
 
500
561
  @property
501
- def _start_params(self) -> RequestCacheParameters:
562
+ def __start_params(self) -> RequestCacheParameters:
502
563
  """
503
564
  Get cache start parameters.
504
565
 
@@ -537,7 +598,7 @@ class RequestCache(Base):
537
598
  """
538
599
 
539
600
  # Start.
540
- requests_cache_install_cache(**self._start_params)
601
+ requests_cache_install_cache(**self.__start_params)
541
602
 
542
603
 
543
604
  def stop(self) -> None:
reykit/rtable.py CHANGED
@@ -116,9 +116,9 @@ class Table(Base):
116
116
  self.data = data
117
117
 
118
118
 
119
- def to_row(self) -> dict:
119
+ def to_table(self) -> list[dict]:
120
120
  """
121
- Convert data to `dict` format.
121
+ Convert data to `list[dict]` format.
122
122
 
123
123
  Returns
124
124
  -------
@@ -133,23 +133,6 @@ class Table(Base):
133
133
  result = [dict(self.data._mapping)]
134
134
  case Series():
135
135
  result = [dict(self.data.items())]
136
-
137
- return result
138
-
139
-
140
- def to_table(self) -> list[dict]:
141
- """
142
- Convert data to `list[dict]` format.
143
-
144
- Returns
145
- -------
146
- Converted data.
147
- """
148
-
149
- # Convert.
150
- match self.data:
151
- case MutableMapping() | CursorRow() | Series():
152
- result = [self.to_row()]
153
136
  case CursorResult():
154
137
  result = [
155
138
  dict(row)
reykit/rtask.py CHANGED
@@ -684,11 +684,11 @@ class AsyncPool(Base):
684
684
  self.futures: list[AFuture] = []
685
685
 
686
686
  # Start.
687
- self._start_loop()
687
+ self.__start_loop()
688
688
 
689
689
 
690
690
  @wrap_thread
691
- def _start_loop(self) -> None:
691
+ def __start_loop(self) -> None:
692
692
  """
693
693
  Start event loop.
694
694
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reykit
3
- Version: 1.1.38
3
+ Version: 1.1.40
4
4
  Summary: Kit method set.
5
5
  Project-URL: homepage, https://github.com/reyxbo/reykit/
6
6
  Author-email: Rey <reyxbo@163.com>
@@ -1,12 +1,12 @@
1
1
  reykit/__init__.py,sha256=V86CHqPAAVkooVx3_QIOKpDIFVneQCTTSwfJ-uWgBno,788
2
2
  reykit/rall.py,sha256=7Hip02YOkIDm3_xkoSDjvvYV2LhdBV2r4UKzWWnIfIo,628
3
3
  reykit/rbase.py,sha256=UBlu1-uOl3ZOeVIK6DvFbR3lZmthmGKjpbF-9vwQCpc,22116
4
- reykit/rdata.py,sha256=cRUXIYEp-hq56ShclarXE1RoQpaPTPGiBjnabTBft50,10307
4
+ reykit/rdata.py,sha256=m30TX2O4dd6hNNdKdjdFv68s61tFu00pBoMVjqrFC5g,10309
5
5
  reykit/remail.py,sha256=s7TXbLgEWEqNoeM42c6FpPufB2LajHgQuahfZri3urQ,6706
6
6
  reykit/rimage.py,sha256=p7caatLE71yy7GUTkTKyMOaJTeBfl6pZr_7BFjcDvY8,6159
7
- reykit/rlog.py,sha256=ykZ8tmMJtwEaAgXmtgtU3SghJG8-ArCIiw0ZawXastg,25564
8
- reykit/rmonkey.py,sha256=f5vA4t9R6Nz2xfTRUSo2NJ140eg9kT12eaNkKat2AGo,8140
9
- reykit/rnet.py,sha256=uS27Ownt9ELsjVKpGMPVN1Endc9s7z7CfIBkfE8bPMs,15033
7
+ reykit/rlog.py,sha256=krjeLPptPiYgbXd9h4umx4Nf34Bt6jQBT0MEvatVKL4,25572
8
+ reykit/rmonkey.py,sha256=M-W19Q9OwuYWebLlJK4kpYhUOWufgtahDTAZVPbn83s,8143
9
+ reykit/rnet.py,sha256=zvEWAM42jAdQT868FFDrm-OPn5f3SNfMZP-bU8Sbx0A,16934
10
10
  reykit/rnum.py,sha256=PhG4V_BkVfCJUsbpMDN1umGZly1Hsus80TW8bpyBtyY,3653
11
11
  reykit/ros.py,sha256=xR79PnSlpHvHsoVKHWvEagreQB24N41XHq-psHQhlMI,40818
12
12
  reykit/rrand.py,sha256=9QPXCsREIu45g6WP-XN67X05kmW3cTmctn3InvqYxuY,8947
@@ -14,15 +14,15 @@ reykit/rre.py,sha256=4DVxy28dl5zn6_II8-cgr7E2nVPH5QJIJVB4o7Vsf1A,6078
14
14
  reykit/rschedule.py,sha256=_nrfrXYxlFAKCDbM8ibTTb60zNDlHxyE310cv-A19Kw,5799
15
15
  reykit/rstdout.py,sha256=Vgqm66rtjIaYWO-EFEm9PGzgXDzZXZGq-BS1Lg6zD40,8197
16
16
  reykit/rsys.py,sha256=8Q9ZdggxRHXHMOwjMQa_kBN3gTkmpduHoXrKfa5UXqs,24933
17
- reykit/rtable.py,sha256=32Dcs2OYI88GGiF6QMGMyPeeL5mhoa-QlygVXkRklkE,12536
18
- reykit/rtask.py,sha256=Jl2s3cc5i_oKsGu0XJwhzwVwL6LNCULPthlS9N17aeg,22846
17
+ reykit/rtable.py,sha256=Ua6R1eHMtq4jAaWvfFTsgk-KQmtz5KwuYq4kguzRKaY,12198
18
+ reykit/rtask.py,sha256=98iCzNdJ_fFRDyOLjXEFNW3tzdAwXcCF7JkZ7Gf0fEE,22848
19
19
  reykit/rtext.py,sha256=sFp5n5ykD6B812Bywhe6gqzscNmx-U6w80Zf8p1y-Ow,12859
20
20
  reykit/rtime.py,sha256=PfhsXZLmSsKY2W1A0VrjhaVbMKVBHBD86AZ8nowNGig,17008
21
21
  reykit/rwrap.py,sha256=RK3wlc2cd-lnAvzqzvKsS21EtCmBNTA3i8HRbaolWE4,15275
22
22
  reykit/rzip.py,sha256=ABUDLwEHQIpcvZbJE_oV78H7dik6nC7kaRz660Ro9Os,3481
23
23
  reykit/rdll/__init__.py,sha256=1VRawI2vCsLH7KK0PcBRWNc-bwseM-M05wkc_eamwJM,696
24
24
  reykit/rdll/rdll_core.py,sha256=o6-rKcTQgxZQe0kD3GnwyNb3KL9IogzgCQNOmYLMm7A,5086
25
- reykit-1.1.38.dist-info/METADATA,sha256=YkpxF426vwAROyAR4KRlDdatFamEbd_FSifn6PXySIA,1872
26
- reykit-1.1.38.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
- reykit-1.1.38.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
28
- reykit-1.1.38.dist-info/RECORD,,
25
+ reykit-1.1.40.dist-info/METADATA,sha256=ygc-fWoLcUcugTfzuqCic7IFgOikwQocMEl3yJAqCUE,1872
26
+ reykit-1.1.40.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
+ reykit-1.1.40.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
28
+ reykit-1.1.40.dist-info/RECORD,,