arpakitlib 1.8.248__py3-none-any.whl → 1.8.250__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.
- arpakitlib/_arpakit_project_template_v_5/project/api/raise_own_exception_if_exception_in_api_router.py +1 -1
- arpakitlib/_arpakit_project_template_v_5/project/sandbox/sandbox_3.py +1 -1
- arpakitlib/ar_really_validate_url.py +47 -0
- arpakitlib/ar_sqlalchemy_util.py +1 -1
- {arpakitlib-1.8.248.dist-info → arpakitlib-1.8.250.dist-info}/METADATA +2 -2
- {arpakitlib-1.8.248.dist-info → arpakitlib-1.8.250.dist-info}/RECORD +15 -14
- /arpakitlib/{clone_pydantic_model_fields.py → ar_clone_pydantic_model_fields.py} +0 -0
- /arpakitlib/{ensure_sqlalchemy_check_constraints.py → ar_ensure_sqlalchemy_check_constraints.py} +0 -0
- /arpakitlib/{generate_simple_code.py → ar_generate_simple_code.py} +0 -0
- /arpakitlib/{pydantic_schema_from_sqlalchemy_model.py → ar_pydantic_schema_from_sqlalchemy_model.py} +0 -0
- /arpakitlib/{raise_own_exception_if_exception.py → ar_raise_own_exception_if_exception.py} +0 -0
- /arpakitlib/{really_validate_email.py → ar_really_validate_email.py} +0 -0
- {arpakitlib-1.8.248.dist-info → arpakitlib-1.8.250.dist-info}/LICENSE +0 -0
- {arpakitlib-1.8.248.dist-info → arpakitlib-1.8.250.dist-info}/WHEEL +0 -0
- {arpakitlib-1.8.248.dist-info → arpakitlib-1.8.250.dist-info}/entry_points.txt +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
from typing import Any
|
2
2
|
|
3
3
|
import fastapi
|
4
|
-
from arpakitlib.
|
4
|
+
from arpakitlib.ar_raise_own_exception_if_exception import raise_own_exception_if_exception
|
5
5
|
|
6
6
|
from project.api.api_exception import APIException
|
7
7
|
from project.api.schema.out.common.error import ErrorCommonSO
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import asyncio
|
2
2
|
|
3
|
-
from arpakitlib.
|
3
|
+
from arpakitlib.ar_pydantic_schema_from_sqlalchemy_model import pydantic_schema_from_sqlalchemy_model
|
4
4
|
from project.sqlalchemy_db_.sqlalchemy_model import UserDBM
|
5
5
|
|
6
6
|
|
@@ -0,0 +1,47 @@
|
|
1
|
+
from urllib.parse import urlparse
|
2
|
+
|
3
|
+
|
4
|
+
class ReallyValidateUrlException(Exception):
|
5
|
+
def __init__(self, url: str, error_message: str):
|
6
|
+
self.url = url
|
7
|
+
self.error_message = error_message
|
8
|
+
|
9
|
+
def __str__(self) -> str:
|
10
|
+
return f"{self.__class__.__name__}, {self.url=}, {self.error_message}"
|
11
|
+
|
12
|
+
def __repr__(self) -> str:
|
13
|
+
return f"{self.__class__.__name__}, {self.url=}, {self.error_message}"
|
14
|
+
|
15
|
+
|
16
|
+
def really_validate_url(url: str) -> None:
|
17
|
+
result = urlparse(url)
|
18
|
+
|
19
|
+
if not result.scheme:
|
20
|
+
raise ReallyValidateUrlException(
|
21
|
+
url=url,
|
22
|
+
error_message="URL must include a scheme (e.g., http/https)."
|
23
|
+
)
|
24
|
+
|
25
|
+
if not result.netloc:
|
26
|
+
raise ReallyValidateUrlException(
|
27
|
+
url=url,
|
28
|
+
error_message="URL must include a domain or host."
|
29
|
+
)
|
30
|
+
|
31
|
+
# Optional: restrict allowed schemes
|
32
|
+
if result.scheme not in ("http", "https", "ftp"):
|
33
|
+
raise ReallyValidateUrlException(
|
34
|
+
url=url,
|
35
|
+
error_message=f"Unsupported scheme: {result.scheme}"
|
36
|
+
)
|
37
|
+
|
38
|
+
# If everything is fine — return None (no errors)
|
39
|
+
return None
|
40
|
+
|
41
|
+
|
42
|
+
def is_really_url_valid(email: str) -> bool:
|
43
|
+
try:
|
44
|
+
really_validate_url(url=email)
|
45
|
+
except ReallyValidateUrlException:
|
46
|
+
return False
|
47
|
+
return True
|
arpakitlib/ar_sqlalchemy_util.py
CHANGED
@@ -299,7 +299,7 @@ class SQLAlchemyDb:
|
|
299
299
|
self._logger.info("alembic tables data were removed")
|
300
300
|
|
301
301
|
def ensure_check_constraints(self):
|
302
|
-
from arpakitlib.
|
302
|
+
from arpakitlib.ar_ensure_sqlalchemy_check_constraints import ensure_sqlalchemy_check_constraints
|
303
303
|
ensure_sqlalchemy_check_constraints(base_=self.base_dbm, engine=self.engine)
|
304
304
|
|
305
305
|
def init(self, ensure_check_constraints: bool = True):
|
@@ -1,10 +1,10 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: arpakitlib
|
3
|
-
Version: 1.8.
|
3
|
+
Version: 1.8.250
|
4
4
|
Summary: arpakitlib
|
5
5
|
License: Apache-2.0
|
6
6
|
Keywords: arpakitlib,arpakit,arpakit-company,arpakitcompany,arpakit_company
|
7
|
-
Author:
|
7
|
+
Author: arpakit_company
|
8
8
|
Author-email: support@arpakit.com
|
9
9
|
Requires-Python: >=3.12.4,<4.0
|
10
10
|
Classifier: Development Status :: 5 - Production/Stable
|
@@ -101,7 +101,7 @@ arpakitlib/_arpakit_project_template_v_5/project/api/middleware/__init__.py,sha2
|
|
101
101
|
arpakitlib/_arpakit_project_template_v_5/project/api/middleware/add_api_middlewares.py,sha256=TrWn0yPDCn0yTlHqLf19ypGtRumNjDxm0sM60yVsqXE,468
|
102
102
|
arpakitlib/_arpakit_project_template_v_5/project/api/middleware/limit_content_length.py,sha256=cEtGcJSh3e2EyuQCFqKzRcrl3qS6oIvpSv5UEbYsvR4,1622
|
103
103
|
arpakitlib/_arpakit_project_template_v_5/project/api/openapi_ui.py,sha256=7yg9ZNu6BjTAregnfbRFpwvqa-gTIY6o6NCz5pmsbeo,976
|
104
|
-
arpakitlib/_arpakit_project_template_v_5/project/api/raise_own_exception_if_exception_in_api_router.py,sha256=
|
104
|
+
arpakitlib/_arpakit_project_template_v_5/project/api/raise_own_exception_if_exception_in_api_router.py,sha256=7zssLmFEfZ5WvC-ZW1bPyn_HrYNPjvK_Q9Ln1-xH3O4,1413
|
105
105
|
arpakitlib/_arpakit_project_template_v_5/project/api/response.py,sha256=xZMymP2BuQaRNVWLeIp3UgUUo-MFN8MJnsn9Al4vOb8,1028
|
106
106
|
arpakitlib/_arpakit_project_template_v_5/project/api/router/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
107
107
|
arpakitlib/_arpakit_project_template_v_5/project/api/router/admin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -237,7 +237,7 @@ arpakitlib/_arpakit_project_template_v_5/project/resource/templates/simple_email
|
|
237
237
|
arpakitlib/_arpakit_project_template_v_5/project/sandbox/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
238
238
|
arpakitlib/_arpakit_project_template_v_5/project/sandbox/sandbox_1.py,sha256=xKSp7tIBu3Ffp_kgJkwVtdam3BcoFZ44JPVHoRRaP0E,163
|
239
239
|
arpakitlib/_arpakit_project_template_v_5/project/sandbox/sandbox_2.py,sha256=xKSp7tIBu3Ffp_kgJkwVtdam3BcoFZ44JPVHoRRaP0E,163
|
240
|
-
arpakitlib/_arpakit_project_template_v_5/project/sandbox/sandbox_3.py,sha256=
|
240
|
+
arpakitlib/_arpakit_project_template_v_5/project/sandbox/sandbox_3.py,sha256=CIv4vQfBLhlIh92fiLhmyTXSZXjDovxTFZtUBDnWyFY,427
|
241
241
|
arpakitlib/_arpakit_project_template_v_5/project/sandbox/sandbox_4.py,sha256=xKSp7tIBu3Ffp_kgJkwVtdam3BcoFZ44JPVHoRRaP0E,163
|
242
242
|
arpakitlib/_arpakit_project_template_v_5/project/sandbox/sandbox_5.py,sha256=xKSp7tIBu3Ffp_kgJkwVtdam3BcoFZ44JPVHoRRaP0E,163
|
243
243
|
arpakitlib/_arpakit_project_template_v_5/project/sandbox/sandbox_6.py,sha256=xKSp7tIBu3Ffp_kgJkwVtdam3BcoFZ44JPVHoRRaP0E,163
|
@@ -388,15 +388,18 @@ arpakitlib/ar_base_worker_util.py,sha256=e-Vj9w1D-59KN3Zz7TQlOB2lW4fZphJlsPpFkmX
|
|
388
388
|
arpakitlib/ar_blank_util.py,sha256=qFUdY8usL_pRYamz8Rw1fW3fzNIgrLmpdYP8q-_PQvw,2281
|
389
389
|
arpakitlib/ar_cache_file_util.py,sha256=Fo2pH-Zqm966KWFBHG_pbiySGZvhIFCYqy7k1weRfJ0,3476
|
390
390
|
arpakitlib/ar_class_util.py,sha256=i76pQW_7k_S2m_DlQh6xNjtggv9Col3WSx9W_bwk98E,722
|
391
|
+
arpakitlib/ar_clone_pydantic_model_fields.py,sha256=xxLwtvJzDf8EWMvBE4psWIj8c-cyeCxLRX76oCY_4zk,1214
|
391
392
|
arpakitlib/ar_datetime_util.py,sha256=Xe1NiT9oPQzNSG7RVRkhukhbg4i-hhS5ImmV7sPUc8o,971
|
392
393
|
arpakitlib/ar_dict_util.py,sha256=oet-9AJEjQZfG_EI82BuYW0jdW2NQxKjPXol_nfTXjw,447
|
393
394
|
arpakitlib/ar_dream_ai_api_client_util.py,sha256=Z1oii_XSsgunYx17SdcHl54S4KPQti7-MJs0xXZ8vL0,2830
|
394
395
|
arpakitlib/ar_encrypt_decrypt_util.py,sha256=GhWnp7HHkbhwFVVCzO1H07m-5gryr4yjWsXjOaNQm1Y,520
|
396
|
+
arpakitlib/ar_ensure_sqlalchemy_check_constraints.py,sha256=JJbgaUiLT8D8oDVevP25wlMz1BTtx0JMasJ_ILyIJ3o,5328
|
395
397
|
arpakitlib/ar_enumeration_util.py,sha256=XoFInWtGzbIr6fJq0un5nettaDfOLAyY84ovwj7n_7g,3030
|
396
398
|
arpakitlib/ar_exception_util.py,sha256=3hZKsj34TZVdmd4JAQz7w515smWqB8o3gTwAEjuMdnI,408
|
397
399
|
arpakitlib/ar_file_storage_in_dir_util.py,sha256=Zh922S6-aIy0p_Fen8GTTrGpixpPQ6c-wFLukiSK4Ck,4091
|
398
400
|
arpakitlib/ar_file_util.py,sha256=GUdJYm1tUZnYpY-SIPRHAZBHGra8NKy1eYEI0D5AfhY,489
|
399
401
|
arpakitlib/ar_func_util.py,sha256=lG0bx_DtxWN4skbUim0liRZ6WUyLVV8Qfk6iZNtCZOs,1042
|
402
|
+
arpakitlib/ar_generate_simple_code.py,sha256=EkrebrTi7sArSRAuxvN5BPm_A0-dFSCZgdoJhx5kPhk,344
|
400
403
|
arpakitlib/ar_hash_util.py,sha256=Iqy6KBAOLBQMFLWv676boI5sV7atT2B-fb7aCdHOmIQ,340
|
401
404
|
arpakitlib/ar_http_request_util.py,sha256=PCUtGOQIvNScrLqD_9Z8LqT-7a-lP2y-Y-CH5vGdn7Q,7663
|
402
405
|
arpakitlib/ar_ip_util.py,sha256=aEAa1Hvobh9DWX7cmBAPLqnXSTiKe2hRk-WJaiKMaI8,1009
|
@@ -411,7 +414,11 @@ arpakitlib/ar_need_type_util.py,sha256=XmY1kswz8j9oo5f9CxRu0_zgfvxWrXPYKOj6MM04s
|
|
411
414
|
arpakitlib/ar_openai_api_client_util.py,sha256=dWgsSPXtxNBxS5VRi_NharGQrUXF_YjIfhU3Bj5cW9M,5651
|
412
415
|
arpakitlib/ar_parse_command.py,sha256=1WTdQoWVshoDZ1jDaKeTzajfqaYHP3FNO0-REyo1aMY,3003
|
413
416
|
arpakitlib/ar_postgresql_util.py,sha256=1AuLjEaa1Lg4pzn-ukCVnDi35Eg1k91APRTqZhIJAdo,945
|
417
|
+
arpakitlib/ar_pydantic_schema_from_sqlalchemy_model.py,sha256=_5Y79kQ4lLIOL6_afIFVwxY1EXzTMpi-veRR-WkPFOs,2879
|
418
|
+
arpakitlib/ar_raise_own_exception_if_exception.py,sha256=A6TuNSBk1pHaQ_qxnUmE2LgsNGA1IGqX26b1_HEA4Nc,5978
|
414
419
|
arpakitlib/ar_rat_func_util.py,sha256=Ca10o3RJwyx_DJLxjTxgHDO6NU3M6CWgUR4bif67OE4,2006
|
420
|
+
arpakitlib/ar_really_validate_email.py,sha256=HBfhyiDB3INI6Iq6hR2WOMKA5wVWWRl0Qun-x__OZ9o,1201
|
421
|
+
arpakitlib/ar_really_validate_url.py,sha256=aaSPVMbz2DSqlC2yk2g44-kTIiHlITfJwIG97L-Y93U,1309
|
415
422
|
arpakitlib/ar_retry_func_util.py,sha256=LB4FJRsu2cssnPw6X8bCEcaGpQsXhkLkgeU37w1t9fU,2250
|
416
423
|
arpakitlib/ar_run_cmd_util.py,sha256=D_rPavKMmWkQtwvZFz-Io5Ak8eSODHkcFeLPzNVC68g,1072
|
417
424
|
arpakitlib/ar_safe_func.py,sha256=c2P1hzB8uQn3l8cAr2nttfHbrM-4QrxgDejk_jM1OVE,2321
|
@@ -419,18 +426,12 @@ arpakitlib/ar_schedule_uust_api_client_util.py,sha256=rXI2_3OTaIBgR-GixM1Ti-Ue1f
|
|
419
426
|
arpakitlib/ar_settings_util.py,sha256=Y5wi_cmsjDjfJpM0VJHjbo0NoVPKfypKaD1USowwDtQ,1327
|
420
427
|
arpakitlib/ar_sleep_util.py,sha256=ggaj7ML6QK_ADsHMcyu6GUmUpQ_9B9n-SKYH17h-9lM,1045
|
421
428
|
arpakitlib/ar_sqladmin_util.py,sha256=SEoaowAPF3lhxPsNjwmOymNJ55Ty9rmzvsDm7gD5Ceo,861
|
422
|
-
arpakitlib/ar_sqlalchemy_util.py,sha256=
|
429
|
+
arpakitlib/ar_sqlalchemy_util.py,sha256=5I7KsKCzJc9hxpn2_0r__RcbqcKpTs_PDw_f5_0P7Xw,16050
|
423
430
|
arpakitlib/ar_str_util.py,sha256=2lGpnXDf2h1cBZpVf5i1tX_HCv5iBd6IGnrCw4QWWlY,4350
|
424
431
|
arpakitlib/ar_type_util.py,sha256=Cs_tef-Fc5xeyAF54KgISCsP11NHyzIsglm4S3Xx7iM,4049
|
425
432
|
arpakitlib/ar_yookassa_api_client_util.py,sha256=VozuZeCJjmLd1zj2BdC9WfiAQ3XYOrIMsdpNK-AUlm0,5347
|
426
|
-
arpakitlib/
|
427
|
-
arpakitlib/
|
428
|
-
arpakitlib/
|
429
|
-
arpakitlib/
|
430
|
-
arpakitlib/
|
431
|
-
arpakitlib/really_validate_email.py,sha256=HBfhyiDB3INI6Iq6hR2WOMKA5wVWWRl0Qun-x__OZ9o,1201
|
432
|
-
arpakitlib-1.8.248.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
|
433
|
-
arpakitlib-1.8.248.dist-info/METADATA,sha256=Ocp-lR_y6KwilRNh4IY-i3e44-AGz8zJFu-bovEVwHY,3919
|
434
|
-
arpakitlib-1.8.248.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
435
|
-
arpakitlib-1.8.248.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
|
436
|
-
arpakitlib-1.8.248.dist-info/RECORD,,
|
433
|
+
arpakitlib-1.8.250.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
|
434
|
+
arpakitlib-1.8.250.dist-info/METADATA,sha256=T4V7KUip-9Bg5nzPDEWl9peAgaitrQnWrlNqYpIY194,3919
|
435
|
+
arpakitlib-1.8.250.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
436
|
+
arpakitlib-1.8.250.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
|
437
|
+
arpakitlib-1.8.250.dist-info/RECORD,,
|
File without changes
|
/arpakitlib/{ensure_sqlalchemy_check_constraints.py → ar_ensure_sqlalchemy_check_constraints.py}
RENAMED
File without changes
|
File without changes
|
/arpakitlib/{pydantic_schema_from_sqlalchemy_model.py → ar_pydantic_schema_from_sqlalchemy_model.py}
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|