arpakitlib 1.7.134__py3-none-any.whl → 1.7.137__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.
@@ -35,10 +35,7 @@ class StartupAPIEvent(BaseStartupAPIEvent):
35
35
  worker=OperationExecutorWorker(
36
36
  sqlalchemy_db=self.transmitted_api_data.sqlalchemy_db,
37
37
  operation_executor=OperationExecutor(sqlalchemy_db=self.transmitted_api_data.sqlalchemy_db),
38
- filter_operation_types=None,
39
- startup_funcs=[
40
- self.transmitted_api_data.sqlalchemy_db.init
41
- ]
38
+ filter_operation_types=None
42
39
  ),
43
40
  mode=SafeRunInBackgroundModes.thread
44
41
  )
@@ -48,10 +45,7 @@ class StartupAPIEvent(BaseStartupAPIEvent):
48
45
  _ = safe_run_worker_in_background(
49
46
  worker=ScheduledOperationCreatorWorker(
50
47
  sqlalchemy_db=self.transmitted_api_data.sqlalchemy_db,
51
- scheduled_operations=SCHEDULED_OPERATIONS,
52
- startup_funcs=[
53
- self.transmitted_api_data.sqlalchemy_db.init
54
- ]
48
+ scheduled_operations=SCHEDULED_OPERATIONS
55
49
  ),
56
50
  mode=SafeRunInBackgroundModes.async_task
57
51
  )
@@ -3,7 +3,7 @@ import uvicorn
3
3
  from src.core.settings import get_cached_settings
4
4
 
5
5
 
6
- def __command():
6
+ def __start_api_for_dev_with_reload():
7
7
  uvicorn.run(
8
8
  "src.api.asgi:app",
9
9
  port=get_cached_settings().api_port,
@@ -14,4 +14,4 @@ def __command():
14
14
 
15
15
 
16
16
  if __name__ == '__main__':
17
- __command()
17
+ __start_api_for_dev_with_reload()
@@ -3,7 +3,7 @@ import uvicorn
3
3
  from src.core.settings import get_cached_settings
4
4
 
5
5
 
6
- def __command():
6
+ def __start_api_for_dev_without_reload():
7
7
  uvicorn.run(
8
8
  "src.api.asgi:app",
9
9
  port=get_cached_settings().api_port,
@@ -14,4 +14,4 @@ def __command():
14
14
 
15
15
 
16
16
  if __name__ == '__main__':
17
- __command()
17
+ __start_api_for_dev_without_reload()
@@ -1,5 +1,7 @@
1
1
  import logging
2
2
 
3
+ from src.core.util import setup_logging
4
+
3
5
  _logger = logging.getLogger(__name__)
4
6
 
5
7
 
@@ -9,4 +11,5 @@ def hello_world() -> str:
9
11
 
10
12
 
11
13
  if __name__ == '__main__':
12
- print(hello_world())
14
+ setup_logging()
15
+ hello_world()
@@ -1,12 +1,10 @@
1
1
  from arpakitlib.ar_json_util import safely_transfer_obj_to_json_str
2
2
  from src.core.settings import get_cached_settings
3
- from src.core.util import setup_logging
4
3
 
5
4
 
6
- def command():
7
- setup_logging()
5
+ def __check_settings():
8
6
  print(safely_transfer_obj_to_json_str(get_cached_settings().model_dump(mode="json")))
9
7
 
10
8
 
11
9
  if __name__ == '__main__':
12
- command()
10
+ __check_settings()
@@ -3,14 +3,12 @@ import os.path
3
3
  from arpakitlib.ar_json_util import safely_transfer_obj_to_json_str
4
4
  from src.core.const import ProjectPaths
5
5
  from src.core.settings import Settings, get_cached_settings
6
- from src.core.util import setup_logging
7
6
 
8
7
 
9
- def command():
10
- setup_logging()
8
+ def __generate_settings_env_example():
11
9
  print(safely_transfer_obj_to_json_str(get_cached_settings().model_dump(mode="json")))
12
10
  Settings.save_env_example_to_file(filepath=os.path.join(ProjectPaths.base_dirpath, "example.env"))
13
11
 
14
12
 
15
13
  if __name__ == '__main__':
16
- command()
14
+ __generate_settings_env_example()
@@ -1,4 +1,3 @@
1
- import asyncio
2
1
  import os
3
2
  from functools import lru_cache
4
3
  from typing import Any
@@ -79,14 +78,5 @@ def get_cached_settings() -> Settings:
79
78
  return Settings()
80
79
 
81
80
 
82
- def __example():
83
- print(safely_transfer_obj_to_json_str(get_cached_settings().model_dump(mode="json")))
84
-
85
-
86
- async def __async_example():
87
- pass
88
-
89
-
90
81
  if __name__ == '__main__':
91
- __example()
92
- asyncio.run(__async_example())
82
+ print(safely_transfer_obj_to_json_str(get_cached_settings().model_dump(mode="json")))
@@ -2,10 +2,10 @@ from src.core.util import setup_logging
2
2
  from src.db.util import get_cached_sqlalchemy_db
3
3
 
4
4
 
5
- def command():
5
+ def __check_conn_sqlalchemy_db():
6
6
  setup_logging()
7
7
  get_cached_sqlalchemy_db().check_conn()
8
8
 
9
9
 
10
10
  if __name__ == '__main__':
11
- command()
11
+ __check_conn_sqlalchemy_db()
@@ -1,5 +1,4 @@
1
1
  from arpakitlib.ar_operation_execution_util import OperationExecutorWorker
2
- from src.core.settings import get_cached_settings
3
2
  from src.core.util import setup_logging
4
3
  from src.db.util import get_cached_sqlalchemy_db
5
4
  from src.operation_execution.operation_executor import OperationExecutor
@@ -7,7 +6,6 @@ from src.operation_execution.operation_executor import OperationExecutor
7
6
 
8
7
  def start_operation_executor_worker():
9
8
  setup_logging()
10
- get_cached_settings().raise_if_mode_type_prod()
11
9
  worker = OperationExecutorWorker(
12
10
  sqlalchemy_db=get_cached_sqlalchemy_db(),
13
11
  operation_executor=OperationExecutor(sqlalchemy_db=get_cached_sqlalchemy_db())
@@ -1,5 +1,4 @@
1
1
  from arpakitlib.ar_operation_execution_util import ScheduledOperationCreatorWorker
2
- from src.core.settings import get_cached_settings
3
2
  from src.core.util import setup_logging
4
3
  from src.db.util import get_cached_sqlalchemy_db
5
4
  from src.operation_execution.scheduled_operations import SCHEDULED_OPERATIONS
@@ -7,7 +6,6 @@ from src.operation_execution.scheduled_operations import SCHEDULED_OPERATIONS
7
6
 
8
7
  def start_scheduled_operation_creator_worker():
9
8
  setup_logging()
10
- get_cached_settings().raise_if_mode_type_prod()
11
9
  worker = ScheduledOperationCreatorWorker(
12
10
  sqlalchemy_db=get_cached_sqlalchemy_db(),
13
11
  scheduled_operations=SCHEDULED_OPERATIONS
@@ -84,6 +84,19 @@ def raise_if_not_none(v: Any) -> Any:
84
84
  return v
85
85
 
86
86
 
87
+ def get_setted_elements_as_dict_from_dict(d: dict) -> dict[str, Any]:
88
+ raise_for_type(d, dict)
89
+ setted_ = {}
90
+ for k, v in d.items():
91
+ if is_set(v):
92
+ setted_[k] = v
93
+ return setted_
94
+
95
+
96
+ def get_setted_keys_from_dict(d: dict) -> list[Any]:
97
+ return list(get_setted_elements_as_dict_from_dict(d).keys())
98
+
99
+
87
100
  def __example():
88
101
  print("is_set:")
89
102
  print(is_set(v=NotSet)) # False
@@ -138,6 +151,8 @@ def __example():
138
151
  except TypeError as e:
139
152
  print(e)
140
153
 
154
+ print(get_setted_elements_as_dict_from_dict({"afs": "ASfa", "asfasf": NotSet}))
155
+
141
156
 
142
157
  if __name__ == '__main__':
143
158
  __example()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: arpakitlib
3
- Version: 1.7.134
3
+ Version: 1.7.137
4
4
  Summary: arpakitlib
5
5
  License: Apache-2.0
6
6
  Keywords: arpakitlib,arpakit,arpakit-company,arpakitcompany,arpakit_company
@@ -3,7 +3,6 @@ arpakitlib/_arpakit_project_template/.gitignore,sha256=Q8n7q3-hKsnFVN5NcACPs71Z9
3
3
  arpakitlib/_arpakit_project_template/.python-version,sha256=XMd40XBnlTFfBSmMldd-7VdqXNyFCy6wtxhw5e1mnhc,7
4
4
  arpakitlib/_arpakit_project_template/ARPAKITLIB,sha256=3-iAkMXtesLzJXHw_IIv2k2M0oH8cTjHzW22Vvbi0IE,4
5
5
  arpakitlib/_arpakit_project_template/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
6
- arpakitlib/_arpakit_project_template/NOTICE,sha256=95aUzaPJjVpDsGAsNzVnq7tHTxAl0s5UFznCTkVCau4,763
7
6
  arpakitlib/_arpakit_project_template/README.md,sha256=AwqCtmMeywF2dJhZbKwCBA_wPnLF_VmoLGfPbFjH3bM,62
8
7
  arpakitlib/_arpakit_project_template/example.env,sha256=dJC2sjtywxm6ChP5jtIicGaaPvhI0NMNIhMmScg69b8,558
9
8
  arpakitlib/_arpakit_project_template/manage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -69,7 +68,7 @@ arpakitlib/_arpakit_project_template/src/api/asgi.py,sha256=a5UBxOyNC8NG3E0ayhiD
69
68
  arpakitlib/_arpakit_project_template/src/api/auth.py,sha256=dcvj5C9E2F2KCsGZPBBncQf_EvVJAC1qQgnyD8P4ZEw,6
70
69
  arpakitlib/_arpakit_project_template/src/api/const.py,sha256=7d4qD5hedqr7QxVzbfsA7E1bNZn2Pm2U8joXGtpANu0,287
71
70
  arpakitlib/_arpakit_project_template/src/api/create_api_app.py,sha256=5NJ50NqReuCTs-CH4_C_lcgpqKR9XuBONJOl2IRqOQI,2769
72
- arpakitlib/_arpakit_project_template/src/api/event.py,sha256=z3lNppog2x4a7phr4HmTQVWLt_LPI-357WeijbEeQRQ,3255
71
+ arpakitlib/_arpakit_project_template/src/api/event.py,sha256=Jd1eWUpPzGSg-wBIsCh1SNywemykQuXrf_6IlsoSO5w,2999
73
72
  arpakitlib/_arpakit_project_template/src/api/router/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
74
73
  arpakitlib/_arpakit_project_template/src/api/router/main_router.py,sha256=Yv699WCJDcdiJMXFg1kPTvolqj-NAGoXfqe-vzbMzIU,228
75
74
  arpakitlib/_arpakit_project_template/src/api/router/v1/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -79,21 +78,21 @@ arpakitlib/_arpakit_project_template/src/api/schema/__init__.py,sha256=47DEQpj8H
79
78
  arpakitlib/_arpakit_project_template/src/api/schema/v1/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
80
79
  arpakitlib/_arpakit_project_template/src/api/schema/v1/in_.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
81
80
  arpakitlib/_arpakit_project_template/src/api/schema/v1/out.py,sha256=odc-UyxBwUPh4t0H6qIuzAsBA_Qrm3H2qP-YBgJpaKc,164
82
- arpakitlib/_arpakit_project_template/src/api/start_api_for_dev_with_reload.py,sha256=H5J9k4j-pBiGlMHXYEYJQeQcanEpIBhv4r4SfiW3pSk,291
83
- arpakitlib/_arpakit_project_template/src/api/start_api_for_dev_without_reload.py,sha256=n30lbivzh1EJ8p8LY4YYlreQ14gfHWkU2zNxiwQ6ej4,292
81
+ arpakitlib/_arpakit_project_template/src/api/start_api_with_reload.py,sha256=iVJ8LSmY3ikzxml0cOuawmsJ8d_zkgf3c6apkrrOuRA,335
82
+ arpakitlib/_arpakit_project_template/src/api/start_api_without_reload.py,sha256=kHqVwznAbtgvsVmg3Y5rCzYcQ3KvF3hqJsTcmAAW_3Y,342
84
83
  arpakitlib/_arpakit_project_template/src/api/transmitted_api_data.py,sha256=fEWpfjnIrGluDrjgbsJwucQoiXKTP1cUYYORTFKdOJY,531
85
84
  arpakitlib/_arpakit_project_template/src/api/util.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
86
85
  arpakitlib/_arpakit_project_template/src/business_service/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
87
- arpakitlib/_arpakit_project_template/src/business_service/hello_world.py,sha256=pDCPv_1qC4yo3dKYt2kdz3GsiR53XDmYi1r7zzzj8co,193
86
+ arpakitlib/_arpakit_project_template/src/business_service/hello_world.py,sha256=mEVxsTFsd5u_T88l4mtCfoPre9QixAmQvzQmM2J8Okc,247
88
87
  arpakitlib/_arpakit_project_template/src/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
89
88
  arpakitlib/_arpakit_project_template/src/core/check_logging.py,sha256=TXAG-v7rH3uSSyCgraEX-3gbDs4J2MGGaBJb1P-xj18,227
90
- arpakitlib/_arpakit_project_template/src/core/check_settings.py,sha256=m0fTAAFET2n6iE_rrFrWEHgKuJOKbJfkNRpIGsE69qU,328
89
+ arpakitlib/_arpakit_project_template/src/core/check_settings.py,sha256=hiRDvMLdECHUawl5Z0aMbsVmHJZkp0TML_1sWAnQjXI,286
91
90
  arpakitlib/_arpakit_project_template/src/core/const.py,sha256=86zjRG3umtjQWYUMPKGaNwHnXM-WSOF-2l0A-Le51kI,1504
92
- arpakitlib/_arpakit_project_template/src/core/generate_settings_env_example.py,sha256=0EB_GTdwD0fk0Vl5pm3ZjH7Ot2u1lDmxA5btxvbcb4g,497
93
- arpakitlib/_arpakit_project_template/src/core/settings.py,sha256=PhxYn8WvGVVev5qXGJSxPuOstByVmcruviiN3llGN9U,2473
91
+ arpakitlib/_arpakit_project_template/src/core/generate_settings_env_example.py,sha256=VFxb3tV2eNfE93cn2rCIiLsRLx5eGgugnpak9OBKoro,485
92
+ arpakitlib/_arpakit_project_template/src/core/settings.py,sha256=Sie05LqTfxBOqnYz8trM3sAQdfYAJSQ2Xv4Xwt0aJbI,2348
94
93
  arpakitlib/_arpakit_project_template/src/core/util.py,sha256=5R8gvcZdvuDQes45FBnLC2IDv2Jhajp1VhJJYNKYjMQ,1539
95
94
  arpakitlib/_arpakit_project_template/src/db/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
96
- arpakitlib/_arpakit_project_template/src/db/check_conn_sqlalchemy_db.py,sha256=wv1N33nTGpsT9nk94OePlOSZ-O9UVKlMfRf8y5UeK1Y,213
95
+ arpakitlib/_arpakit_project_template/src/db/check_conn_sqlalchemy_db.py,sha256=urdfQQxAdHNka6nwkxv1YG8cMsRKr8U6ddDxU92eWh4,251
97
96
  arpakitlib/_arpakit_project_template/src/db/const.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
98
97
  arpakitlib/_arpakit_project_template/src/db/init_sqlalchemy_db.py,sha256=gxCQT1bcJ-8Qos-zL8PnQ58i2GX_QkQnQSsSBKYR1f0,233
99
98
  arpakitlib/_arpakit_project_template/src/db/reinit_sqlalchemy_db.py,sha256=WFcv3bt2AdSIwwhpkxzNsh09wpJCmuHux63fMt_iLTg,345
@@ -103,8 +102,8 @@ arpakitlib/_arpakit_project_template/src/operation_execution/__init__.py,sha256=
103
102
  arpakitlib/_arpakit_project_template/src/operation_execution/const.py,sha256=HjupGEDUWVijQlbzxZPI9vBbAVOETUYzYU9pdnc9IcI,176
104
103
  arpakitlib/_arpakit_project_template/src/operation_execution/operation_executor.py,sha256=TuAlF3QPJq-Zsq693NHQ00dvCWAzuwce2q6ozesWFYY,725
105
104
  arpakitlib/_arpakit_project_template/src/operation_execution/scheduled_operations.py,sha256=N6erGXOf_Qm3soPzuraMoc1jLXA6M1KfNsp0l4aAWBM,973
106
- arpakitlib/_arpakit_project_template/src/operation_execution/start_operation_executor_worker.py,sha256=QEGIuzSf6z_xDgGNzB6cMvqKhksuyOxZDjAOR56m05Y,675
107
- arpakitlib/_arpakit_project_template/src/operation_execution/start_scheduled_operation_creator_worker.py,sha256=GW1G8pi6yV_zODbqOs8VtEEM2e0iADFV6RXIxdPPPDY,677
105
+ arpakitlib/_arpakit_project_template/src/operation_execution/start_operation_executor_worker.py,sha256=PHGL98QK3OClsdNC2rQ37ghiSIvNpFKcMhk-LXs-Abc,573
106
+ arpakitlib/_arpakit_project_template/src/operation_execution/start_scheduled_operation_creator_worker.py,sha256=cvk3vciWYfeOPJJQiDh66WyiNXwA5vm2eGeUsqWo93k,575
108
107
  arpakitlib/_arpakit_project_template/src/operation_execution/util.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
109
108
  arpakitlib/_arpakit_project_template/src/test_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
110
109
  arpakitlib/_arpakit_project_template/src/test_data/make_test_data_1.py,sha256=3WVPgRsNCIxWpA-6t_Phe-nFULdHPhS1S_DO11XRmqk,80
@@ -179,12 +178,11 @@ arpakitlib/ar_sqlalchemy_model_util.py,sha256=nKJGN32eg3Gn5kmJwHdVJznPT5TydLsfUf
179
178
  arpakitlib/ar_sqlalchemy_util.py,sha256=Hcg1THrDsSR_-8dsY1CG3NWPEv0FqCbkPXFXLtjlSJ0,4207
180
179
  arpakitlib/ar_ssh_runner_util.py,sha256=e9deuUdBW7Eh0Exx2nTBhk57SaOZYaJaSjNk8q6dbJk,6804
181
180
  arpakitlib/ar_str_util.py,sha256=yU5gOwNXUQaH5b_tM5t6fXUn9oUcv5EQbVnq2wXXIpQ,3378
182
- arpakitlib/ar_type_util.py,sha256=BJ5FcS5Vkj9KFNJgoh0qGLazy-wCubqhND3vle0yOTo,3717
181
+ arpakitlib/ar_type_util.py,sha256=9C3ErtUVs0tAUqtK-foFzjJOykfBOntfCz2IogDOgfA,4134
183
182
  arpakitlib/ar_yookassa_api_client_util.py,sha256=sh4fcUkAkdOetFn9JYoTvjcSXP-M1wU04KEY-ECLfLg,5137
184
183
  arpakitlib/ar_zabbix_api_client_util.py,sha256=Q-VR4MvoZ9aHwZeYZr9G3LwN-ANx1T5KFmF6pvPM-9M,6402
185
- arpakitlib-1.7.134.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
186
- arpakitlib-1.7.134.dist-info/METADATA,sha256=LnYkdJgoyMlaXKHJxuKrlHfmzkOqlvmM08v3t341Ud0,3176
187
- arpakitlib-1.7.134.dist-info/NOTICE,sha256=95aUzaPJjVpDsGAsNzVnq7tHTxAl0s5UFznCTkVCau4,763
188
- arpakitlib-1.7.134.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
189
- arpakitlib-1.7.134.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
190
- arpakitlib-1.7.134.dist-info/RECORD,,
184
+ arpakitlib-1.7.137.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
185
+ arpakitlib-1.7.137.dist-info/METADATA,sha256=CG5xVEQzEGg2NRVwJCSYm5es8dKf3U2tT9ADOTwHlB0,3176
186
+ arpakitlib-1.7.137.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
187
+ arpakitlib-1.7.137.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
188
+ arpakitlib-1.7.137.dist-info/RECORD,,
@@ -1,16 +0,0 @@
1
- Copyright 2024-present Sabirzyanov Arsen
2
-
3
- This project includes software developed by Sabirzyanov Arsen.
4
-
5
- This project is licensed under the Apache License, Version 2.0 (the "License");
6
- you may not use this file except in compliance with the License.
7
- You may obtain a copy of the License at
8
-
9
- ./LICENSE
10
-
11
- Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and limitations under the License.
14
-
15
- Additional notices:
16
- - This project may include third-party components that are subject to other licenses. See the LICENSE file for more information.
@@ -1,16 +0,0 @@
1
- Copyright 2024-present Sabirzyanov Arsen
2
-
3
- This project includes software developed by Sabirzyanov Arsen.
4
-
5
- This project is licensed under the Apache License, Version 2.0 (the "License");
6
- you may not use this file except in compliance with the License.
7
- You may obtain a copy of the License at
8
-
9
- ./LICENSE
10
-
11
- Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and limitations under the License.
14
-
15
- Additional notices:
16
- - This project may include third-party components that are subject to other licenses. See the LICENSE file for more information.