arpakitlib 1.7.18__py3-none-any.whl → 1.7.20__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.
@@ -0,0 +1,2 @@
1
+ cd ..
2
+ docker ps -a
@@ -0,0 +1 @@
1
+ poetry run arpakitlib -c init_arpakit_project_template -project_dirpath ./ -overwrite_if_exists true -project_name ... -sql_db_port ... -api_port ... -ignore_paths_startswith /src -only_paths_startswith ...
@@ -1,7 +1,7 @@
1
1
  from fastapi import FastAPI
2
2
 
3
3
  from arpakitlib.ar_fastapi_util import create_fastapi_app, InitSqlalchemyDBStartupAPIEvent, InitFileStoragesInDir, \
4
- create_handle_exception, create_handle_exception_creating_story_log
4
+ create_handle_exception, create_handle_exception_creating_story_log, _DEFAULT_CONTACT
5
5
  from src.api.event import FirstStartupAPIEvent, FirstShutdownAPIEvent
6
6
  from src.api.router.v1.main_router import api_v1_main_router
7
7
  from src.api.transmitted_api_data import TransmittedAPIData
@@ -36,9 +36,9 @@ def create_api_app() -> FastAPI:
36
36
  FirstStartupAPIEvent(transmitted_api_data=transmitted_api_data),
37
37
  InitFileStoragesInDir(
38
38
  file_storages_in_dir=[
39
- get_cached_media_file_storage_in_dir(),
40
- get_cached_cache_file_storage_in_dir(),
41
- get_cached_dump_file_storage_in_dir()
39
+ get_cached_media_file_storage_in_dir() if settings.media_dirpath is not None else None,
40
+ get_cached_cache_file_storage_in_dir() if settings.cache_dirpath is not None else None,
41
+ get_cached_dump_file_storage_in_dir() if settings.dump_dirpath is not None else None
42
42
  ]
43
43
  ),
44
44
  (
@@ -51,6 +51,7 @@ def create_api_app() -> FastAPI:
51
51
  ],
52
52
  transmitted_api_data=transmitted_api_data,
53
53
  main_api_router=api_v1_main_router,
54
+ contact=_DEFAULT_CONTACT,
54
55
  media_dirpath=settings.media_dirpath
55
56
  )
56
57
 
@@ -10,25 +10,25 @@ from src.core.const import BASE_DIRPATH, ENV_FILEPATH
10
10
  class Settings(SimpleSettings):
11
11
  # ...
12
12
 
13
- var_dirname: str = "var"
13
+ var_dirname: str | None = "var"
14
14
 
15
- var_dirpath: str = os.path.join(BASE_DIRPATH, var_dirname)
15
+ var_dirpath: str | None = os.path.join(BASE_DIRPATH, var_dirname)
16
16
 
17
- log_filename: str = "story.log"
17
+ log_filename: str | None = "story.log"
18
18
 
19
- log_filepath: str = os.path.join(var_dirpath, log_filename)
19
+ log_filepath: str | None = os.path.join(var_dirpath, log_filename)
20
20
 
21
- cache_dirname: str = "cache"
21
+ cache_dirname: str | None = "cache"
22
22
 
23
- cache_dirpath: str = os.path.join(var_dirpath, cache_dirname)
23
+ cache_dirpath: str | None = os.path.join(var_dirpath, cache_dirname)
24
24
 
25
- media_dirname: str = "media"
25
+ media_dirname: str | None = "media"
26
26
 
27
- media_dirpath: str = os.path.join(var_dirpath, media_dirname)
27
+ media_dirpath: str | None = os.path.join(var_dirpath, media_dirname)
28
28
 
29
- dump_dirname: str = "dump"
29
+ dump_dirname: str | None = "dump"
30
30
 
31
- dump_dirpath: str = os.path.join(var_dirpath, dump_dirname)
31
+ dump_dirpath: str | None = os.path.join(var_dirpath, dump_dirname)
32
32
 
33
33
  sql_db_url: str | None = (
34
34
  "postgresql://{PROJECT_NAME}:{PROJECT_NAME}@127.0.0.1:{SQL_DB_PORT}/{PROJECT_NAME}"
@@ -29,11 +29,11 @@ class GenerateImageFromNumberResApiModel(BaseAPIModel):
29
29
  return filepath
30
30
 
31
31
 
32
- class DreamAIAPIClient:
32
+ class DREAMAIAPIClient:
33
33
  def __init__(
34
34
  self,
35
35
  *,
36
- base_url: str = "https://api.dream_ai.arpakit.com/api/v1",
36
+ base_url: str = "https://api.dreamai.arpakit.com/api/v1",
37
37
  api_key: str | None = "1"
38
38
  ):
39
39
  self._logger = logging.getLogger(__name__)
@@ -415,8 +415,9 @@ class SafeRunWorkerStartupAPIEvent(BaseStartupAPIEvent):
415
415
 
416
416
 
417
417
  class InitFileStoragesInDir(BaseStartupAPIEvent):
418
- def __init__(self, file_storages_in_dir: list[FileStorageInDir]):
418
+ def __init__(self, file_storages_in_dir: list[FileStorageInDir | None]):
419
419
  super().__init__()
420
+ file_storages_in_dir = [v for v in file_storages_in_dir if v is not None]
420
421
  self.file_storages_in_dir = file_storages_in_dir
421
422
 
422
423
  async def async_on_startup(self, *args, **kwargs):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: arpakitlib
3
- Version: 1.7.18
3
+ Version: 1.7.20
4
4
  Summary: arpakitlib
5
5
  Home-page: https://github.com/ARPAKIT-Company/arpakitlib
6
6
  License: Apache-2.0
@@ -14,11 +14,12 @@ arpakitlib/_arpakit_project_template/manage/check_logging.py,sha256=rfrl4MK5ItRK
14
14
  arpakitlib/_arpakit_project_template/manage/check_settings.py,sha256=JYR-IPgvYQOmJedKY9vOctbxEcUlaxZR-P0JXT9L2JQ,143
15
15
  arpakitlib/_arpakit_project_template/manage/check_sqlalchemy_db_conn.py,sha256=3Q4QfvFVBZsbMMH5yr6v3a6v6UjQuIEIujlxGpvykNA,190
16
16
  arpakitlib/_arpakit_project_template/manage/docker_ps.sh,sha256=uwm8vHgeuNLCOn0o9hgP_uc-PUkS9FwLyzZh6ItZ3do,15
17
+ arpakitlib/_arpakit_project_template/manage/docker_ps_a.sh,sha256=nOQejihYlzstg9oROvYwHIsSLt2Sw0DWQEeT3GBaBNs,18
17
18
  arpakitlib/_arpakit_project_template/manage/docker_run_postgres_for_dev.sh,sha256=EKytHfg5nDIen_QZhltfU7fHNJ68cSbM2ab13smKnTk,276
18
19
  arpakitlib/_arpakit_project_template/manage/docker_start_postgres_for_dev.sh,sha256=vY_NMqqZzYhrRMyZhZkJ5ppOJnzhpvHr82U3zTXJWPw,43
19
20
  arpakitlib/_arpakit_project_template/manage/docker_stop_postgres_for_dev.sh,sha256=Mlerpr5giJvpAtmYsudx-bYb4SuL1Hw7iF1Jv_b061k,41
20
- arpakitlib/_arpakit_project_template/manage/example_init_arpakit_project_template.sh,sha256=LeVtGUWhMXJuOQOS1HDtOfaU5SV757AENJ3u11oDHh8,193
21
21
  arpakitlib/_arpakit_project_template/manage/example_nginx_proxy.nginx,sha256=Ch4vCoa1QBdDpfRAz2tgOMO8Gw-6tgNyvOkte7A3MsA,326
22
+ arpakitlib/_arpakit_project_template/manage/example_poetry_arpakitlib.sh,sha256=ChcLbdsciCUlv_k-gp_1n70K80xc-ulKz4MXz-hXMqs,206
22
23
  arpakitlib/_arpakit_project_template/manage/example_systemd.service,sha256=Cunp3074ZKg1AQiX4Q_Xe5Q39Jca7hQj5ljXqryWwTU,143
23
24
  arpakitlib/_arpakit_project_template/manage/generate_env_example.py,sha256=pRTr6SzBJxDUaxTXZgLJr7rJawHyvpyTJbrJSZW0hEc,330
24
25
  arpakitlib/_arpakit_project_template/manage/git_commit.sh,sha256=AW1NEel-ZHaYeVWFlRbgZSYPQdnVKsTkpR_07RQL1Mw,42
@@ -70,7 +71,7 @@ arpakitlib/_arpakit_project_template/src/additional_model/__init__.py,sha256=47D
70
71
  arpakitlib/_arpakit_project_template/src/additional_model/additional_model.py,sha256=4KCOvto9Hj5eMYpvfaJChghhR9bkCvKluGGPWrTezoY,134
71
72
  arpakitlib/_arpakit_project_template/src/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
72
73
  arpakitlib/_arpakit_project_template/src/api/asgi.py,sha256=a5UBxOyNC8NG3E0ayhiDo3t5tPoB3WtOf2gbZJFWBAA,74
73
- arpakitlib/_arpakit_project_template/src/api/create_api_app.py,sha256=DbmisByJaT9HK5u0IwMVuA6pAM244LaWLZtrYMade78,2352
74
+ arpakitlib/_arpakit_project_template/src/api/create_api_app.py,sha256=_L_omEcICK1ti3J5kNZZ7FDJAM38mq_iB4XKorNp5wA,2547
74
75
  arpakitlib/_arpakit_project_template/src/api/event.py,sha256=h2UkOd_I643XiIe_xi5n2iSR2C5hy0Z8pGbbIwbJXe0,815
75
76
  arpakitlib/_arpakit_project_template/src/api/router/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
76
77
  arpakitlib/_arpakit_project_template/src/api/router/v1/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -86,7 +87,7 @@ arpakitlib/_arpakit_project_template/src/core/__init__.py,sha256=47DEQpj8HBSa-_T
86
87
  arpakitlib/_arpakit_project_template/src/core/const.py,sha256=CZZew674y7LhCAlYhvuF5cV4Zb9nQ17j2Tcuj2GEBf4,1232
87
88
  arpakitlib/_arpakit_project_template/src/core/operation_executor.py,sha256=oTz6gWnhfOUevjo44OK6lx4f4A9x5SuFJOUsuO-YzIo,591
88
89
  arpakitlib/_arpakit_project_template/src/core/scheduled_operations.py,sha256=W6ALtmW8oNuX0Y03Aqfgb4WlUWKtQetRgv1P3Lp6acE,324
89
- arpakitlib/_arpakit_project_template/src/core/settings.py,sha256=DbGqZUYnBJtRhy-nCI5BHaQOb4zKeVYMHZ1PVhba_9M,1385
90
+ arpakitlib/_arpakit_project_template/src/core/settings.py,sha256=ZgoNx6rw-h0QbhZ0Oeewgx-Z8pUdVywpnWSMCg9Ec0k,1455
90
91
  arpakitlib/_arpakit_project_template/src/core/util.py,sha256=I5Cxd-lXVMnpjMOyfoNcfOdL05xrujXBmYi5d91AjJg,1714
91
92
  arpakitlib/_arpakit_project_template/src/db/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
92
93
  arpakitlib/_arpakit_project_template/src/db/sqlalchemy_model.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -109,7 +110,7 @@ arpakitlib/ar_base_worker_util.py,sha256=fW7kzbo7gKFaF7-l7DnOGTVkt4H_BeHSkTHSoGQ
109
110
  arpakitlib/ar_cache_file_util.py,sha256=Fo2pH-Zqm966KWFBHG_pbiySGZvhIFCYqy7k1weRfJ0,3476
110
111
  arpakitlib/ar_datetime_util.py,sha256=Xe1NiT9oPQzNSG7RVRkhukhbg4i-hhS5ImmV7sPUc8o,971
111
112
  arpakitlib/ar_dict_util.py,sha256=cF5LQJ6tLqyGoEXfDljMDZrikeZoWPw7CgINHIFGvXM,419
112
- arpakitlib/ar_dream_ai_api_client_util.py,sha256=sn-eGYZ_3PRr3jrzpBs8xFB8DMEkq_0R2G0GYCp8Npc,2819
113
+ arpakitlib/ar_dream_ai_api_client_util.py,sha256=QF9XK7xK5ny1fvkcG4e0pfCySNNFRNPy0x0cmxfsAak,2818
113
114
  arpakitlib/ar_encrypt_decrypt_util.py,sha256=GhWnp7HHkbhwFVVCzO1H07m-5gryr4yjWsXjOaNQm1Y,520
114
115
  arpakitlib/ar_enumeration_util.py,sha256=0DN46uyI0Gu9JPDgso3XPbnre7hZZefYTZwmmE1iYH4,2250
115
116
  arpakitlib/ar_fastapi_static/redoc/redoc.standalone.js,sha256=WCuodUNv1qVh0oW5fjnJDwb5AwOue73jKHdI9z8iGKU,909365
@@ -131,7 +132,7 @@ arpakitlib/ar_fastapi_static/swagger-ui/swagger-ui.css,sha256=jzPZlgJTFwSdSphk9C
131
132
  arpakitlib/ar_fastapi_static/swagger-ui/swagger-ui.css.map,sha256=5wq8eXMLU6Zxb45orZPL1zAsBFJReFw6GjYqGpUX3hg,262650
132
133
  arpakitlib/ar_fastapi_static/swagger-ui/swagger-ui.js,sha256=ffrLZHHEQ_g84A-ul3yWa10Kk09waOAxHcQXPuZuavg,339292
133
134
  arpakitlib/ar_fastapi_static/swagger-ui/swagger-ui.js.map,sha256=9UhIW7MqCOZPAz1Sl1IKfZUuhWU0p-LJqrnjjJD9Xhc,1159454
134
- arpakitlib/ar_fastapi_util.py,sha256=xzevlyT-kyEO9L_jQ41l5MlIvEwH1dsCjJOYeHFcWU8,22201
135
+ arpakitlib/ar_fastapi_util.py,sha256=kkbSTwau-fNbwSNUJsBTVANb8M69A9wkE2iYJxiZNKs,22290
135
136
  arpakitlib/ar_file_storage_in_dir_util.py,sha256=D3e3rGuHoI6xqAA5mVvEpVVpOWY1jyjNsjj2UhyHRbE,3674
136
137
  arpakitlib/ar_file_util.py,sha256=XiwmeycxoLqtYnGOu5q6IEaJJXilZvtLvsKDKtwqSLY,137
137
138
  arpakitlib/ar_hash_util.py,sha256=Iqy6KBAOLBQMFLWv676boI5sV7atT2B-fb7aCdHOmIQ,340
@@ -160,9 +161,9 @@ arpakitlib/ar_str_util.py,sha256=oCEtQ_TTn35OEz9jCNLjbhopq76JmaifD_iYR-nEJJ4,214
160
161
  arpakitlib/ar_type_util.py,sha256=GNc9PgFKonj5lRlAHSnVPBN5nLIslrG8GTiZHjkf05w,2138
161
162
  arpakitlib/ar_yookassa_api_client_util.py,sha256=sh4fcUkAkdOetFn9JYoTvjcSXP-M1wU04KEY-ECLfLg,5137
162
163
  arpakitlib/ar_zabbix_api_client_util.py,sha256=Q-VR4MvoZ9aHwZeYZr9G3LwN-ANx1T5KFmF6pvPM-9M,6402
163
- arpakitlib-1.7.18.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
164
- arpakitlib-1.7.18.dist-info/METADATA,sha256=hmOyGhWvu5hGkkWcrv7pEVAADBLnBBzZRrw6N2m7WWQ,2824
165
- arpakitlib-1.7.18.dist-info/NOTICE,sha256=95aUzaPJjVpDsGAsNzVnq7tHTxAl0s5UFznCTkVCau4,763
166
- arpakitlib-1.7.18.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
167
- arpakitlib-1.7.18.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
168
- arpakitlib-1.7.18.dist-info/RECORD,,
164
+ arpakitlib-1.7.20.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
165
+ arpakitlib-1.7.20.dist-info/METADATA,sha256=g3WRcpW97nJVJzfb1uS5ypPr4hoUVjfU3Cgs93HsRow,2824
166
+ arpakitlib-1.7.20.dist-info/NOTICE,sha256=95aUzaPJjVpDsGAsNzVnq7tHTxAl0s5UFznCTkVCau4,763
167
+ arpakitlib-1.7.20.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
168
+ arpakitlib-1.7.20.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
169
+ arpakitlib-1.7.20.dist-info/RECORD,,
@@ -1 +0,0 @@
1
- arpakitlib -c init_arpakit_project_template -project_dirpath ./ -overwrite_if_exists ... -project_name ... -sql_db_port ... -api_port ... -ignore_paths_startswith ... -only_paths_startswith ...