fast-clean 1.2.2__py3-none-any.whl → 1.3.0__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.
- fast_clean/contrib/logging/sentry.py +0 -3
- fast_clean/repositories/crud/__init__.py +1 -3
- fast_clean/repositories/crud/db.py +0 -8
- fast_clean/repositories/crud/in_memory.py +1 -9
- fast_clean/schemas/__init__.py +0 -1
- fast_clean-1.3.0.dist-info/METADATA +42 -0
- {fast_clean-1.2.2.dist-info → fast_clean-1.3.0.dist-info}/RECORD +9 -9
- fast_clean-1.2.2.dist-info/METADATA +0 -1426
- {fast_clean-1.2.2.dist-info → fast_clean-1.3.0.dist-info}/WHEEL +0 -0
- {fast_clean-1.2.2.dist-info → fast_clean-1.3.0.dist-info}/top_level.txt +0 -0
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
import uuid
|
10
10
|
from collections.abc import Iterable, Sequence
|
11
|
-
from typing import
|
11
|
+
from typing import Protocol, Self
|
12
12
|
|
13
13
|
from fast_clean.schemas import PaginationResultSchema, PaginationSchema
|
14
14
|
|
@@ -70,8 +70,6 @@ class CrudRepositoryBaseProtocol(
|
|
70
70
|
async def paginate(
|
71
71
|
self: Self,
|
72
72
|
pagination: PaginationSchema,
|
73
|
-
user: Any,
|
74
|
-
policies: list[str],
|
75
73
|
*,
|
76
74
|
search: str | None = None,
|
77
75
|
search_by: Iterable[str] | None = None,
|
@@ -173,8 +173,6 @@ class DbCrudRepositoryBase(
|
|
173
173
|
async def paginate(
|
174
174
|
self: Self,
|
175
175
|
pagination: PaginationSchema,
|
176
|
-
user: Any,
|
177
|
-
policies: list[str],
|
178
176
|
*,
|
179
177
|
search: str | None = None,
|
180
178
|
search_by: Iterable[str] | None = None,
|
@@ -185,8 +183,6 @@ class DbCrudRepositoryBase(
|
|
185
183
|
"""
|
186
184
|
return await self.paginate_with_filter(
|
187
185
|
pagination,
|
188
|
-
user,
|
189
|
-
policies,
|
190
186
|
search=search,
|
191
187
|
search_by=search_by,
|
192
188
|
sorting=sorting,
|
@@ -475,8 +471,6 @@ class DbCrudRepositoryBase(
|
|
475
471
|
async def paginate_with_filter(
|
476
472
|
self: Self,
|
477
473
|
pagination: PaginationSchema,
|
478
|
-
user: Any,
|
479
|
-
policies: list[str],
|
480
474
|
*,
|
481
475
|
search: str | None = None,
|
482
476
|
search_by: Iterable[str] | None = None,
|
@@ -486,8 +480,6 @@ class DbCrudRepositoryBase(
|
|
486
480
|
"""
|
487
481
|
Получаем список моделей с пагинацией, поиском, сортировкой и фильтрами.
|
488
482
|
"""
|
489
|
-
if len(policies) == 0:
|
490
|
-
return PaginationResultSchema(objects=[], count=0)
|
491
483
|
search_by = search_by or []
|
492
484
|
sorting = sorting or []
|
493
485
|
async with self.session_manager.get_session() as s:
|
@@ -7,7 +7,7 @@ import uuid
|
|
7
7
|
from abc import ABC, abstractmethod
|
8
8
|
from collections.abc import Iterable, Sequence
|
9
9
|
from itertools import groupby
|
10
|
-
from typing import
|
10
|
+
from typing import Callable, Generic, Self, cast, get_args
|
11
11
|
|
12
12
|
from fast_clean.enums import ModelActionEnum
|
13
13
|
from fast_clean.exceptions import ModelIntegrityError, ModelNotFoundError
|
@@ -145,8 +145,6 @@ class InMemoryCrudRepositoryBase(ABC, Generic[ReadSchemaBaseType, CreateSchemaBa
|
|
145
145
|
async def paginate(
|
146
146
|
self: Self,
|
147
147
|
pagination: PaginationSchema,
|
148
|
-
user: Any,
|
149
|
-
policies: list[str],
|
150
148
|
*,
|
151
149
|
search: str | None = None,
|
152
150
|
search_by: Iterable[str] | None = None,
|
@@ -157,8 +155,6 @@ class InMemoryCrudRepositoryBase(ABC, Generic[ReadSchemaBaseType, CreateSchemaBa
|
|
157
155
|
"""
|
158
156
|
return self.paginate_with_filter(
|
159
157
|
pagination,
|
160
|
-
user,
|
161
|
-
policies,
|
162
158
|
search=search,
|
163
159
|
search_by=search_by,
|
164
160
|
sorting=sorting,
|
@@ -251,8 +247,6 @@ class InMemoryCrudRepositoryBase(ABC, Generic[ReadSchemaBaseType, CreateSchemaBa
|
|
251
247
|
def paginate_with_filter(
|
252
248
|
self: Self,
|
253
249
|
pagination: PaginationSchema,
|
254
|
-
user: Any,
|
255
|
-
policies: list[str],
|
256
250
|
*,
|
257
251
|
search: str | None = None,
|
258
252
|
search_by: Iterable[str] | None = None,
|
@@ -262,8 +256,6 @@ class InMemoryCrudRepositoryBase(ABC, Generic[ReadSchemaBaseType, CreateSchemaBa
|
|
262
256
|
"""
|
263
257
|
Получаем список моделей с пагинацией, поиском, сортировкой и фильтрами.
|
264
258
|
"""
|
265
|
-
if len(policies) == 0:
|
266
|
-
return PaginationResultSchema(objects=[], count=0)
|
267
259
|
search_by = search_by or []
|
268
260
|
sorting = sorting or []
|
269
261
|
models = list(filter(select_filter, self.models.values()) if select_filter else self.models.values())
|
fast_clean/schemas/__init__.py
CHANGED
@@ -22,4 +22,3 @@ from .request_response import RemoteRequestSchema as RemoteRequestSchema
|
|
22
22
|
from .request_response import RemoteResponseSchema as RemoteResponseSchema
|
23
23
|
from .request_response import RequestSchema as RequestSchema
|
24
24
|
from .request_response import ResponseSchema as ResponseSchema
|
25
|
-
from .status_response import StatusOkResponseSchema as StatusOkResponseSchema
|
@@ -0,0 +1,42 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: fast-clean
|
3
|
+
Version: 1.3.0
|
4
|
+
Summary: FastAPI Clean Architecture implementation
|
5
|
+
Author-email: Luferov Victor <luferovvs@yandex.ru>, Orlov Artem <squakrazv@yandex.ru>, Kashapov Rustam <hardtechnik91@gmail.com>
|
6
|
+
Requires-Python: >=3.13
|
7
|
+
Description-Content-Type: text/markdown
|
8
|
+
Requires-Dist: aiofiles>=24.1.0
|
9
|
+
Requires-Dist: aiokafka>=0.12.0
|
10
|
+
Requires-Dist: aioprometheus>=23.12.0
|
11
|
+
Requires-Dist: alembic>=1.16.2
|
12
|
+
Requires-Dist: cryptography>=44.0.1
|
13
|
+
Requires-Dist: dishka>=1.6.0
|
14
|
+
Requires-Dist: fastapi>=0.115.8
|
15
|
+
Requires-Dist: fastapi-cache2[redis]>=0.2.2
|
16
|
+
Requires-Dist: faststream>=0.5.34
|
17
|
+
Requires-Dist: flatten-dict>=0.4.2
|
18
|
+
Requires-Dist: miniopy-async>=1.21.1
|
19
|
+
Requires-Dist: overrides>=7.7.0
|
20
|
+
Requires-Dist: psycopg[binary]>=3.2.4
|
21
|
+
Requires-Dist: pydantic>=2.10.6
|
22
|
+
Requires-Dist: pydantic-settings>=2.8.0
|
23
|
+
Requires-Dist: pyyaml>=6.0.2
|
24
|
+
Requires-Dist: sentry-sdk[fastapi]>=2.32.0
|
25
|
+
Requires-Dist: snakecase>=1.0.1
|
26
|
+
Requires-Dist: sqlalchemy-utils>=0.41.2
|
27
|
+
Requires-Dist: sqlalchemy[asyncio]>=2.0.38
|
28
|
+
Requires-Dist: stringcase>=1.2.0
|
29
|
+
Requires-Dist: typer>=0.15.1
|
30
|
+
|
31
|
+
# FastClean
|
32
|
+
|
33
|
+
FastAPI clean architecture implementation
|
34
|
+
|
35
|
+
|
36
|
+
## Contribution
|
37
|
+
|
38
|
+
```
|
39
|
+
git clone git@github.com:Luferov/fast-clean.git
|
40
|
+
uv sync
|
41
|
+
uv run pre-commit install
|
42
|
+
```
|
@@ -17,7 +17,7 @@ fast_clean/contrib/healthcheck/router.py,sha256=7uq0D6ldhxB3Jsa9Ia1zpiRAyC3hQgUv
|
|
17
17
|
fast_clean/contrib/healthcheck/schemas.py,sha256=nMdUezXvwyJdlHiJbPiLUIa6bJ_JeF1Tr3S-TllMENU,200
|
18
18
|
fast_clean/contrib/logging/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
19
19
|
fast_clean/contrib/logging/enums.py,sha256=a-Tz3k4j0aAbUXDvTV6sl2pKKEGuKG94qc3plXixezU,154
|
20
|
-
fast_clean/contrib/logging/sentry.py,sha256=
|
20
|
+
fast_clean/contrib/logging/sentry.py,sha256=gey6ynlkZtrU2qzwdKvpkYy0JO0AEyHDpiiRcIzfiDg,593
|
21
21
|
fast_clean/contrib/monitoring/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
22
22
|
fast_clean/contrib/monitoring/middleware.py,sha256=F6EDY_hNBmFlji-cCJwzsm5Wl1S0CsO373rjxfqjlGA,191
|
23
23
|
fast_clean/contrib/monitoring/router.py,sha256=94gffX34VE_Yb6TLaQOP4YyXDQsClzOn4APb45V_HyA,153
|
@@ -27,9 +27,9 @@ fast_clean/repositories/__init__.py,sha256=mHJ6CW1fYkkiSnnYiO3GRAa5YVCPN1otOOKkj
|
|
27
27
|
fast_clean/repositories/cache/__init__.py,sha256=pD7qIS6H8DrnhOptJiXrlGcWYUCIU3VmVQCLccyxx4Q,2511
|
28
28
|
fast_clean/repositories/cache/in_memory.py,sha256=Hb68UrTmQozALcyLrmYPBIfJfi67NvsCTDe1RfqwBHQ,2259
|
29
29
|
fast_clean/repositories/cache/redis.py,sha256=UjrA2CXQtMfHTpowz6Ot952y73YjTEr6zJlBbWblaws,1908
|
30
|
-
fast_clean/repositories/crud/__init__.py,sha256=
|
31
|
-
fast_clean/repositories/crud/db.py,sha256=
|
32
|
-
fast_clean/repositories/crud/in_memory.py,sha256
|
30
|
+
fast_clean/repositories/crud/__init__.py,sha256=z_-zY3esEbUEHSGb9WInU-vvRuTpTu4M-Qe5UhCN0Pc,4359
|
31
|
+
fast_clean/repositories/crud/db.py,sha256=KzqQXt0srcBFt2ftlkDcGPEKC_dvwAybFi5UvRTyIq0,23202
|
32
|
+
fast_clean/repositories/crud/in_memory.py,sha256=37VBQJTIV4z1_Om9DhYqpa1t98hGGhY8gumoyV-fhDg,13172
|
33
33
|
fast_clean/repositories/crud/type_vars.py,sha256=Gb4ew1T1NkitL87hJ75KtpTjOi6PuML5fU_zFAsVUqA,1318
|
34
34
|
fast_clean/repositories/settings/__init__.py,sha256=ZxrncvTDs8pNkhWSy2cxV3a8uElTnrM-b1-vq4ouJok,1485
|
35
35
|
fast_clean/repositories/settings/enums.py,sha256=coqZg6xe_mRFWeihBfnSkCByLuD0pT8Vv4g02tpBk-w,358
|
@@ -42,7 +42,7 @@ fast_clean/repositories/storage/local.py,sha256=s5REPU7xczvzin13sKyZtFdiocrgAMk8
|
|
42
42
|
fast_clean/repositories/storage/reader.py,sha256=yAxj51ITWJf0u-KGC3DJ0iTB3pDI1p9ixi_h0ZcWoZ4,3299
|
43
43
|
fast_clean/repositories/storage/s3.py,sha256=z3YHGk89Ac87qAy3FApCXDpEx_CRdLfLzXBIng-BfUQ,4318
|
44
44
|
fast_clean/repositories/storage/schemas.py,sha256=etlogfK_1uUZPQjHWQN6LWy6-8YY2Sago3Zbf6p0KcQ,623
|
45
|
-
fast_clean/schemas/__init__.py,sha256=
|
45
|
+
fast_clean/schemas/__init__.py,sha256=VgJKIY20qoZZOV55zLGnH2FYWoHpPfJS31HJAj_nGIo,1283
|
46
46
|
fast_clean/schemas/exceptions.py,sha256=E7G9jv4G82Ede7OQ3619vPGwEywc7tKmXW6EolOGRFQ,723
|
47
47
|
fast_clean/schemas/pagination.py,sha256=GEQ-Tbhx6xkMMXhDNWrTEhPv8IdnAOJxH2P1tscmn60,1384
|
48
48
|
fast_clean/schemas/repository.py,sha256=ASxMJb23H3zwavr7P0_ZpCWZX7FjqAuC75qAIYqejvQ,889
|
@@ -63,7 +63,7 @@ fast_clean/utils/thread.py,sha256=ChEWBLupnSEMq4Wro_aiW0QvCLUKedKc0TQFMu7Zg4g,56
|
|
63
63
|
fast_clean/utils/time.py,sha256=nvavbtG4zR_gkrGSbsqKAsBdePxO3LuTeoISbFZIgn0,307
|
64
64
|
fast_clean/utils/type_converters.py,sha256=bMEJeoQB9Q6Qok1-ppn4Ii8ZpIkZwJbD2IzCydSStHw,523
|
65
65
|
fast_clean/utils/typer.py,sha256=1O7BsNGn68bBzNbj0-Ycfhv35WpLzwvYTKn510YNXQQ,663
|
66
|
-
fast_clean-1.
|
67
|
-
fast_clean-1.
|
68
|
-
fast_clean-1.
|
69
|
-
fast_clean-1.
|
66
|
+
fast_clean-1.3.0.dist-info/METADATA,sha256=RIsstyzjbBZFKcJmzekGf1Hb_d8ZQfjhG5I3P_DtPIU,1234
|
67
|
+
fast_clean-1.3.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
68
|
+
fast_clean-1.3.0.dist-info/top_level.txt,sha256=QfsGs-QLmPCZWWPFOukD0zhMnokH68FoO2KeObl6ZIA,11
|
69
|
+
fast_clean-1.3.0.dist-info/RECORD,,
|