omlish 0.0.0.dev237__py3-none-any.whl → 0.0.0.dev239__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- omlish/__about__.py +2 -2
- omlish/collections/__init__.py +5 -5
- omlish/collections/ranked.py +79 -0
- omlish/configs/classes.py +4 -0
- omlish/daemons/services.py +74 -0
- omlish/daemons/targets.py +10 -22
- omlish/dataclasses/__init__.py +6 -2
- omlish/dataclasses/static.py +189 -0
- omlish/dataclasses/utils.py +0 -9
- omlish/graphs/trees.py +8 -8
- omlish/lang/__init__.py +6 -3
- omlish/lang/descriptors.py +8 -7
- omlish/lang/imports.py +0 -43
- omlish/lite/dataclasses.py +18 -0
- omlish/lite/imports.py +47 -0
- omlish/manifests/__init__.py +0 -2
- omlish/manifests/base.py +1 -0
- omlish/manifests/load.py +1 -0
- omlish/manifests/static.py +20 -0
- omlish/manifests/types.py +2 -1
- omlish/metadata.py +153 -0
- omlish/sql/abc.py +7 -0
- omlish/sql/api/__init__.py +0 -0
- omlish/sql/api/base.py +89 -0
- omlish/sql/api/columns.py +90 -0
- omlish/sql/api/dbapi.py +105 -0
- omlish/sql/api/errors.py +24 -0
- omlish/sql/api/funcs.py +73 -0
- omlish/sql/api/queries.py +63 -0
- omlish/sql/api/rows.py +48 -0
- {omlish-0.0.0.dev237.dist-info → omlish-0.0.0.dev239.dist-info}/METADATA +1 -1
- {omlish-0.0.0.dev237.dist-info → omlish-0.0.0.dev239.dist-info}/RECORD +36 -24
- omlish/collections/indexed.py +0 -73
- {omlish-0.0.0.dev237.dist-info → omlish-0.0.0.dev239.dist-info}/LICENSE +0 -0
- {omlish-0.0.0.dev237.dist-info → omlish-0.0.0.dev239.dist-info}/WHEEL +0 -0
- {omlish-0.0.0.dev237.dist-info → omlish-0.0.0.dev239.dist-info}/entry_points.txt +0 -0
- {omlish-0.0.0.dev237.dist-info → omlish-0.0.0.dev239.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,63 @@
|
|
1
|
+
import dataclasses as dc
|
2
|
+
import enum
|
3
|
+
import typing as ta
|
4
|
+
|
5
|
+
from ... import check
|
6
|
+
from ... import lang
|
7
|
+
|
8
|
+
|
9
|
+
##
|
10
|
+
|
11
|
+
|
12
|
+
class QueryMode(enum.Enum):
|
13
|
+
QUERY = enum.auto()
|
14
|
+
EXEC = enum.auto()
|
15
|
+
|
16
|
+
|
17
|
+
@dc.dataclass(frozen=True)
|
18
|
+
class Query(lang.Final):
|
19
|
+
mode: QueryMode
|
20
|
+
text: str
|
21
|
+
args: ta.Sequence[ta.Any]
|
22
|
+
|
23
|
+
#
|
24
|
+
|
25
|
+
@classmethod
|
26
|
+
@ta.overload
|
27
|
+
def of(
|
28
|
+
cls,
|
29
|
+
query: 'Query',
|
30
|
+
) -> 'Query':
|
31
|
+
...
|
32
|
+
|
33
|
+
@classmethod
|
34
|
+
@ta.overload
|
35
|
+
def of(
|
36
|
+
cls,
|
37
|
+
text: str,
|
38
|
+
*args: ta.Any,
|
39
|
+
mode: str | QueryMode = QueryMode.QUERY,
|
40
|
+
) -> 'Query':
|
41
|
+
...
|
42
|
+
|
43
|
+
@classmethod # type: ignore[misc]
|
44
|
+
def of(cls, obj, *args, **kwargs):
|
45
|
+
if isinstance(obj, Query):
|
46
|
+
check.arg(not args)
|
47
|
+
check.arg(not kwargs)
|
48
|
+
return obj
|
49
|
+
|
50
|
+
elif isinstance(obj, str):
|
51
|
+
mode = kwargs.pop('mode', QueryMode.QUERY)
|
52
|
+
if isinstance(mode, str):
|
53
|
+
mode = QueryMode[mode.upper()]
|
54
|
+
check.arg(not kwargs)
|
55
|
+
|
56
|
+
return cls(
|
57
|
+
mode=mode,
|
58
|
+
text=obj,
|
59
|
+
args=args,
|
60
|
+
)
|
61
|
+
|
62
|
+
else:
|
63
|
+
raise TypeError(obj)
|
omlish/sql/api/rows.py
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
import dataclasses as dc
|
2
|
+
import typing as ta
|
3
|
+
|
4
|
+
from ... import lang
|
5
|
+
from .columns import Column
|
6
|
+
from .columns import Columns
|
7
|
+
from .errors import MismatchedColumnCountError
|
8
|
+
|
9
|
+
|
10
|
+
T = ta.TypeVar('T')
|
11
|
+
|
12
|
+
|
13
|
+
##
|
14
|
+
|
15
|
+
|
16
|
+
@dc.dataclass(frozen=True)
|
17
|
+
class Row(lang.Final, ta.Generic[T]):
|
18
|
+
columns: Columns
|
19
|
+
values: ta.Sequence[T]
|
20
|
+
|
21
|
+
def __post_init__(self) -> None:
|
22
|
+
if len(self.columns) != len(self.values):
|
23
|
+
raise MismatchedColumnCountError(self.columns, self.values)
|
24
|
+
|
25
|
+
#
|
26
|
+
|
27
|
+
def __iter__(self) -> ta.Iterator[tuple[Column, T]]:
|
28
|
+
return iter(zip(self.columns, self.values))
|
29
|
+
|
30
|
+
def __len__(self) -> int:
|
31
|
+
return len(self.values)
|
32
|
+
|
33
|
+
def __contains__(self, item: str | int) -> bool:
|
34
|
+
raise TypeError('Row.__contains__ is ambiguous - use .columns.__contains__ or .values.__contains__')
|
35
|
+
|
36
|
+
def __getitem__(self, item) -> T:
|
37
|
+
if isinstance(item, str):
|
38
|
+
return self.values[self.columns.index(item)]
|
39
|
+
elif isinstance(item, int):
|
40
|
+
return self.values[item]
|
41
|
+
else:
|
42
|
+
raise TypeError(item)
|
43
|
+
|
44
|
+
def get(self, name: str) -> T | None:
|
45
|
+
if (idx := self.columns.get_index(name)) is not None:
|
46
|
+
return self.values[idx]
|
47
|
+
else:
|
48
|
+
return None
|
@@ -1,5 +1,5 @@
|
|
1
1
|
omlish/.manifests.json,sha256=vQTAIvR8OblSq-uP2GUfnbei0RnmAnM5j0T1-OToh9E,8253
|
2
|
-
omlish/__about__.py,sha256=
|
2
|
+
omlish/__about__.py,sha256=dhV7tjR3sPPz2ozLplkOZw50zalCsL4TwcGBjPkQCMU,3380
|
3
3
|
omlish/__init__.py,sha256=SsyiITTuK0v74XpKV8dqNaCmjOlan1JZKrHQv5rWKPA,253
|
4
4
|
omlish/c3.py,sha256=ubu7lHwss5V4UznbejAI0qXhXahrU01MysuHOZI9C4U,8116
|
5
5
|
omlish/cached.py,sha256=UI-XTFBwA6YXWJJJeBn-WkwBkfzDjLBBaZf4nIJA9y0,510
|
@@ -8,6 +8,7 @@ omlish/datetimes.py,sha256=HajeM1kBvwlTa-uR1TTZHmZ3zTPnnUr1uGGQhiO1XQ0,2152
|
|
8
8
|
omlish/defs.py,sha256=9uUjJuVIbCBL3g14fyzAp-9gH935MFofvlfOGwcBIaM,4913
|
9
9
|
omlish/dynamic.py,sha256=kIZokHHid8a0pIAPXMNiXrVJvJJyBnY49WP1a2m-HUQ,6525
|
10
10
|
omlish/libc.py,sha256=8K4c66YV1ziJerl5poAAYCmsV-VSsHkT3EHhPW04ufg,15639
|
11
|
+
omlish/metadata.py,sha256=IJFczp-bkFk_lCYTUt5UmM_MvCbKICjJunEi2MqnC1w,3495
|
11
12
|
omlish/outcome.py,sha256=ABIE0zjjTyTNtn-ZqQ_9_mUzLiBQ3sDAyqc9JVD8N2k,7852
|
12
13
|
omlish/runmodule.py,sha256=PWvuAaJ9wQQn6bx9ftEL3_d04DyotNn8dR_twm2pgw0,700
|
13
14
|
omlish/shlex.py,sha256=bsW2XUD8GiMTUTDefJejZ5AyqT1pTgWMPD0BMoF02jE,248
|
@@ -134,16 +135,16 @@ omlish/codecs/funcs.py,sha256=p4imNt7TobyZVXWC-WhntHVu9KfJrO4QwdtPRh-cVOk,850
|
|
134
135
|
omlish/codecs/registry.py,sha256=2FnO5YP7ui1LzkguwESY0MP3WIdwgPTIJTM_4RyTOEg,3896
|
135
136
|
omlish/codecs/standard.py,sha256=eiZ4u9ep0XrA4Z_D1zJI0vmWyuN8HLrX4Se_r_Cq_ZM,60
|
136
137
|
omlish/codecs/text.py,sha256=JzrdwMpQPo2NBBg3K1EZszzQy5vEWmd82SIerJd4yeQ,5723
|
137
|
-
omlish/collections/__init__.py,sha256=
|
138
|
+
omlish/collections/__init__.py,sha256=umpclbTE3wsSflMrKmYEiGmWFhiukfJxvBWgtYMZ8mk,2161
|
138
139
|
omlish/collections/abc.py,sha256=sP7BpTVhx6s6C59mTFeosBi4rHOWC6tbFBYbxdZmvh0,2365
|
139
140
|
omlish/collections/coerce.py,sha256=g68ROb_-5HgH-vI8612mU2S0FZ8-wp2ZHK5_Zy_kVC0,7037
|
140
141
|
omlish/collections/exceptions.py,sha256=shcS-NCnEUudF8qC_SmO2TQyjivKlS4TDjaz_faqQ0c,44
|
141
142
|
omlish/collections/frozen.py,sha256=mxhd8pw5zIXUiRHiBVZWYCYT7wYDVG3tAY5PNU-WH-I,4150
|
142
143
|
omlish/collections/hasheq.py,sha256=XcOCE6f2lXizDCOXxSX6vJv-rLcpDo2OWCYIKGSWuic,3697
|
143
144
|
omlish/collections/identity.py,sha256=SwnUE5D3v9RBjATDE1LUr_vO3Rb2NHcmTK64GZIcsO8,2720
|
144
|
-
omlish/collections/indexed.py,sha256=tLa88qgWGzTZGssMFgvhgraIEkNEUvcIk5p4yjNEquQ,2201
|
145
145
|
omlish/collections/mappings.py,sha256=YunNPyADrpitZGTJcXV0k4bmJddj1avDvEavz0coJWU,3203
|
146
146
|
omlish/collections/ordered.py,sha256=tUAl99XHbSbzn7Hdh99jUBl27NcC2J7ZTI67slTMe5M,2333
|
147
|
+
omlish/collections/ranked.py,sha256=rg6DL36oOUiG5JQEAkGnT8b6f9mSndQlIovtt8GQj_w,2229
|
147
148
|
omlish/collections/unmodifiable.py,sha256=-zys__n6L7liWzhmHAIvfxprq7cUE5HoR3foGvXc_7I,4748
|
148
149
|
omlish/collections/utils.py,sha256=Q0lHhNDokVxdOvApmu1QX5fABYwbn1ATiIwp194Ur_E,2889
|
149
150
|
omlish/collections/cache/__init__.py,sha256=D1gO71VcwxFTZP9gAc9isHfg_TEdalwhsJcgGLvS9hg,233
|
@@ -163,7 +164,7 @@ omlish/concurrent/futures.py,sha256=J2s9wYURUskqRJiBbAR0PNEAp1pXbIMYldOVBTQduQY,
|
|
163
164
|
omlish/concurrent/threadlets.py,sha256=JfirbTDJgy9Ouokz_VmHeAAPS7cih8qMUJrN-owwXD4,2423
|
164
165
|
omlish/configs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
165
166
|
omlish/configs/all.py,sha256=kziwjzUBkf8AT0w7Pq7JX2jtkQVOQ5R1wJyn6hfTN5k,1055
|
166
|
-
omlish/configs/classes.py,sha256=
|
167
|
+
omlish/configs/classes.py,sha256=9uelgi9gS5Sf8ZbtydNXhMxjBs7xBxGZgfuK0Vbc2cg,1168
|
167
168
|
omlish/configs/formats.py,sha256=RJw4Rzp7vlTd5YyAvpAoruQnk45v8dGPtPWwqH7aYyE,5301
|
168
169
|
omlish/configs/nginx.py,sha256=XuX9yyb0_MwkJ8esKiMS9gFkqHUPza_uCprhnWykNy8,2051
|
169
170
|
omlish/configs/shadow.py,sha256=-R5nbevC4pFgqDPYOCCIqNcusgXsMWlRIUOEG0HBoJg,2228
|
@@ -181,12 +182,13 @@ omlish/daemons/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
181
182
|
omlish/daemons/daemon.py,sha256=ykdbCPbpxKrdZVZc892SnedTdftTAYt_YdDpYchKcUE,3410
|
182
183
|
omlish/daemons/launching.py,sha256=mhtkuAO16STcznUl3rrX9pacfrKbPQRCP2AllKL4B70,3664
|
183
184
|
omlish/daemons/reparent.py,sha256=UaG2X6VJHJPOlUwHPNRH3aWGgF0Fg771jjO9IRPLlyY,280
|
184
|
-
omlish/daemons/services.py,sha256=
|
185
|
+
omlish/daemons/services.py,sha256=UAzzdP4jG0-piVzz6CsSTPIjTGt4VFXtbzP7KczMCho,2354
|
185
186
|
omlish/daemons/spawning.py,sha256=cx00xeqSrfhlFbjCtKqaBHvMuHwB9hdjuKNHzAAo_dw,4030
|
186
|
-
omlish/daemons/targets.py,sha256=
|
187
|
+
omlish/daemons/targets.py,sha256=00KmtlknMhQ5PyyVAhWl3rpeTMPym0GxvHHq6mYPZ7c,3051
|
187
188
|
omlish/daemons/waiting.py,sha256=RfgD1L33QQVbD2431dkKZGE4w6DUcGvYeRXXi8puAP4,1676
|
188
|
-
omlish/dataclasses/__init__.py,sha256=
|
189
|
-
omlish/dataclasses/
|
189
|
+
omlish/dataclasses/__init__.py,sha256=b7EZCIfHnEHCHWwgD3YXxkdsU-uYd9iD4hM36RgpI1g,1598
|
190
|
+
omlish/dataclasses/static.py,sha256=6pZG2iTR9NN8pKm-5ukDABnaVlTKFOzMwkg-rbxURoo,7691
|
191
|
+
omlish/dataclasses/utils.py,sha256=QWsHxVisS-MUCqh89JQsRdCLgdBVeC6EYK6jRwO9akU,3631
|
190
192
|
omlish/dataclasses/impl/LICENSE,sha256=Oy-B_iHRgcSZxZolbI4ZaEVdZonSaaqFNzv7avQdo78,13936
|
191
193
|
omlish/dataclasses/impl/__init__.py,sha256=zqGBC5gSbjJxaqG_zS1LL1PX-zAfhIua8UqOE4IwO2k,789
|
192
194
|
omlish/dataclasses/impl/api.py,sha256=RhU4f50GVdn-dxilia8NA3F7VIm2R5z78pFfpIVXPRQ,6635
|
@@ -302,7 +304,7 @@ omlish/funcs/pipes.py,sha256=E7Sz8Aj8ke_vCs5AMNwg1I36kRdHVGTnzxVQaDyn43U,2490
|
|
302
304
|
omlish/graphs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
303
305
|
omlish/graphs/dags.py,sha256=zp55lYgUdRCxmADwiGDHeehMJczZFA_tzdWqy77icOk,3047
|
304
306
|
omlish/graphs/domination.py,sha256=oCGoWzWTxLwow0LDyGjjEf2AjFiOiDz4WaBtczwSbsQ,7576
|
305
|
-
omlish/graphs/trees.py,sha256=
|
307
|
+
omlish/graphs/trees.py,sha256=OgGDnCJKfpOeWgDJPSkuVEoeYp72o06jpm0jwUB96Xc,8189
|
306
308
|
omlish/graphs/dot/__init__.py,sha256=Y1MZRQBZkcYyG1Tn7K2FhL8aYbm4v4tk6f5g9AqEkUw,359
|
307
309
|
omlish/graphs/dot/items.py,sha256=OWPf0-hjBgS1uyy2QgAEn4IgFHJcEg7sHVWeTx1ghZc,4083
|
308
310
|
omlish/graphs/dot/make.py,sha256=RN30gHfJPiXx5Q51kbDdhVJYf59Fr84Lz9J-mXRt9sI,360
|
@@ -395,17 +397,17 @@ omlish/iterators/iterators.py,sha256=ghI4dO6WPyyFOLTIIMaHQ_IOy2xXaFpGPqveZ5YGIBU
|
|
395
397
|
omlish/iterators/recipes.py,sha256=53mkexitMhkwXQZbL6DrhpT0WePQ_56uXd5Jaw3DfzI,467
|
396
398
|
omlish/iterators/tools.py,sha256=Pi4ybXytUXVZ3xwK89xpPImQfYYId9p1vIFQvVqVLqA,2551
|
397
399
|
omlish/iterators/unique.py,sha256=0jAX3kwzVfRNhe0Tmh7kVP_Q2WBIn8POo_O-rgFV0rQ,1390
|
398
|
-
omlish/lang/__init__.py,sha256=
|
400
|
+
omlish/lang/__init__.py,sha256=2jxO7QWT0uOvdYdmBFgnqmVh-6I7DofsapgUl3wu1fY,4145
|
399
401
|
omlish/lang/cached.py,sha256=tQaqMu1LID0q4NSTk5vPXsgxIBWSFAmjs5AhQoEHoCQ,7833
|
400
402
|
omlish/lang/clsdct.py,sha256=sJYadm-fwzti-gsi98knR5qQUxriBmOqQE_qz3RopNk,1743
|
401
403
|
omlish/lang/cmp.py,sha256=5vbzWWbqdzDmNKAGL19z6ZfUKe5Ci49e-Oegf9f4BsE,1346
|
402
404
|
omlish/lang/contextmanagers.py,sha256=Mrn8NJ3pP0Zxi-IoGqSjZDdWUctsyee2vrZ2FtZvNmo,10529
|
403
405
|
omlish/lang/datetimes.py,sha256=ehI_DhQRM-bDxAavnp470XcekbbXc4Gdw9y1KpHDJT0,223
|
404
|
-
omlish/lang/descriptors.py,sha256=
|
406
|
+
omlish/lang/descriptors.py,sha256=mZ2h9zJ__MMpw8hByjRbAiONcwfVb6GD0btNnVi8C5w,6573
|
405
407
|
omlish/lang/exceptions.py,sha256=qJBo3NU1mOWWm-NhQUHCY5feYXR3arZVyEHinLsmRH4,47
|
406
408
|
omlish/lang/functions.py,sha256=0ql9EXA_gEEhvUVzMJCjVhEnVtHecsLKmfmAXuQqeGY,4388
|
407
409
|
omlish/lang/generators.py,sha256=5LX17j-Ej3QXhwBgZvRTm_dq3n9veC4IOUcVmvSu2vU,5243
|
408
|
-
omlish/lang/imports.py,sha256=
|
410
|
+
omlish/lang/imports.py,sha256=Gdl6xCF89xiMOE1yDmdvKWamLq8HX-XPianO58Jdpmw,9218
|
409
411
|
omlish/lang/iterables.py,sha256=HOjcxOwyI5bBApDLsxRAGGhTTmw7fdZl2kEckxRVl-0,1994
|
410
412
|
omlish/lang/maybes.py,sha256=dAgrUoAhCgyrHRqa73CkaGnpXwGc-o9n-NIThrNXnbU,3416
|
411
413
|
omlish/lang/objects.py,sha256=65XsD7UtblRdNe2ID1-brn_QvRkJhBIk5nyZWcQNeqU,4574
|
@@ -432,7 +434,8 @@ omlish/lite/cached.py,sha256=O7ozcoDNFm1Hg2wtpHEqYSp_i_nCLNOP6Ueq_Uk-7mU,1300
|
|
432
434
|
omlish/lite/check.py,sha256=OLwtE2x6nlbGx4vS3Rda7zMHpgqzDSLJminTAX2lqLA,13529
|
433
435
|
omlish/lite/configs.py,sha256=Ev_19sbII67pTWzInYjYqa9VyTiZBvyjhZqyG8TtufE,908
|
434
436
|
omlish/lite/contextmanagers.py,sha256=ciaMl0D3QDHToM7M28-kwZ-Q48LtwgCxiud3nekgutA,2863
|
435
|
-
omlish/lite/dataclasses.py,sha256=
|
437
|
+
omlish/lite/dataclasses.py,sha256=t1G5-xOuvE6o6w9RyqHzLT9wHD0HkqBh5P8HUZWxGzs,1912
|
438
|
+
omlish/lite/imports.py,sha256=o9WWrNrWg0hKeMvaj91giaovED_9VFanN2MyEHBGekY,1346
|
436
439
|
omlish/lite/inject.py,sha256=qBUftFeXMiRgANYbNS2e7TePMYyFAcuLgsJiLyMTW5o,28769
|
437
440
|
omlish/lite/json.py,sha256=7-02Ny4fq-6YAu5ynvqoijhuYXWpLmfCI19GUeZnb1c,740
|
438
441
|
omlish/lite/logs.py,sha256=CWFG0NKGhqNeEgryF5atN2gkPYbUdTINEw_s1phbINM,51
|
@@ -463,10 +466,11 @@ omlish/logs/proxy.py,sha256=A-ROPUUAlF397qTbEqhel6YhQMstNuXL3Xmts7w9dAo,2347
|
|
463
466
|
omlish/logs/standard.py,sha256=FbKdF2Z4Na5i2TNwKn0avLJXyICe2JKsPufjvKCHGn0,3162
|
464
467
|
omlish/logs/timing.py,sha256=XrFUHIPT4EHDujLKbGs9fGFMmoM3NEP8xPRaESJr7bQ,1513
|
465
468
|
omlish/logs/utils.py,sha256=mzHrZ9ji75p5A8qR29eUr05CBAHMb8J753MSkID_VaQ,393
|
466
|
-
omlish/manifests/__init__.py,sha256=
|
467
|
-
omlish/manifests/base.py,sha256=
|
468
|
-
omlish/manifests/load.py,sha256=
|
469
|
-
omlish/manifests/
|
469
|
+
omlish/manifests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
470
|
+
omlish/manifests/base.py,sha256=D1WvJYcBR_njkc0gpALpFCWh1h3agb9qgqphnbbPlm4,935
|
471
|
+
omlish/manifests/load.py,sha256=9mdsS3egmSX9pymO-m-y2Fhs4p6ruOdbsYaKT1-1Hwg,6655
|
472
|
+
omlish/manifests/static.py,sha256=7YwOVh_Ek9_aTrWsWNO8kWS10_j4K7yv3TpXZSHsvDY,501
|
473
|
+
omlish/manifests/types.py,sha256=IOt9dOe0r8okCHSL82ryi3sn4VZ6AT80g_QQR6oZtCE,306
|
470
474
|
omlish/marshal/__init__.py,sha256=00D3S6qwUld1TUWd67hVHuNcrj3c_FAFSkCVXgGWT-s,2607
|
471
475
|
omlish/marshal/base.py,sha256=tJ4iNuD7cW2GpGMznOhkAf2hugqp2pF2em0FaQcekrk,6740
|
472
476
|
omlish/marshal/exceptions.py,sha256=jwQWn4LcPnadT2KRI_1JJCOSkwWh0yHnYK9BmSkNN4U,302
|
@@ -625,7 +629,7 @@ omlish/specs/openapi/__init__.py,sha256=zilQhafjvteRDF_TUIRgF293dBC6g-TJChmUb6T9
|
|
625
629
|
omlish/specs/openapi/marshal.py,sha256=Z-E2Knm04C81N8AA8cibCVSl2ImhSpHZVc7yAhmPx88,2135
|
626
630
|
omlish/specs/openapi/openapi.py,sha256=y4h04jeB7ORJSVrcy7apaBdpwLjIyscv1Ub5SderH2c,12682
|
627
631
|
omlish/sql/__init__.py,sha256=TpZLsEJKJzvJ0eMzuV8hwOJJbkxBCV1RZPUMLAVB6io,173
|
628
|
-
omlish/sql/abc.py,sha256=
|
632
|
+
omlish/sql/abc.py,sha256=K3AmEPVxzvQrrc1AXdlbM9-9LERGq6lko9slx88kB90,2074
|
629
633
|
omlish/sql/dbapi.py,sha256=5ghJH-HexsmDlYdWlhf00nCGQX2IC98_gxIxMkucOas,3195
|
630
634
|
omlish/sql/dbs.py,sha256=65e388987upJpsFX8bNL7uhiYv2sCsmk9Y04V0MXdsI,1873
|
631
635
|
omlish/sql/params.py,sha256=Z4VPet6GhNqD1T_MXSWSHkdy3cpUEhST-OplC4B_fYI,4433
|
@@ -636,6 +640,14 @@ omlish/sql/alchemy/duckdb.py,sha256=kr7pIhiBLNAuZrcigHDtFg9zHkVcrRW3LfryO9VJ4mk,
|
|
636
640
|
omlish/sql/alchemy/exprs.py,sha256=gO4Fj4xEY-PuDgV-N8hBMy55glZz7O-4H7v1LWabfZY,323
|
637
641
|
omlish/sql/alchemy/secrets.py,sha256=WEeaec1ejQcE3Yaa7p5BSP9AMGEzy1lwr7QMSRL0VBw,180
|
638
642
|
omlish/sql/alchemy/sqlean.py,sha256=RbkuOuFIfM4fowwKk8-sQ6Dxk-tTUwxS94nY5Kxt52s,403
|
643
|
+
omlish/sql/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
644
|
+
omlish/sql/api/base.py,sha256=iPvLwI_noMzazgPlYOZb9xzpXfyb_OfX2WKD9nzWpQc,1506
|
645
|
+
omlish/sql/api/columns.py,sha256=UBol4bfwZ1nhcjv2gE1JhUMzRFeqtiCDo2T9CUGYb64,1943
|
646
|
+
omlish/sql/api/dbapi.py,sha256=H3bFoWI-ox81APX3xBbjylNWyMUXh78ICMQjRrlDNxw,2426
|
647
|
+
omlish/sql/api/errors.py,sha256=YtC2gz5DqRTT3uCJniUOufVH1GEnFIc5ElkYLK3BHwM,230
|
648
|
+
omlish/sql/api/funcs.py,sha256=-H6V-o9JPSHFXsxdHtutB4mP2LwJfCzlLbRrPHunmB4,990
|
649
|
+
omlish/sql/api/queries.py,sha256=IgB8_sDe40-mKE-ByTmZ4GVOCdLLJDzJGJCevMd8R5s,1207
|
650
|
+
omlish/sql/api/rows.py,sha256=MEK9LNYEe8vLEJXQJD63MpnSOiE22cawJL-dUWQD6sU,1246
|
639
651
|
omlish/sql/queries/__init__.py,sha256=N8oQFKY99g_MQhrPmvlBAkMeGIRURE9UxMO244mytzY,1332
|
640
652
|
omlish/sql/queries/base.py,sha256=_8O3MbH_OEjBnhp2oIJUZ3ClaQ8l4Sj9BdPdsP0Ie-g,224
|
641
653
|
omlish/sql/queries/binary.py,sha256=dcEzeEn104AMPuQ7QrJU2O-YCN3SUdxB5S4jaWKOUqY,2253
|
@@ -711,9 +723,9 @@ omlish/text/indent.py,sha256=YjtJEBYWuk8--b9JU_T6q4yxV85_TR7VEVr5ViRCFwk,1336
|
|
711
723
|
omlish/text/minja.py,sha256=jZC-fp3Xuhx48ppqsf2Sf1pHbC0t8XBB7UpUUoOk2Qw,5751
|
712
724
|
omlish/text/parts.py,sha256=JkNZpyR2tv2CNcTaWJJhpQ9E4F0yPR8P_YfDbZfMtwQ,6182
|
713
725
|
omlish/text/random.py,sha256=jNWpqiaKjKyTdMXC-pWAsSC10AAP-cmRRPVhm59ZWLk,194
|
714
|
-
omlish-0.0.0.
|
715
|
-
omlish-0.0.0.
|
716
|
-
omlish-0.0.0.
|
717
|
-
omlish-0.0.0.
|
718
|
-
omlish-0.0.0.
|
719
|
-
omlish-0.0.0.
|
726
|
+
omlish-0.0.0.dev239.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
727
|
+
omlish-0.0.0.dev239.dist-info/METADATA,sha256=PAeUaSnrnpMgIXzNGwmmS2lJbNgNdNwF8RdlvS-6S88,4176
|
728
|
+
omlish-0.0.0.dev239.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
729
|
+
omlish-0.0.0.dev239.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
|
730
|
+
omlish-0.0.0.dev239.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
|
731
|
+
omlish-0.0.0.dev239.dist-info/RECORD,,
|
omlish/collections/indexed.py
DELETED
@@ -1,73 +0,0 @@
|
|
1
|
-
import typing as ta
|
2
|
-
|
3
|
-
from .identity import IdentityKeyDict
|
4
|
-
from .identity import IdentitySet
|
5
|
-
|
6
|
-
|
7
|
-
T = ta.TypeVar('T')
|
8
|
-
|
9
|
-
|
10
|
-
class IndexedSeq(ta.Sequence[T]):
|
11
|
-
def __init__(self, it: ta.Iterable[T], *, identity: bool = False) -> None:
|
12
|
-
super().__init__()
|
13
|
-
|
14
|
-
self._lst = list(it)
|
15
|
-
self._idxs: ta.Mapping[T, int] = (IdentityKeyDict if identity else dict)((e, i) for i, e in enumerate(self._lst)) # noqa
|
16
|
-
if len(self._idxs) != len(self._lst):
|
17
|
-
raise ValueError(f'{len(self._idxs)} != {len(self._lst)}')
|
18
|
-
|
19
|
-
@property
|
20
|
-
def debug(self) -> ta.Sequence[T]:
|
21
|
-
return self._lst
|
22
|
-
|
23
|
-
def __iter__(self) -> ta.Iterator[T]:
|
24
|
-
return iter(self._lst)
|
25
|
-
|
26
|
-
def __getitem__(self, idx: int) -> T: # type: ignore
|
27
|
-
return self._lst[idx]
|
28
|
-
|
29
|
-
def __len__(self) -> int:
|
30
|
-
return len(self._lst)
|
31
|
-
|
32
|
-
def __contains__(self, obj: T) -> bool: # type: ignore
|
33
|
-
return obj in self._idxs
|
34
|
-
|
35
|
-
@property
|
36
|
-
def idxs(self) -> ta.Mapping[T, int]:
|
37
|
-
return self._idxs
|
38
|
-
|
39
|
-
def idx(self, obj: T) -> int:
|
40
|
-
return self._idxs[obj]
|
41
|
-
|
42
|
-
|
43
|
-
class IndexedSetSeq(ta.Sequence[ta.AbstractSet[T]]):
|
44
|
-
def __init__(self, it: ta.Iterable[ta.Iterable[T]], *, identity: bool = False) -> None:
|
45
|
-
super().__init__()
|
46
|
-
|
47
|
-
self._lst = [(IdentitySet if identity else set)(e) for e in it]
|
48
|
-
self._idxs: ta.Mapping[T, int] = (IdentityKeyDict if identity else dict)((e, i) for i, es in enumerate(self._lst) for e in es) # noqa
|
49
|
-
if len(self._idxs) != sum(map(len, self._lst)):
|
50
|
-
raise ValueError(f'{len(self._idxs)} != {sum(map(len, self._lst))}')
|
51
|
-
|
52
|
-
@property
|
53
|
-
def debug(self) -> ta.Sequence[ta.AbstractSet[T]]:
|
54
|
-
return self._lst
|
55
|
-
|
56
|
-
def __iter__(self) -> ta.Iterator[ta.AbstractSet[T]]:
|
57
|
-
return iter(self._lst)
|
58
|
-
|
59
|
-
def __getitem__(self, idx: int) -> ta.AbstractSet[T]: # type: ignore
|
60
|
-
return self._lst[idx]
|
61
|
-
|
62
|
-
def __len__(self) -> int:
|
63
|
-
return len(self._lst)
|
64
|
-
|
65
|
-
def __contains__(self, obj: T) -> bool: # type: ignore
|
66
|
-
return obj in self._idxs
|
67
|
-
|
68
|
-
@property
|
69
|
-
def idxs(self) -> ta.Mapping[T, int]:
|
70
|
-
return self._idxs
|
71
|
-
|
72
|
-
def idx(self, obj: T) -> int:
|
73
|
-
return self._idxs[obj]
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|