dycw-utilities 0.168.9__py3-none-any.whl → 0.169.4__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.
Potentially problematic release.
This version of dycw-utilities might be problematic. Click here for more details.
- dycw_utilities-0.169.4.dist-info/METADATA +41 -0
- {dycw_utilities-0.168.9.dist-info → dycw_utilities-0.169.4.dist-info}/RECORD +10 -11
- dycw_utilities-0.169.4.dist-info/WHEEL +4 -0
- {dycw_utilities-0.168.9.dist-info → dycw_utilities-0.169.4.dist-info}/entry_points.txt +3 -0
- utilities/__init__.py +1 -1
- utilities/cachetools.py +9 -6
- utilities/sentinel.py +1 -3
- dycw_utilities-0.168.9.dist-info/METADATA +0 -41
- dycw_utilities-0.168.9.dist-info/WHEEL +0 -4
- dycw_utilities-0.168.9.dist-info/licenses/LICENSE +0 -21
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: dycw-utilities
|
|
3
|
+
Version: 0.169.4
|
|
4
|
+
Author: Derek Wan
|
|
5
|
+
Author-email: Derek Wan <d.wan@icloud.com>
|
|
6
|
+
Requires-Dist: atomicwrites>=1.4.1,<1.5
|
|
7
|
+
Requires-Dist: typing-extensions>=4.15.0,<4.16
|
|
8
|
+
Requires-Dist: tzlocal>=5.3.1,<5.4
|
|
9
|
+
Requires-Dist: whenever>=0.9.3,<0.10
|
|
10
|
+
Requires-Dist: coloredlogs>=15.0.1,<15.1 ; extra == 'logging'
|
|
11
|
+
Requires-Dist: dycw-pytest-only>=2.1.1,<2.2 ; extra == 'test'
|
|
12
|
+
Requires-Dist: hypothesis>=6.142.0,<6.143 ; extra == 'test'
|
|
13
|
+
Requires-Dist: pytest>=8.4.2,<8.5 ; extra == 'test'
|
|
14
|
+
Requires-Dist: pytest-asyncio>=1.2.0,<1.3 ; extra == 'test'
|
|
15
|
+
Requires-Dist: pytest-cov>=7.0.0,<7.1 ; extra == 'test'
|
|
16
|
+
Requires-Dist: pytest-instafail>=0.5.0,<0.6 ; extra == 'test'
|
|
17
|
+
Requires-Dist: pytest-lazy-fixtures>=1.4.0,<1.5 ; extra == 'test'
|
|
18
|
+
Requires-Dist: pytest-randomly>=4.0.1,<4.1 ; extra == 'test'
|
|
19
|
+
Requires-Dist: pytest-regressions>=2.8.3,<2.9 ; extra == 'test'
|
|
20
|
+
Requires-Dist: pytest-repeat>=0.9.4,<0.10 ; extra == 'test'
|
|
21
|
+
Requires-Dist: pytest-rerunfailures>=16.0.1,<16.1 ; extra == 'test'
|
|
22
|
+
Requires-Dist: pytest-rng>=1.0.0,<1.1 ; extra == 'test'
|
|
23
|
+
Requires-Dist: pytest-timeout>=2.4.0,<2.5 ; extra == 'test'
|
|
24
|
+
Requires-Dist: pytest-xdist>=3.8.0,<3.9 ; extra == 'test'
|
|
25
|
+
Requires-Dist: testbook>=0.4.2,<0.5 ; extra == 'test'
|
|
26
|
+
Requires-Python: >=3.13
|
|
27
|
+
Provides-Extra: logging
|
|
28
|
+
Provides-Extra: test
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
|
|
31
|
+
[](https://badge.fury.io/py/dycw-utilities)
|
|
32
|
+
|
|
33
|
+
# `dycw-utilities`
|
|
34
|
+
|
|
35
|
+
[All the Python functions I don't want to write twice.](https://github.com/nvim-lua/plenary.nvim)
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
- `pip install dycw-utilities`
|
|
40
|
+
|
|
41
|
+
or with [extras](https://github.com/dycw/python-utilities/blob/master/pyproject.toml).
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
utilities/__init__.py,sha256=
|
|
1
|
+
utilities/__init__.py,sha256=F3RmmXkax20YZmWL1Z066tqAaUSEDI0gu2JymqwNEyg,60
|
|
2
2
|
utilities/aeventkit.py,sha256=OmDBhYGgbsKrB7cdC5FFpJHUatX9O76eTeKVVTksp2Y,12673
|
|
3
3
|
utilities/altair.py,sha256=nHdpWt8ZwdUwRQN970MvHd5bRWokNqzHcZQEdSHKRuE,9033
|
|
4
4
|
utilities/asyncio.py,sha256=60l1IwjnRGeaVphAFiwDIHyfKoZYKY-XGpptUxGiU-M,17034
|
|
5
5
|
utilities/atomicwrites.py,sha256=tPo6r-Rypd9u99u66B9z86YBPpnLrlHtwox_8Z7T34Y,5790
|
|
6
6
|
utilities/atools.py,sha256=6neeCcgXxK2dlsc0xp15Za7nSucbCgFtAJepGI_-WXU,2549
|
|
7
|
-
utilities/cachetools.py,sha256=
|
|
7
|
+
utilities/cachetools.py,sha256=2S9LMHIunDYMIu8JGI7OLN04sQ7-xZGdEdP1Li0vksA,2775
|
|
8
8
|
utilities/click.py,sha256=pUkrC4F4HZlBNF4KmQ3sEsDe0VtyMspVepKVUvDvuhs,17386
|
|
9
9
|
utilities/concurrent.py,sha256=fHeW2SZ_TEMfFY0C8pyQI6aPlnecvx9x6SuUwBWj_JY,2853
|
|
10
10
|
utilities/contextlib.py,sha256=iP7R2tIm6ZsbfLD5ks6UKBYwj50e9gBI8AkpLN-chro,7476
|
|
@@ -62,13 +62,16 @@ utilities/pydantic_settings.py,sha256=53tQTpHFtA6UIuzHKzauZtW_bSRwL5lQnNwTWeO4Fj
|
|
|
62
62
|
utilities/pydantic_settings_sops.py,sha256=9Ou6Cx6PiYOU49vtkKqqW1Sdp_i3WlVyg8KkUUKNliM,2310
|
|
63
63
|
utilities/pyinstrument.py,sha256=hnXaL-4HE7wWBI5JKaPfYTpsrXe68YiuZKahHV0VJn8,841
|
|
64
64
|
utilities/pytest.py,sha256=6o2qoAPygQLveU8t1JOdzAGmZ96Hs5jFn9OT_mcDNCk,10062
|
|
65
|
+
utilities/pytest_plugins/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
66
|
+
utilities/pytest_plugins/pytest_randomly.py,sha256=B1qYVlExGOxTywq2r1SMi5o7btHLk2PNdY_b1p98dkE,409
|
|
67
|
+
utilities/pytest_plugins/pytest_regressions.py,sha256=mnHYBfdprz50UGVkVzV1bZERZN5CFfoF8YbokGxdFwU,1639
|
|
65
68
|
utilities/pytest_regressions.py,sha256=vkMH4swF1LVK2117k9cenm9BhVFiTTRwK3Ys_X2wyGI,4045
|
|
66
69
|
utilities/random.py,sha256=hZlH4gnAtoaofWswuJYjcygejrY8db4CzP-z_adO2Mo,4165
|
|
67
70
|
utilities/re.py,sha256=S4h-DLL6ScMPqjboZ_uQ1BVTJajrqV06r_81D--_HCE,4573
|
|
68
71
|
utilities/redis.py,sha256=gybjqKea33Jy50n4dHTS14JdquqHaJqHF2dixQljYWQ,30172
|
|
69
72
|
utilities/reprlib.py,sha256=ssYTcBW-TeRh3fhCJv57sopTZHF5FrPyyUg9yp5XBlo,3953
|
|
70
73
|
utilities/scipy.py,sha256=wZJM7fEgBAkLSYYvSmsg5ac-QuwAI0BGqHVetw1_Hb0,947
|
|
71
|
-
utilities/sentinel.py,sha256=
|
|
74
|
+
utilities/sentinel.py,sha256=lU-GYFyvSUE1YLI19Ok9z7T7EK6JrCA9jopbKbJKJnU,1404
|
|
72
75
|
utilities/shelve.py,sha256=4OzjQI6kGuUbJciqf535rwnao-_IBv66gsT6tRGiUt0,759
|
|
73
76
|
utilities/slack_sdk.py,sha256=76-DYtcGiUhEvl-voMamc5OjfF7Y7nCq54Bys1arqzw,2233
|
|
74
77
|
utilities/socket.py,sha256=K77vfREvzoVTrpYKo6MZakol0EYu2q1sWJnnZqL0So0,118
|
|
@@ -92,11 +95,7 @@ utilities/warnings.py,sha256=un1LvHv70PU-LLv8RxPVmugTzDJkkGXRMZTE2-fTQHw,1771
|
|
|
92
95
|
utilities/whenever.py,sha256=F4ek0-OBWxHYrZdmoZt76N2RnNyKY5KrEHt7rqO4AQE,60183
|
|
93
96
|
utilities/zipfile.py,sha256=24lQc9ATcJxHXBPc_tBDiJk48pWyRrlxO2fIsFxU0A8,699
|
|
94
97
|
utilities/zoneinfo.py,sha256=tdIScrTB2-B-LH0ukb1HUXKooLknOfJNwHk10MuMYvA,3619
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
dycw_utilities-0.
|
|
99
|
-
dycw_utilities-0.168.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
100
|
-
dycw_utilities-0.168.9.dist-info/entry_points.txt,sha256=BOD_SoDxwsfJYOLxhrSXhHP_T7iw-HXI9f2WVkzYxvQ,135
|
|
101
|
-
dycw_utilities-0.168.9.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
|
|
102
|
-
dycw_utilities-0.168.9.dist-info/RECORD,,
|
|
98
|
+
dycw_utilities-0.169.4.dist-info/WHEEL,sha256=M6du7VZflc4UPsGphmOXHANdgk8zessdJG0DBUuoA-U,78
|
|
99
|
+
dycw_utilities-0.169.4.dist-info/entry_points.txt,sha256=ykGI1ArwOPHqm2g5Cqh3ENdMxEej_a_FcOUov5EM5Oc,155
|
|
100
|
+
dycw_utilities-0.169.4.dist-info/METADATA,sha256=bHDJ9k4_lTWhPvTQUrsH2l1gyDTShbq5U2MZBGWnzmI,1711
|
|
101
|
+
dycw_utilities-0.169.4.dist-info/RECORD,,
|
utilities/__init__.py
CHANGED
utilities/cachetools.py
CHANGED
|
@@ -3,7 +3,7 @@ from __future__ import annotations
|
|
|
3
3
|
from collections.abc import Callable, Hashable, Iterable, Iterator, MutableSet
|
|
4
4
|
from math import inf
|
|
5
5
|
from time import monotonic
|
|
6
|
-
from typing import TYPE_CHECKING, Any, override
|
|
6
|
+
from typing import TYPE_CHECKING, Any, cast, override
|
|
7
7
|
|
|
8
8
|
import cachetools
|
|
9
9
|
from cachetools.func import ttl_cache
|
|
@@ -100,11 +100,14 @@ def cache[F: Callable](
|
|
|
100
100
|
typed_: bool = False,
|
|
101
101
|
) -> Callable[[F], F]:
|
|
102
102
|
"""Decorate a function with `max_size` and/or `ttl` settings."""
|
|
103
|
-
return
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
103
|
+
return cast(
|
|
104
|
+
"F",
|
|
105
|
+
ttl_cache(
|
|
106
|
+
maxsize=max_size,
|
|
107
|
+
ttl=inf if max_duration is None else max_duration.in_seconds(),
|
|
108
|
+
timer=timer,
|
|
109
|
+
typed=typed_,
|
|
110
|
+
),
|
|
108
111
|
)
|
|
109
112
|
|
|
110
113
|
|
utilities/sentinel.py
CHANGED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: dycw-utilities
|
|
3
|
-
Version: 0.168.9
|
|
4
|
-
Author-email: Derek Wan <d.wan@icloud.com>
|
|
5
|
-
License-File: LICENSE
|
|
6
|
-
Requires-Python: >=3.12
|
|
7
|
-
Requires-Dist: atomicwrites<1.5,>=1.4.1
|
|
8
|
-
Requires-Dist: typing-extensions<4.16,>=4.15.0
|
|
9
|
-
Requires-Dist: tzlocal<5.4,>=5.3.1
|
|
10
|
-
Requires-Dist: whenever<0.10,>=0.9.2
|
|
11
|
-
Provides-Extra: logging
|
|
12
|
-
Requires-Dist: coloredlogs<15.1,>=15.0.1; extra == 'logging'
|
|
13
|
-
Provides-Extra: test
|
|
14
|
-
Requires-Dist: dycw-pytest-only<2.2,>=2.1.1; extra == 'test'
|
|
15
|
-
Requires-Dist: hypothesis<6.141,>=6.140.3; extra == 'test'
|
|
16
|
-
Requires-Dist: pytest-asyncio<1.3,>=1.2.0; extra == 'test'
|
|
17
|
-
Requires-Dist: pytest-cov<7.1,>=7.0.0; extra == 'test'
|
|
18
|
-
Requires-Dist: pytest-instafail<0.6,>=0.5.0; extra == 'test'
|
|
19
|
-
Requires-Dist: pytest-lazy-fixtures<1.5,>=1.4.0; extra == 'test'
|
|
20
|
-
Requires-Dist: pytest-randomly<4.1,>=4.0.1; extra == 'test'
|
|
21
|
-
Requires-Dist: pytest-regressions<2.9,>=2.8.3; extra == 'test'
|
|
22
|
-
Requires-Dist: pytest-repeat<0.10,>=0.9.4; extra == 'test'
|
|
23
|
-
Requires-Dist: pytest-rerunfailures<16.1,>=16.0.1; extra == 'test'
|
|
24
|
-
Requires-Dist: pytest-rng<1.1,>=1.0.0; extra == 'test'
|
|
25
|
-
Requires-Dist: pytest-timeout<2.5,>=2.4.0; extra == 'test'
|
|
26
|
-
Requires-Dist: pytest-xdist<3.9,>=3.8.0; extra == 'test'
|
|
27
|
-
Requires-Dist: pytest<8.5,>=8.4.2; extra == 'test'
|
|
28
|
-
Requires-Dist: testbook<0.5,>=0.4.2; extra == 'test'
|
|
29
|
-
Description-Content-Type: text/markdown
|
|
30
|
-
|
|
31
|
-
[](https://badge.fury.io/py/dycw-utilities)
|
|
32
|
-
|
|
33
|
-
# `dycw-utilities`
|
|
34
|
-
|
|
35
|
-
[All the Python functions I don't want to write twice.](https://github.com/nvim-lua/plenary.nvim)
|
|
36
|
-
|
|
37
|
-
## Installation
|
|
38
|
-
|
|
39
|
-
- `pip install dycw-utilities`
|
|
40
|
-
|
|
41
|
-
or with [extras](https://github.com/dycw/python-utilities/blob/master/pyproject.toml).
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 Derek Wan
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|