reykit 1.1.83__py3-none-any.whl → 1.1.85__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/rbase.py +4 -8
- reykit/rdata.py +62 -9
- reykit/rlog.py +4 -4
- reykit/rmonkey.py +0 -4
- reykit/rnet.py +3 -32
- reykit/ros.py +5 -6
- reykit/rrand.py +1 -2
- reykit/rschedule.py +1 -1
- reykit/rtask.py +142 -10
- {reykit-1.1.83.dist-info → reykit-1.1.85.dist-info}/METADATA +1 -1
- {reykit-1.1.83.dist-info → reykit-1.1.85.dist-info}/RECORD +13 -13
- {reykit-1.1.83.dist-info → reykit-1.1.85.dist-info}/WHEEL +0 -0
- {reykit-1.1.83.dist-info → reykit-1.1.85.dist-info}/licenses/LICENSE +0 -0
reykit/rbase.py
CHANGED
@@ -35,7 +35,6 @@ __all__ = (
|
|
35
35
|
'ConfigMeta',
|
36
36
|
'Singleton',
|
37
37
|
'Null',
|
38
|
-
'null',
|
39
38
|
'ErrorBase',
|
40
39
|
'Exit',
|
41
40
|
'Error',
|
@@ -205,15 +204,12 @@ class Singleton(Base):
|
|
205
204
|
return self._instance
|
206
205
|
|
207
206
|
|
208
|
-
class Null(
|
207
|
+
class Null(Base, metaclass=StaticMeta):
|
209
208
|
"""
|
210
209
|
Null type.
|
211
210
|
"""
|
212
211
|
|
213
212
|
|
214
|
-
null = Null()
|
215
|
-
|
216
|
-
|
217
213
|
class ErrorBase(Base, BaseException):
|
218
214
|
"""
|
219
215
|
Base error type.
|
@@ -591,7 +587,7 @@ def get_first_notnone(*values: None) -> NoReturn: ...
|
|
591
587
|
@overload
|
592
588
|
def get_first_notnone(*values: T) -> T: ...
|
593
589
|
|
594
|
-
def get_first_notnone(*values: T, default: U =
|
590
|
+
def get_first_notnone(*values: T, default: U | Null = Null) -> T | U:
|
595
591
|
"""
|
596
592
|
Get the first value that is not `None`.
|
597
593
|
|
@@ -600,7 +596,7 @@ def get_first_notnone(*values: T, default: U = null) -> T | U:
|
|
600
596
|
values : Check values.
|
601
597
|
default : When all are `None`, then return this is value, or throw exception.
|
602
598
|
- `Any`: Return this is value.
|
603
|
-
- `
|
599
|
+
- `Null`: Throw exception.
|
604
600
|
|
605
601
|
Returns
|
606
602
|
-------
|
@@ -613,7 +609,7 @@ def get_first_notnone(*values: T, default: U = null) -> T | U:
|
|
613
609
|
return value
|
614
610
|
|
615
611
|
# Throw exception.
|
616
|
-
if default ==
|
612
|
+
if default == Null:
|
617
613
|
vars_name: list[str] = get_varname('values')
|
618
614
|
if vars_name is not None:
|
619
615
|
vars_name_de_dup = list(set(vars_name))
|
reykit/rdata.py
CHANGED
@@ -11,12 +11,12 @@
|
|
11
11
|
|
12
12
|
from typing import Any, TypedDict, Literal, overload
|
13
13
|
from collections import Counter, defaultdict as Defaultdict, ChainMap
|
14
|
-
from collections.abc import Callable, Iterable, Generator
|
14
|
+
from collections.abc import Callable, Iterable, Generator, AsyncGenerator
|
15
15
|
from itertools import chain as IChain
|
16
16
|
from decimal import Decimal
|
17
17
|
from json import dumps as json_dumps
|
18
18
|
|
19
|
-
from .rbase import T, KT, VT, Base,
|
19
|
+
from .rbase import T, KT, VT, Base, Null, check_least_one, check_most_one, is_iterable
|
20
20
|
|
21
21
|
|
22
22
|
__all__ = (
|
@@ -337,14 +337,14 @@ def chain(*iterables: dict[KT, VT] | Iterable[T]) -> ChainMap[KT, VT] | IChain[T
|
|
337
337
|
return data
|
338
338
|
|
339
339
|
|
340
|
-
def default_dict(default: T =
|
340
|
+
def default_dict(default: T | Null = Null, data: dict[KT, VT] | None = None) -> Defaultdict[KT, VT | T]:
|
341
341
|
"""
|
342
342
|
Set `dict` instance, default value when key does not exist.
|
343
343
|
|
344
344
|
Parameters
|
345
345
|
----------
|
346
346
|
default : Default value.
|
347
|
-
- `
|
347
|
+
- `Null`: Nest function self.
|
348
348
|
- `Callable`: Use call return value.
|
349
349
|
data : `dict` instance.
|
350
350
|
- `None`: Empty `dict`.
|
@@ -353,7 +353,7 @@ def default_dict(default: T = null, data: dict[KT, VT] | None = None) -> Default
|
|
353
353
|
# Handle parameter.
|
354
354
|
|
355
355
|
## Null.
|
356
|
-
if default ==
|
356
|
+
if default == Null:
|
357
357
|
default_factory = default_dict
|
358
358
|
|
359
359
|
## Callable.
|
@@ -408,10 +408,9 @@ class FunctionGenerator(Base):
|
|
408
408
|
self.args = args
|
409
409
|
self.kwargs = kwargs
|
410
410
|
self.params: list[tuple[tuple, dict]] = []
|
411
|
-
self.generator = self.__generator()
|
412
411
|
|
413
412
|
|
414
|
-
def
|
413
|
+
def generator(self) -> Generator[Any, Any, None]:
|
415
414
|
"""
|
416
415
|
Create generator.
|
417
416
|
|
@@ -435,6 +434,30 @@ class FunctionGenerator(Base):
|
|
435
434
|
yield result
|
436
435
|
|
437
436
|
|
437
|
+
async def agenerator(self) -> AsyncGenerator[Any, Any]:
|
438
|
+
"""
|
439
|
+
Asynchronous create generator.
|
440
|
+
|
441
|
+
Parameters
|
442
|
+
----------
|
443
|
+
Generator.
|
444
|
+
"""
|
445
|
+
|
446
|
+
# Loop.
|
447
|
+
while True:
|
448
|
+
|
449
|
+
# Break.
|
450
|
+
if self.params == []:
|
451
|
+
break
|
452
|
+
|
453
|
+
# Generate.
|
454
|
+
args, kwargs = self.params.pop(0)
|
455
|
+
result = self.func(*args, **kwargs)
|
456
|
+
|
457
|
+
# Return.
|
458
|
+
yield result
|
459
|
+
|
460
|
+
|
438
461
|
def add(
|
439
462
|
self,
|
440
463
|
*args: Any,
|
@@ -480,7 +503,8 @@ class FunctionGenerator(Base):
|
|
480
503
|
"""
|
481
504
|
|
482
505
|
# Generate.
|
483
|
-
|
506
|
+
generator = self.generator()
|
507
|
+
result = next(generator)
|
484
508
|
|
485
509
|
return result
|
486
510
|
|
@@ -491,4 +515,33 @@ class FunctionGenerator(Base):
|
|
491
515
|
"""
|
492
516
|
|
493
517
|
# Iterating.
|
494
|
-
|
518
|
+
generator = self.generator()
|
519
|
+
|
520
|
+
return generator
|
521
|
+
|
522
|
+
|
523
|
+
async def __anext__(self) -> Any:
|
524
|
+
"""
|
525
|
+
Asynchronous generate once from generator.
|
526
|
+
|
527
|
+
Returns
|
528
|
+
-------
|
529
|
+
Generate value.
|
530
|
+
"""
|
531
|
+
|
532
|
+
# Generate.
|
533
|
+
agenerator = await self.agenerator()
|
534
|
+
result = anext(agenerator)
|
535
|
+
|
536
|
+
return result
|
537
|
+
|
538
|
+
|
539
|
+
async def __aiter__(self) -> AsyncGenerator[Any, Any]:
|
540
|
+
"""
|
541
|
+
Asynchronous iterating generator.
|
542
|
+
"""
|
543
|
+
|
544
|
+
# Iterating.
|
545
|
+
agenerator = await self.agenerator()
|
546
|
+
|
547
|
+
return agenerator
|
reykit/rlog.py
CHANGED
@@ -29,7 +29,7 @@ from logging import (
|
|
29
29
|
from logging.handlers import QueueHandler
|
30
30
|
from concurrent_log_handler import ConcurrentRotatingFileHandler, ConcurrentTimedRotatingFileHandler
|
31
31
|
|
32
|
-
from .rbase import Base, ConfigMeta,
|
32
|
+
from .rbase import Base, ConfigMeta, Null, throw, catch_exc, get_first_notnone, get_stack_param
|
33
33
|
from .rre import search, sub
|
34
34
|
from .rstdout import ConfigStdout, modify_print, reset_print
|
35
35
|
from .rtext import to_text
|
@@ -954,7 +954,7 @@ class Mark(Base):
|
|
954
954
|
self.data: dict[Hashable, set[int]] = {}
|
955
955
|
|
956
956
|
|
957
|
-
def mark(self, obj: Any, group: Hashable =
|
957
|
+
def mark(self, obj: Any, group: Hashable | Null = Null) -> int:
|
958
958
|
"""
|
959
959
|
Mark object.
|
960
960
|
|
@@ -978,7 +978,7 @@ class Mark(Base):
|
|
978
978
|
return obj_id
|
979
979
|
|
980
980
|
|
981
|
-
def remove(self, obj: Any, group: Hashable =
|
981
|
+
def remove(self, obj: Any, group: Hashable | Null = Null) -> None:
|
982
982
|
"""
|
983
983
|
Whether marked.
|
984
984
|
|
@@ -1017,7 +1017,7 @@ class Mark(Base):
|
|
1017
1017
|
del self.data[group]
|
1018
1018
|
|
1019
1019
|
|
1020
|
-
def is_marked(self, obj: Any, group: Hashable =
|
1020
|
+
def is_marked(self, obj: Any, group: Hashable | Null = Null) -> bool:
|
1021
1021
|
"""
|
1022
1022
|
Whether marked.
|
1023
1023
|
|
reykit/rmonkey.py
CHANGED
@@ -9,9 +9,6 @@
|
|
9
9
|
"""
|
10
10
|
|
11
11
|
|
12
|
-
from __future__ import annotations
|
13
|
-
|
14
|
-
|
15
12
|
__all__ = (
|
16
13
|
'monkey_sqlalchemy_result_more_fetch',
|
17
14
|
'monkey_sqlalchemy_row_index_field',
|
@@ -47,7 +44,6 @@ def monkey_sqlalchemy_result_more_fetch():
|
|
47
44
|
|
48
45
|
# Import.
|
49
46
|
from typing import Self
|
50
|
-
from types import MethodType
|
51
47
|
from sqlalchemy.engine.cursor import CursorResult
|
52
48
|
from pandas import DataFrame, NA, concat
|
53
49
|
from .rbase import Base
|
reykit/rnet.py
CHANGED
@@ -211,22 +211,8 @@ def get_content_type(file: str | bytes) -> str | None:
|
|
211
211
|
def request(
|
212
212
|
url: str,
|
213
213
|
params: dict | None = None,
|
214
|
+
data: dict | str | bytes | None = None,
|
214
215
|
*,
|
215
|
-
headers: dict[str, str] = {},
|
216
|
-
timeout: float | None = None,
|
217
|
-
proxies: dict[str, str] = {},
|
218
|
-
stream: bool = False,
|
219
|
-
verify: bool = False,
|
220
|
-
method: Literal['get', 'post', 'put', 'patch', 'delete', 'options', 'head'] = Literal['get'],
|
221
|
-
check: bool | int | Iterable[int] = False
|
222
|
-
) -> Response: ...
|
223
|
-
|
224
|
-
@overload
|
225
|
-
def request(
|
226
|
-
url: str,
|
227
|
-
params: dict | None = None,
|
228
|
-
*,
|
229
|
-
data: dict | str | bytes,
|
230
216
|
files: dict[str, str | bytes | tuple[str | bytes, dict]] | None = None,
|
231
217
|
headers: dict[str, str] = {},
|
232
218
|
timeout: float | None = None,
|
@@ -237,28 +223,13 @@ def request(
|
|
237
223
|
check: bool | int | Iterable[int] = False
|
238
224
|
) -> Response: ...
|
239
225
|
|
240
|
-
@overload
|
241
|
-
def request(
|
242
|
-
url: str,
|
243
|
-
params: dict | None = None,
|
244
|
-
*,
|
245
|
-
data: dict | str | bytes | None = None,
|
246
|
-
files: dict[str, str | bytes | tuple[str | bytes, dict]],
|
247
|
-
headers: dict[str, str] = {},
|
248
|
-
timeout: float | None = None,
|
249
|
-
proxies: dict[str, str] = {},
|
250
|
-
stream: bool = False,
|
251
|
-
verify: bool = False,
|
252
|
-
method: Literal['get', 'post', 'put', 'patch', 'delete', 'options', 'head'] | None = Literal['post'],
|
253
|
-
check: bool | int | Iterable[int] = False
|
254
|
-
) -> Response: ...
|
255
226
|
|
256
227
|
@overload
|
257
228
|
def request(
|
258
229
|
url: str,
|
259
230
|
params: dict | None = None,
|
260
231
|
*,
|
261
|
-
json: dict,
|
232
|
+
json: dict | None = None,
|
262
233
|
headers: dict[str, str] = {},
|
263
234
|
timeout: float | None = None,
|
264
235
|
proxies: dict[str, str] = {},
|
@@ -312,7 +283,7 @@ def request(
|
|
312
283
|
- `None`: No setup.
|
313
284
|
- `dict[str, str]`: Name and use IP of each protocol.
|
314
285
|
stream : Whether use stream request.
|
315
|
-
verify : Whether verify certificate.
|
286
|
+
verify : Whether verify SSL certificate.
|
316
287
|
method : Request method.
|
317
288
|
- `None`: Automatic judge.
|
318
289
|
When parameter `data` or `json` or `files` not has value, then request method is `get`.
|
reykit/ros.py
CHANGED
@@ -9,7 +9,6 @@
|
|
9
9
|
"""
|
10
10
|
|
11
11
|
|
12
|
-
from __future__ import annotations
|
13
12
|
from typing import Any, Literal, TextIO, BinaryIO, overload, TYPE_CHECKING
|
14
13
|
if TYPE_CHECKING:
|
15
14
|
from _typeshed import OpenTextMode, OpenBinaryMode
|
@@ -297,7 +296,7 @@ def read_file_bytes(source: FileSourceBytes) -> bytes:
|
|
297
296
|
return file_bytes
|
298
297
|
|
299
298
|
|
300
|
-
def read_toml(path: str | File) -> dict[str, Any]:
|
299
|
+
def read_toml(path: 'str | File') -> dict[str, Any]:
|
301
300
|
"""
|
302
301
|
Read and parse TOML file.
|
303
302
|
Treat nan as a None or null value.
|
@@ -353,12 +352,12 @@ class File(Base):
|
|
353
352
|
|
354
353
|
|
355
354
|
@overload
|
356
|
-
def open(self, mode: OpenBinaryMode = 'wb+') -> BinaryIO: ...
|
355
|
+
def open(self, mode: 'OpenBinaryMode' = 'wb+') -> BinaryIO: ...
|
357
356
|
|
358
357
|
@overload
|
359
|
-
def open(self, mode: OpenTextMode, encode: str = 'utf-8') -> TextIO: ...
|
358
|
+
def open(self, mode: 'OpenTextMode', encode: str = 'utf-8') -> TextIO: ...
|
360
359
|
|
361
|
-
def open(self, mode: OpenTextMode | OpenBinaryMode = 'wb+', encode: str = 'utf-8') -> TextIO | BinaryIO:
|
360
|
+
def open(self, mode: 'OpenTextMode | OpenBinaryMode' = 'wb+', encode: str = 'utf-8') -> TextIO | BinaryIO:
|
362
361
|
"""
|
363
362
|
Open file.
|
364
363
|
|
@@ -824,7 +823,7 @@ class File(Base):
|
|
824
823
|
return file_bytes
|
825
824
|
|
826
825
|
|
827
|
-
def __contains__(self, value: str | bytes) -> bool:
|
826
|
+
def __contains__(self, value: 'str | bytes') -> bool:
|
828
827
|
"""
|
829
828
|
Judge if file text contain value.
|
830
829
|
|
reykit/rrand.py
CHANGED
@@ -9,7 +9,6 @@
|
|
9
9
|
"""
|
10
10
|
|
11
11
|
|
12
|
-
from __future__ import annotations
|
13
12
|
from typing import Literal, Self, overload
|
14
13
|
from collections.abc import Sequence
|
15
14
|
from string import digits as string_digits, ascii_letters as string_ascii_letters, punctuation as string_punctuation
|
@@ -39,7 +38,7 @@ class ConfigRandom(Base, metaclass=ConfigMeta):
|
|
39
38
|
"""
|
40
39
|
|
41
40
|
# RRandom.
|
42
|
-
_rrandom_dict: dict[int, RandomSeed] = {}
|
41
|
+
_rrandom_dict: dict[int, 'RandomSeed'] = {}
|
43
42
|
|
44
43
|
|
45
44
|
class RandomSeed(Base):
|
reykit/rschedule.py
CHANGED
reykit/rtask.py
CHANGED
@@ -45,6 +45,9 @@ __all__ = (
|
|
45
45
|
)
|
46
46
|
|
47
47
|
|
48
|
+
type CallableCoroutine = Coroutine | ATask | Callable[[], Coroutine]
|
49
|
+
|
50
|
+
|
48
51
|
class ThreadPool(Base):
|
49
52
|
"""
|
50
53
|
Thread pool type.
|
@@ -307,26 +310,51 @@ class ThreadPool(Base):
|
|
307
310
|
def async_run(
|
308
311
|
coroutine: Coroutine[Any, Any, T] | ATask[Any, Any, T] | Callable[[], Coroutine[Any, Any, T]],
|
309
312
|
*,
|
310
|
-
|
313
|
+
before: CallableCoroutine | None = None,
|
314
|
+
after: CallableCoroutine | None = None,
|
315
|
+
return_exc: bool = False
|
311
316
|
) -> T: ...
|
312
317
|
|
313
318
|
@overload
|
314
319
|
def async_run(
|
315
|
-
*coroutines: Coroutine[Any, Any, T] | ATask[Any, Any, T] |
|
316
|
-
|
320
|
+
*coroutines: Coroutine[Any, Any, T] | ATask[Any, Any, T] | Callable[[], Coroutine[Any, Any, T]],
|
321
|
+
before: CallableCoroutine | None = None,
|
322
|
+
after: CallableCoroutine | None = None,
|
323
|
+
return_exc: bool = False
|
317
324
|
) -> list[T]: ...
|
318
325
|
|
326
|
+
@overload
|
319
327
|
def async_run(
|
320
|
-
|
321
|
-
|
328
|
+
coroutine: Coroutine[Any, Any, T] | ATask[Any, Any, T] | Callable[[], Coroutine[Any, Any, T]],
|
329
|
+
*,
|
330
|
+
before: CallableCoroutine | None = None,
|
331
|
+
after: CallableCoroutine | None = None,
|
332
|
+
return_exc: Literal[True]
|
333
|
+
) -> T | BaseException: ...
|
334
|
+
|
335
|
+
@overload
|
336
|
+
def async_run(
|
337
|
+
*coroutines: Coroutine[Any, Any, T] | ATask[Any, Any, T] | Callable[[], Coroutine[Any, Any, T]],
|
338
|
+
before: CallableCoroutine | None = None,
|
339
|
+
after: CallableCoroutine | None = None,
|
340
|
+
return_exc: Literal[True]
|
341
|
+
) -> list[T] | BaseException: ...
|
342
|
+
|
343
|
+
def async_run(
|
344
|
+
*coroutines: Coroutine[Any, Any, T] | ATask[Any, Any, T] | Callable[[], Coroutine[Any, Any, T]],
|
345
|
+
before: CallableCoroutine | None = None,
|
346
|
+
after: CallableCoroutine | None = None,
|
347
|
+
return_exc: bool = False
|
322
348
|
) -> T | list[T]:
|
323
349
|
"""
|
324
350
|
Asynchronous run coroutines.
|
325
351
|
|
326
352
|
Parameters
|
327
353
|
----------
|
328
|
-
coroutines : `Coroutine` instances or `ATask` instances or `Coroutine`
|
329
|
-
|
354
|
+
coroutines : `Coroutine` instances or `ATask` instances or `Coroutine` functions.
|
355
|
+
before : `Coroutine` instance or `ATask` instance or `Coroutine` function of execute before execute.
|
356
|
+
after : `Coroutine` instance or `ATask` instance or `Coroutine` function of execute after execute.
|
357
|
+
return_exc : Whether return exception instances, otherwise throw first exception.
|
330
358
|
|
331
359
|
Returns
|
332
360
|
-------
|
@@ -340,9 +368,14 @@ def async_run(
|
|
340
368
|
else coroutine
|
341
369
|
for coroutine in coroutines
|
342
370
|
]
|
371
|
+
if asyncio_iscoroutinefunction(before):
|
372
|
+
before = before()
|
373
|
+
if asyncio_iscoroutinefunction(after):
|
374
|
+
after = after()
|
375
|
+
|
343
376
|
|
344
377
|
# Define.
|
345
|
-
async def async_run_coroutine() -> list:
|
378
|
+
async def async_run_coroutine() -> list[T]:
|
346
379
|
"""
|
347
380
|
Asynchronous run coroutines.
|
348
381
|
|
@@ -351,8 +384,16 @@ def async_run(
|
|
351
384
|
Run result list.
|
352
385
|
"""
|
353
386
|
|
387
|
+
# Before.
|
388
|
+
if before is not None:
|
389
|
+
await before
|
390
|
+
|
354
391
|
# Gather.
|
355
|
-
results = await asyncio_gather(*coroutines, return_exceptions=
|
392
|
+
results: list[T] = await asyncio_gather(*coroutines, return_exceptions=return_exc)
|
393
|
+
|
394
|
+
# After.
|
395
|
+
if after is not None:
|
396
|
+
await after
|
356
397
|
|
357
398
|
return results
|
358
399
|
|
@@ -488,6 +529,94 @@ async def async_wait(
|
|
488
529
|
return tm.total_spend
|
489
530
|
|
490
531
|
|
532
|
+
@overload
|
533
|
+
async def async_request(
|
534
|
+
url: str,
|
535
|
+
params: dict | None = None,
|
536
|
+
data: dict | str | bytes | None = None,
|
537
|
+
*,
|
538
|
+
headers: dict[str, str] = {},
|
539
|
+
timeout: float | None = None,
|
540
|
+
proxy: str | None = None,
|
541
|
+
ssl: bool = False,
|
542
|
+
method: Literal['get', 'post', 'put', 'patch', 'delete', 'options', 'head'] | None = None,
|
543
|
+
check: bool | int | Iterable[int] = False
|
544
|
+
) -> bytes: ...
|
545
|
+
|
546
|
+
@overload
|
547
|
+
async def async_request(
|
548
|
+
url: str,
|
549
|
+
params: dict | None = None,
|
550
|
+
*,
|
551
|
+
json: dict | None = None,
|
552
|
+
headers: dict[str, str] = {},
|
553
|
+
timeout: float | None = None,
|
554
|
+
proxy: str | None = None,
|
555
|
+
ssl: bool = False,
|
556
|
+
method: Literal['get', 'post', 'put', 'patch', 'delete', 'options', 'head'] | None = None,
|
557
|
+
check: bool | int | Iterable[int] = False
|
558
|
+
) -> bytes: ...
|
559
|
+
|
560
|
+
@overload
|
561
|
+
async def async_request(
|
562
|
+
url: str,
|
563
|
+
params: dict | None = None,
|
564
|
+
data: dict | str | bytes | None = None,
|
565
|
+
*,
|
566
|
+
headers: dict[str, str] = {},
|
567
|
+
timeout: float | None = None,
|
568
|
+
proxy: str | None = None,
|
569
|
+
ssl: bool = False,
|
570
|
+
method: Literal['get', 'post', 'put', 'patch', 'delete', 'options', 'head'] | None = None,
|
571
|
+
check: bool | int | Iterable[int] = False,
|
572
|
+
handler: tuple[str]
|
573
|
+
) -> list: ...
|
574
|
+
|
575
|
+
@overload
|
576
|
+
async def async_request(
|
577
|
+
url: str,
|
578
|
+
params: dict | None = None,
|
579
|
+
*,
|
580
|
+
json: dict | None = None,
|
581
|
+
headers: dict[str, str] = {},
|
582
|
+
timeout: float | None = None,
|
583
|
+
proxy: str | None = None,
|
584
|
+
ssl: bool = False,
|
585
|
+
method: Literal['get', 'post', 'put', 'patch', 'delete', 'options', 'head'] | None = None,
|
586
|
+
check: bool | int | Iterable[int] = False,
|
587
|
+
handler: tuple[str]
|
588
|
+
) -> list: ...
|
589
|
+
|
590
|
+
@overload
|
591
|
+
async def async_request(
|
592
|
+
url: str,
|
593
|
+
params: dict | None = None,
|
594
|
+
data: dict | str | bytes | None = None,
|
595
|
+
*,
|
596
|
+
headers: dict[str, str] = {},
|
597
|
+
timeout: float | None = None,
|
598
|
+
proxy: str | None = None,
|
599
|
+
ssl: bool = False,
|
600
|
+
method: Literal['get', 'post', 'put', 'patch', 'delete', 'options', 'head'] | None = None,
|
601
|
+
check: bool | int | Iterable[int] = False,
|
602
|
+
handler: Callable[[ClientResponse], Coroutine[Any, Any, T] | T]
|
603
|
+
) -> T: ...
|
604
|
+
|
605
|
+
@overload
|
606
|
+
async def async_request(
|
607
|
+
url: str,
|
608
|
+
params: dict | None = None,
|
609
|
+
*,
|
610
|
+
json: dict | None = None,
|
611
|
+
headers: dict[str, str] = {},
|
612
|
+
timeout: float | None = None,
|
613
|
+
proxy: str | None = None,
|
614
|
+
ssl: bool = False,
|
615
|
+
method: Literal['get', 'post', 'put', 'patch', 'delete', 'options', 'head'] | None = None,
|
616
|
+
check: bool | int | Iterable[int] = False,
|
617
|
+
handler: Callable[[ClientResponse], Coroutine[Any, Any, T] | T]
|
618
|
+
) -> T: ...
|
619
|
+
|
491
620
|
async def async_request(
|
492
621
|
url: str,
|
493
622
|
params: dict | None = None,
|
@@ -496,6 +625,7 @@ async def async_request(
|
|
496
625
|
headers: dict[str, str] = {},
|
497
626
|
timeout: float | None = None,
|
498
627
|
proxy: str | None = None,
|
628
|
+
ssl: bool = False,
|
499
629
|
method: Literal['get', 'post', 'put', 'patch', 'delete', 'options', 'head'] | None = None,
|
500
630
|
check: bool | int | Iterable[int] = False,
|
501
631
|
handler: str | tuple[str] | Callable[[ClientResponse], Coroutine | Any] | None = None
|
@@ -521,6 +651,7 @@ async def async_request(
|
|
521
651
|
headers : Request header data.
|
522
652
|
timeout : Request maximun waiting time.
|
523
653
|
proxy : Proxy URL.
|
654
|
+
ssl : Whether verify SSL certificate.
|
524
655
|
method : Request method.
|
525
656
|
- `None`: Automatic judge.
|
526
657
|
When parameter `data` or `json` not has value, then request method is `get`.
|
@@ -571,7 +702,8 @@ async def async_request(
|
|
571
702
|
json=json,
|
572
703
|
headers=headers,
|
573
704
|
timeout=timeout,
|
574
|
-
proxy=proxy
|
705
|
+
proxy=proxy,
|
706
|
+
ssl=ssl
|
575
707
|
) as response:
|
576
708
|
|
577
709
|
# Check code.
|
@@ -1,28 +1,28 @@
|
|
1
1
|
reykit/__init__.py,sha256=V86CHqPAAVkooVx3_QIOKpDIFVneQCTTSwfJ-uWgBno,788
|
2
2
|
reykit/rall.py,sha256=7Hip02YOkIDm3_xkoSDjvvYV2LhdBV2r4UKzWWnIfIo,628
|
3
|
-
reykit/rbase.py,sha256=
|
4
|
-
reykit/rdata.py,sha256=
|
3
|
+
reykit/rbase.py,sha256=PL0IngbmGm7luNTQh22hdV-TlVjH9EtXEzeRVGOYnAU,21758
|
4
|
+
reykit/rdata.py,sha256=iOU2_9RCihxrdXswZKvonVMIM-X5-L89WhawGDLHt4w,11361
|
5
5
|
reykit/remail.py,sha256=l4HGKXdfHNBxyBT3YxeZyQhfecbElqTqSAGInwWhap8,6723
|
6
6
|
reykit/rimage.py,sha256=lNN2iMpvSMqh-nPTpxrA9yHy43EA5WoYdxKYhqPwMgk,6154
|
7
|
-
reykit/rlog.py,sha256=
|
8
|
-
reykit/rmonkey.py,sha256=
|
9
|
-
reykit/rnet.py,sha256=
|
7
|
+
reykit/rlog.py,sha256=M4UgS2gxYJOWv66ItyOv7AUJHJc1CsSDVYr9J0y2MwU,25768
|
8
|
+
reykit/rmonkey.py,sha256=9AeZRVoPuagV8j6Z-f02zbQFAYUUxeoyqYl7cJZ7RAE,7855
|
9
|
+
reykit/rnet.py,sha256=McW4fX-omkD4_2BpLISHt2hpwIxK7EfDA5c6j3gn3E4,16874
|
10
10
|
reykit/rnum.py,sha256=VKICD64mEfiStAGWaxg3kzQjf7TTqiSBNe9LCpM9MLo,3623
|
11
|
-
reykit/ros.py,sha256=
|
12
|
-
reykit/rrand.py,sha256=
|
11
|
+
reykit/ros.py,sha256=J6YxNbOceMhHwVKDugx5Wd-KFliRtlhFEVVcCAaE_So,47847
|
12
|
+
reykit/rrand.py,sha256=fiwxyUMaLtFjPanVwTOiwvEEucmf0t2WiZF9ul9o6pU,8572
|
13
13
|
reykit/rre.py,sha256=1qva7xatKVE9qC2j7IujjXSM59qxHWwTYpiizFFQ8Xo,6024
|
14
|
-
reykit/rschedule.py,sha256=
|
14
|
+
reykit/rschedule.py,sha256=jy6hxaIugyjSpUdQhPgCuubAZmRzKxHu4Nz3xM8Gid8,14696
|
15
15
|
reykit/rstdout.py,sha256=yesWo7wIGablpyAu-2J2Gw11Qp3GdQjGICTyIcvLyt4,8200
|
16
16
|
reykit/rsys.py,sha256=AP62KyN40flCeQJBclfJq8shachSAFT0LkVjiKsXkrw,24946
|
17
17
|
reykit/rtable.py,sha256=UQ-JlwjssMR3gY1iY-VGQEKQ5_BZabpJy6TL7Fx19c4,12200
|
18
|
-
reykit/rtask.py,sha256=
|
18
|
+
reykit/rtask.py,sha256=TeuHE4BN978AlOu5pcOvem7KK-6L0B50ncxNuS32nBw,27024
|
19
19
|
reykit/rtext.py,sha256=cWHy19lDcJvpX7LU95kmRVsDimpAUaz5TbKC1h83gB4,13254
|
20
20
|
reykit/rtime.py,sha256=lsSKaYFmYXlDN18yj2fLVTKSruzgygl8icW6_Fl42Xk,17807
|
21
21
|
reykit/rwrap.py,sha256=G4TL2GWUaW9DrCFRcsnDE1CwgdWeP2PnjQckheRx4p0,15095
|
22
22
|
reykit/rzip.py,sha256=BGEONswuBZxQ-zcgd_xp2fcvYesC9AmKaaXWvnT3bTI,3456
|
23
23
|
reykit/rdll/__init__.py,sha256=nLSb8onBm2ilyoxzpDzUeGfSCKwkLEesIhzK3LiJ8mk,701
|
24
24
|
reykit/rdll/rdll_core.py,sha256=o6-rKcTQgxZQe0kD3GnwyNb3KL9IogzgCQNOmYLMm7A,5086
|
25
|
-
reykit-1.1.
|
26
|
-
reykit-1.1.
|
27
|
-
reykit-1.1.
|
28
|
-
reykit-1.1.
|
25
|
+
reykit-1.1.85.dist-info/METADATA,sha256=qcvtYF2xh8J2w_h866sFgaeMbBSa5fLcAVfP6jutfOs,1872
|
26
|
+
reykit-1.1.85.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
27
|
+
reykit-1.1.85.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
|
28
|
+
reykit-1.1.85.dist-info/RECORD,,
|
File without changes
|
File without changes
|