arpakitlib 1.7.131__py3-none-any.whl → 1.7.133__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/example.env +1 -0
- arpakitlib/_arpakit_project_template/src/api/create_api_app.py +2 -2
- arpakitlib/_arpakit_project_template/src/core/const.py +24 -25
- arpakitlib/_arpakit_project_template/src/core/generate_settings_env_example.py +2 -2
- arpakitlib/_arpakit_project_template/src/core/settings.py +6 -6
- {arpakitlib-1.7.131.dist-info → arpakitlib-1.7.133.dist-info}/METADATA +1 -1
- {arpakitlib-1.7.131.dist-info → arpakitlib-1.7.133.dist-info}/RECORD +11 -11
- {arpakitlib-1.7.131.dist-info → arpakitlib-1.7.133.dist-info}/LICENSE +0 -0
- {arpakitlib-1.7.131.dist-info → arpakitlib-1.7.133.dist-info}/NOTICE +0 -0
- {arpakitlib-1.7.131.dist-info → arpakitlib-1.7.133.dist-info}/WHEEL +0 -0
- {arpakitlib-1.7.131.dist-info → arpakitlib-1.7.133.dist-info}/entry_points.txt +0 -0
@@ -7,7 +7,7 @@ from arpakitlib.ar_type_util import raise_for_type
|
|
7
7
|
from src.api.event import StartupAPIEvent, ShutdownAPIEvent
|
8
8
|
from src.api.router.main_router import main_api_router
|
9
9
|
from src.api.transmitted_api_data import TransmittedAPIData
|
10
|
-
from src.core.const import
|
10
|
+
from src.core.const import ProjectPaths
|
11
11
|
from src.core.settings import get_cached_settings
|
12
12
|
from src.core.util import setup_logging, get_cached_media_file_storage_in_dir, get_cached_cache_file_storage_in_dir, \
|
13
13
|
get_cached_dump_file_storage_in_dir
|
@@ -63,7 +63,7 @@ def create_api_app() -> FastAPI:
|
|
63
63
|
transmitted_api_data=transmitted_api_data,
|
64
64
|
main_api_router=main_api_router,
|
65
65
|
media_dirpath=settings.media_dirpath,
|
66
|
-
static_dirpath=
|
66
|
+
static_dirpath=ProjectPaths.static_dirpath
|
67
67
|
)
|
68
68
|
|
69
69
|
if settings.api_enable_admin1:
|
@@ -2,41 +2,40 @@ import asyncio
|
|
2
2
|
import os
|
3
3
|
import pathlib
|
4
4
|
|
5
|
-
|
5
|
+
from arpakitlib.ar_enumeration_util import Enumeration
|
6
6
|
|
7
|
-
ENV_FILENAME: str = ".env"
|
8
7
|
|
9
|
-
|
8
|
+
class ProjectPaths(Enumeration):
|
9
|
+
base_dirpath: str = str(pathlib.Path(__file__).parent.parent.parent)
|
10
10
|
|
11
|
-
|
11
|
+
env_filename: str = ".env"
|
12
|
+
env_filepath: str = os.path.join(base_dirpath, env_filename)
|
12
13
|
|
13
|
-
|
14
|
+
src_dirname: str = "src"
|
15
|
+
src_dirpath: str = os.path.join(base_dirpath, src_dirname)
|
14
16
|
|
15
|
-
|
17
|
+
manage_dirname: str = "manage"
|
18
|
+
manage_dirpath: str = os.path.join(base_dirpath, manage_dirname)
|
16
19
|
|
17
|
-
|
20
|
+
resource_dirname: str = "resource"
|
21
|
+
resource_dirpath: str = os.path.join(base_dirpath, resource_dirname)
|
18
22
|
|
19
|
-
|
20
|
-
|
21
|
-
RESOURCE_DIRPATH: str = os.path.join(BASE_DIRPATH, RESOURCE_DIRNAME)
|
22
|
-
|
23
|
-
STATIC_DIRNAME: str = "static"
|
24
|
-
|
25
|
-
STATIC_DIRPATH: str = os.path.join(RESOURCE_DIRPATH, STATIC_DIRNAME)
|
23
|
+
static_dirname: str = "static"
|
24
|
+
static_dirpath: str = os.path.join(resource_dirpath, static_dirname)
|
26
25
|
|
27
26
|
|
28
27
|
def __example():
|
29
|
-
print(f"
|
30
|
-
print(f"
|
31
|
-
print(f"
|
32
|
-
print(f"
|
33
|
-
print(f"
|
34
|
-
print(f"
|
35
|
-
print(f"
|
36
|
-
print(f"
|
37
|
-
print(f"
|
38
|
-
print(f"
|
39
|
-
print(f"
|
28
|
+
print(f"base_dirpath: {ProjectPaths.base_dirpath}")
|
29
|
+
print(f"env_filename: {ProjectPaths.env_filename}")
|
30
|
+
print(f"env_filepath: {ProjectPaths.env_filepath}")
|
31
|
+
print(f"src_dirname: {ProjectPaths.src_dirname}")
|
32
|
+
print(f"src_dirpath: {ProjectPaths.src_dirpath}")
|
33
|
+
print(f"manage_dirname: {ProjectPaths.manage_dirname}")
|
34
|
+
print(f"manage_dirpath: {ProjectPaths.manage_dirpath}")
|
35
|
+
print(f"resource_dirname: {ProjectPaths.resource_dirname}")
|
36
|
+
print(f"resource_dirpath: {ProjectPaths.resource_dirpath}")
|
37
|
+
print(f"static_dirname: {ProjectPaths.static_dirname}")
|
38
|
+
print(f"static_dirpath: {ProjectPaths.static_dirpath}")
|
40
39
|
|
41
40
|
|
42
41
|
async def __async_example():
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import os.path
|
2
2
|
|
3
3
|
from arpakitlib.ar_json_util import safely_transfer_obj_to_json_str
|
4
|
-
from src.core.const import
|
4
|
+
from src.core.const import ProjectPaths
|
5
5
|
from src.core.settings import Settings, get_cached_settings
|
6
6
|
from src.core.util import setup_logging
|
7
7
|
|
@@ -9,7 +9,7 @@ from src.core.util import setup_logging
|
|
9
9
|
def command():
|
10
10
|
setup_logging()
|
11
11
|
print(safely_transfer_obj_to_json_str(get_cached_settings().model_dump(mode="json")))
|
12
|
-
Settings.save_env_example_to_file(filepath=os.path.join(
|
12
|
+
Settings.save_env_example_to_file(filepath=os.path.join(ProjectPaths.base_dirpath, "example.env"))
|
13
13
|
|
14
14
|
|
15
15
|
if __name__ == '__main__':
|
@@ -7,13 +7,13 @@ import pytz
|
|
7
7
|
|
8
8
|
from arpakitlib.ar_json_util import safely_transfer_obj_to_json_str
|
9
9
|
from arpakitlib.ar_settings_util import SimpleSettings
|
10
|
-
from src.core.const import
|
10
|
+
from src.core.const import ProjectPaths
|
11
11
|
|
12
12
|
|
13
13
|
class Settings(SimpleSettings):
|
14
14
|
project_name: str = "{{PROJECT_NAME}}"
|
15
15
|
|
16
|
-
sql_db_port: int | None = int("{{SQL_DB_PORT}}") if "{{SQL_DB_PORT}}".strip() else None
|
16
|
+
sql_db_port: int | None = int("{{SQL_DB_PORT}}") if "{{SQL_DB_PORT}}".strip().isdigit() else None
|
17
17
|
|
18
18
|
sql_db_url: str | None = (
|
19
19
|
f"postgresql://{{PROJECT_NAME}}:{{PROJECT_NAME}}@127.0.0.1:{sql_db_port}/{{PROJECT_NAME}}"
|
@@ -33,7 +33,7 @@ class Settings(SimpleSettings):
|
|
33
33
|
|
34
34
|
api_start_scheduled_operation_creator_worker: bool = False
|
35
35
|
|
36
|
-
api_port: int | None = int("{{API_PORT}}") if "{{API_PORT}}".strip() else None
|
36
|
+
api_port: int | None = int("{{API_PORT}}") if "{{API_PORT}}".strip().isdigit() else None
|
37
37
|
|
38
38
|
api_correct_api_key: str | None = "1"
|
39
39
|
|
@@ -43,7 +43,7 @@ class Settings(SimpleSettings):
|
|
43
43
|
|
44
44
|
var_dirname: str | None = "var"
|
45
45
|
|
46
|
-
var_dirpath: str | None = os.path.join(
|
46
|
+
var_dirpath: str | None = os.path.join(ProjectPaths.base_dirpath, var_dirname)
|
47
47
|
|
48
48
|
log_filename: str | None = "story.log"
|
49
49
|
|
@@ -74,8 +74,8 @@ class Settings(SimpleSettings):
|
|
74
74
|
|
75
75
|
@lru_cache()
|
76
76
|
def get_cached_settings() -> Settings:
|
77
|
-
if os.path.exists(
|
78
|
-
return Settings(_env_file=
|
77
|
+
if os.path.exists(ProjectPaths.env_filepath):
|
78
|
+
return Settings(_env_file=ProjectPaths.env_filepath, _env_file_encoding="utf-8")
|
79
79
|
return Settings()
|
80
80
|
|
81
81
|
|
@@ -5,7 +5,7 @@ arpakitlib/_arpakit_project_template/ARPAKITLIB,sha256=3-iAkMXtesLzJXHw_IIv2k2M0
|
|
5
5
|
arpakitlib/_arpakit_project_template/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
|
6
6
|
arpakitlib/_arpakit_project_template/NOTICE,sha256=95aUzaPJjVpDsGAsNzVnq7tHTxAl0s5UFznCTkVCau4,763
|
7
7
|
arpakitlib/_arpakit_project_template/README.md,sha256=AwqCtmMeywF2dJhZbKwCBA_wPnLF_VmoLGfPbFjH3bM,62
|
8
|
-
arpakitlib/_arpakit_project_template/example.env,sha256=
|
8
|
+
arpakitlib/_arpakit_project_template/example.env,sha256=dJC2sjtywxm6ChP5jtIicGaaPvhI0NMNIhMmScg69b8,558
|
9
9
|
arpakitlib/_arpakit_project_template/manage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
10
|
arpakitlib/_arpakit_project_template/manage/docker_ps.sh,sha256=uwm8vHgeuNLCOn0o9hgP_uc-PUkS9FwLyzZh6ItZ3do,15
|
11
11
|
arpakitlib/_arpakit_project_template/manage/docker_ps_a.sh,sha256=nOQejihYlzstg9oROvYwHIsSLt2Sw0DWQEeT3GBaBNs,18
|
@@ -69,7 +69,7 @@ arpakitlib/_arpakit_project_template/src/api/__init__.py,sha256=47DEQpj8HBSa-_TI
|
|
69
69
|
arpakitlib/_arpakit_project_template/src/api/asgi.py,sha256=a5UBxOyNC8NG3E0ayhiDo3t5tPoB3WtOf2gbZJFWBAA,74
|
70
70
|
arpakitlib/_arpakit_project_template/src/api/auth.py,sha256=dcvj5C9E2F2KCsGZPBBncQf_EvVJAC1qQgnyD8P4ZEw,6
|
71
71
|
arpakitlib/_arpakit_project_template/src/api/const.py,sha256=7d4qD5hedqr7QxVzbfsA7E1bNZn2Pm2U8joXGtpANu0,287
|
72
|
-
arpakitlib/_arpakit_project_template/src/api/create_api_app.py,sha256=
|
72
|
+
arpakitlib/_arpakit_project_template/src/api/create_api_app.py,sha256=5NJ50NqReuCTs-CH4_C_lcgpqKR9XuBONJOl2IRqOQI,2769
|
73
73
|
arpakitlib/_arpakit_project_template/src/api/event.py,sha256=z3lNppog2x4a7phr4HmTQVWLt_LPI-357WeijbEeQRQ,3255
|
74
74
|
arpakitlib/_arpakit_project_template/src/api/router/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
75
75
|
arpakitlib/_arpakit_project_template/src/api/router/main_router.py,sha256=Yv699WCJDcdiJMXFg1kPTvolqj-NAGoXfqe-vzbMzIU,228
|
@@ -89,9 +89,9 @@ arpakitlib/_arpakit_project_template/src/business_service/hello_world.py,sha256=
|
|
89
89
|
arpakitlib/_arpakit_project_template/src/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
90
90
|
arpakitlib/_arpakit_project_template/src/core/check_logging.py,sha256=TXAG-v7rH3uSSyCgraEX-3gbDs4J2MGGaBJb1P-xj18,227
|
91
91
|
arpakitlib/_arpakit_project_template/src/core/check_settings.py,sha256=m0fTAAFET2n6iE_rrFrWEHgKuJOKbJfkNRpIGsE69qU,328
|
92
|
-
arpakitlib/_arpakit_project_template/src/core/const.py,sha256=
|
93
|
-
arpakitlib/_arpakit_project_template/src/core/generate_settings_env_example.py,sha256=
|
94
|
-
arpakitlib/_arpakit_project_template/src/core/settings.py,sha256=
|
92
|
+
arpakitlib/_arpakit_project_template/src/core/const.py,sha256=86zjRG3umtjQWYUMPKGaNwHnXM-WSOF-2l0A-Le51kI,1504
|
93
|
+
arpakitlib/_arpakit_project_template/src/core/generate_settings_env_example.py,sha256=0EB_GTdwD0fk0Vl5pm3ZjH7Ot2u1lDmxA5btxvbcb4g,497
|
94
|
+
arpakitlib/_arpakit_project_template/src/core/settings.py,sha256=PhxYn8WvGVVev5qXGJSxPuOstByVmcruviiN3llGN9U,2473
|
95
95
|
arpakitlib/_arpakit_project_template/src/core/util.py,sha256=5R8gvcZdvuDQes45FBnLC2IDv2Jhajp1VhJJYNKYjMQ,1539
|
96
96
|
arpakitlib/_arpakit_project_template/src/db/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
97
97
|
arpakitlib/_arpakit_project_template/src/db/check_conn_sqlalchemy_db.py,sha256=wv1N33nTGpsT9nk94OePlOSZ-O9UVKlMfRf8y5UeK1Y,213
|
@@ -183,9 +183,9 @@ arpakitlib/ar_str_util.py,sha256=yU5gOwNXUQaH5b_tM5t6fXUn9oUcv5EQbVnq2wXXIpQ,337
|
|
183
183
|
arpakitlib/ar_type_util.py,sha256=BJ5FcS5Vkj9KFNJgoh0qGLazy-wCubqhND3vle0yOTo,3717
|
184
184
|
arpakitlib/ar_yookassa_api_client_util.py,sha256=sh4fcUkAkdOetFn9JYoTvjcSXP-M1wU04KEY-ECLfLg,5137
|
185
185
|
arpakitlib/ar_zabbix_api_client_util.py,sha256=Q-VR4MvoZ9aHwZeYZr9G3LwN-ANx1T5KFmF6pvPM-9M,6402
|
186
|
-
arpakitlib-1.7.
|
187
|
-
arpakitlib-1.7.
|
188
|
-
arpakitlib-1.7.
|
189
|
-
arpakitlib-1.7.
|
190
|
-
arpakitlib-1.7.
|
191
|
-
arpakitlib-1.7.
|
186
|
+
arpakitlib-1.7.133.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
|
187
|
+
arpakitlib-1.7.133.dist-info/METADATA,sha256=WBe4s7OEA_uOGC6DQKPyGS6p_lhm0-36f3flzT_Gl_I,3176
|
188
|
+
arpakitlib-1.7.133.dist-info/NOTICE,sha256=95aUzaPJjVpDsGAsNzVnq7tHTxAl0s5UFznCTkVCau4,763
|
189
|
+
arpakitlib-1.7.133.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
190
|
+
arpakitlib-1.7.133.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
|
191
|
+
arpakitlib-1.7.133.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|