arpakitlib 1.8.114__py3-none-any.whl → 1.8.134__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.
@@ -3,4 +3,3 @@
3
3
  ## ❤️ Made by ARPAKIT Company ❤️
4
4
 
5
5
  - https://arpakit.com/
6
-
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "arpakitlib_project_template_version": "5",
3
- "arpakitlib_project_template_subversion": "27"
3
+ "arpakitlib_project_template_subversion": "28"
4
4
  }
@@ -25,6 +25,7 @@ def create_api_app(*, prefix: str = "/api") -> FastAPI:
25
25
  api_app = FastAPI(
26
26
  title=get_cached_settings().project_name,
27
27
  description=get_cached_settings().project_name,
28
+ version=get_cached_settings().api_version,
28
29
  docs_url=None,
29
30
  redoc_url=None,
30
31
  openapi_url="/openapi",
@@ -42,7 +42,7 @@ async def async_startup_api_event():
42
42
  ):
43
43
  get_cached_json_db().init()
44
44
 
45
- if get_cached_sqlalchemy_db() is not None:
45
+ if get_cached_sqlalchemy_db() is not None and get_cached_settings().api_create_first_data:
46
46
  create_first_data_for_api()
47
47
 
48
48
  if get_cached_settings().api_start_operation_executor_worker:
@@ -104,6 +104,10 @@ class Settings(SimpleSettings):
104
104
 
105
105
  api_start_scheduled_operation_creator_worker: bool = False
106
106
 
107
+ api_version: str = "0.0.1"
108
+
109
+ api_create_first_data: bool = True
110
+
107
111
  sqladmin_secret_key: str | None = "85a9583cb91c4de7a78d7eb1e5306a04418c9c43014c447ea8ec8dd5deb4cf71"
108
112
 
109
113
  sqladmin_authorize_keys: list[str] | None = ["1"]
@@ -0,0 +1,41 @@
1
+ import asyncio
2
+
3
+ from project.core.jinja2_templates import get_cached_jinja2_templates
4
+ from project.core.util import setup_logging
5
+ from project.emailer.send_email import async_send_email
6
+
7
+
8
+ async def async_send_simple_email(
9
+ *,
10
+ to_email: str,
11
+ project_name: str,
12
+ title: str,
13
+ text: str
14
+ ):
15
+ render_data = {
16
+ "title": title,
17
+ "project_name": project_name,
18
+ "text": text
19
+ }
20
+
21
+ html_content = get_cached_jinja2_templates().get_template("simple_email.html").render(render_data)
22
+
23
+ await async_send_email(
24
+ to_email=to_email,
25
+ subject=title,
26
+ html_content=html_content
27
+ )
28
+
29
+
30
+ async def __async_example():
31
+ setup_logging()
32
+ await async_send_simple_email(
33
+ to_email="arpakit@gmail.com",
34
+ title="Notification",
35
+ project_name="Test",
36
+ text="asfasf"
37
+ )
38
+
39
+
40
+ if __name__ == '__main__':
41
+ asyncio.run(__async_example())
@@ -0,0 +1,47 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>{{ title }}</title>
6
+ <style>
7
+ body {
8
+ font-family: Arial, sans-serif;
9
+ background-color: #f4f4f4;
10
+ margin: 0;
11
+ padding: 0;
12
+ }
13
+ .container {
14
+ background-color: #ffffff;
15
+ width: 90%;
16
+ max-width: 600px;
17
+ margin: 30px auto;
18
+ padding: 20px;
19
+ border-radius: 8px;
20
+ box-shadow: 0 2px 5px rgba(0,0,0,0.1);
21
+ }
22
+ .header {
23
+ border-bottom: 1px solid #dddddd;
24
+ padding-bottom: 10px;
25
+ margin-bottom: 20px;
26
+ }
27
+ .footer {
28
+ margin-top: 30px;
29
+ font-size: 12px;
30
+ color: #777777;
31
+ text-align: center;
32
+ }
33
+ </style>
34
+ </head>
35
+ <body>
36
+ <div class="container">
37
+ <div class="header">
38
+ <h2>{{ project_name }}</h2>
39
+ </div>
40
+ <h3>{{ title }}</h3>
41
+ <p>{{ text }}</p>
42
+ <div class="footer">
43
+ &copy; {{ project_name }} — Все права защищены.
44
+ </div>
45
+ </div>
46
+ </body>
47
+ </html>
@@ -1,4 +1,5 @@
1
1
  import sqlalchemy
2
+ from sqladmin.fields import SelectField
2
3
 
3
4
  from project.sqladmin_.model_view.common import SimpleMV
4
5
  from project.sqladmin_.util.etc import format_datetime_, format_json_for_preview_, format_json_
@@ -36,6 +37,20 @@ class StoryLogMV(SimpleMV, model=StoryLogDBM):
36
37
  StoryLogDBM.title,
37
38
  StoryLogDBM.extra_data
38
39
  ]
40
+ form_overrides = {
41
+ StoryLogDBM.level.key: SelectField,
42
+ StoryLogDBM.type.key: SelectField,
43
+ }
44
+ form_args = {
45
+ StoryLogDBM.level.key: {
46
+ "choices": [(level, level) for level in StoryLogDBM.Levels.values_list()],
47
+ "description": "Choose level"
48
+ },
49
+ StoryLogDBM.type.key: {
50
+ "choices": [(level, level) for level in StoryLogDBM.Types.values_list()],
51
+ "description": "Choose type"
52
+ }
53
+ }
39
54
  column_sortable_list = sqlalchemy.inspect(StoryLogDBM).columns
40
55
  column_default_sort = [
41
56
  (StoryLogDBM.creation_dt, True)
@@ -0,0 +1,22 @@
1
+ import logging
2
+
3
+ import aiogram.filters
4
+ from aiogram import Router
5
+ from aiogram.fsm.context import FSMContext
6
+
7
+ from project.tg_bot.blank.client import get_cached_rus_client_tg_bot_blank
8
+ from project.tg_bot.middleware.common import MiddlewareDataTgBot
9
+
10
+ tg_bot_router = Router()
11
+ _logger = logging.getLogger(__name__)
12
+
13
+
14
+ @tg_bot_router.message(aiogram.F.content_type == aiogram.enums.ContentType.VOICE)
15
+ async def _(
16
+ m: aiogram.types.Message,
17
+ state: FSMContext,
18
+ middleware_data_tg_bot: MiddlewareDataTgBot,
19
+ **kwargs
20
+ ):
21
+ await state.clear()
22
+ await m.answer(text=get_cached_rus_client_tg_bot_blank().raw_message())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: arpakitlib
3
- Version: 1.8.114
3
+ Version: 1.8.134
4
4
  Summary: arpakitlib
5
5
  License: Apache-2.0
6
6
  Keywords: arpakitlib,arpakit,arpakit-company,arpakitcompany,arpakit_company
@@ -112,3 +112,4 @@ poetry run arpakitlib -c init_arpakit_project_template -version 5 -project_dirpa
112
112
  ## ❤️ Made by ARPAKIT Company ❤️
113
113
 
114
114
 
115
+
@@ -2,13 +2,13 @@ arpakitlib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  arpakitlib/_arpakit_project_template_v_5/.gitignore,sha256=CkYXH39ozlcyJzfK4X6QUS4tdmzxRQo5Q98Xi1r6tY0,771
3
3
  arpakitlib/_arpakit_project_template_v_5/.python-version,sha256=XMd40XBnlTFfBSmMldd-7VdqXNyFCy6wtxhw5e1mnhc,7
4
4
  arpakitlib/_arpakit_project_template_v_5/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
5
- arpakitlib/_arpakit_project_template_v_5/README.md,sha256=5j09oFYEojGB7X5j0vXoic2zsWcKq5iEwoR6xoiYQnw,77
5
+ arpakitlib/_arpakit_project_template_v_5/README.md,sha256=2CHtfipOE4RFBzOpmnaHl7eZg2tur5_T8YHD4qrh5vQ,76
6
6
  arpakitlib/_arpakit_project_template_v_5/alembic/README,sha256=MVlc9TYmr57RbhXET6QxgyCcwWP7w-vLkEsirENqiIQ,38
7
7
  arpakitlib/_arpakit_project_template_v_5/alembic/env.py,sha256=Qesmnj5A2kB-Doeuf6Xu-2Mrhm1rByH0HPwP8UK6lH4,2453
8
8
  arpakitlib/_arpakit_project_template_v_5/alembic/script.py.mako,sha256=MEqL-2qATlST9TAOeYgscMn1uy6HUS9NFvDgl93dMj8,635
9
9
  arpakitlib/_arpakit_project_template_v_5/alembic/versions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  arpakitlib/_arpakit_project_template_v_5/alembic.ini,sha256=8fuyeEvGBiPGbxEFy8ISBV3xX_fgVmuhEGpB10_B5Uo,3733
11
- arpakitlib/_arpakit_project_template_v_5/arpakitlib_project_template_info.json,sha256=R-BkDM1StRfEarU7UEwPZaxaGv7vHvTAGteM3_evSUQ,98
11
+ arpakitlib/_arpakit_project_template_v_5/arpakitlib_project_template_info.json,sha256=6PtbTXsm-pdcR9IJQNzMRYYSsqbszuLu_bUTja1y0PE,98
12
12
  arpakitlib/_arpakit_project_template_v_5/command/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  arpakitlib/_arpakit_project_template_v_5/command/alembic_history.sh,sha256=OMnDNtHIksGh9iavWnzbtxcudZW4vjdcISsBXvzZSPw,22
14
14
  arpakitlib/_arpakit_project_template_v_5/command/alembic_revision_autogenerate.sh,sha256=yW2i-SBOtBx15Ya0poVQqKkJM5t2JZp06r9AEW-DmGE,46
@@ -88,9 +88,9 @@ arpakitlib/_arpakit_project_template_v_5/project/api/blank/admin.py,sha256=ii1zL
88
88
  arpakitlib/_arpakit_project_template_v_5/project/api/blank/client.py,sha256=rvJKtAB26Qy2pKVSHSMUM_70oI4v8Yr6Vmpr6r4EzNk,101
89
89
  arpakitlib/_arpakit_project_template_v_5/project/api/blank/common.py,sha256=ug1FylE_CVC5eij-u4nh-IHNO-gwkbBGo5KgyWDujC8,91
90
90
  arpakitlib/_arpakit_project_template_v_5/project/api/const.py,sha256=J9bqaRRiIc3RLn6SJTvdfDvFrSsM_Ixii9t2M8dA5Jc,433
91
- arpakitlib/_arpakit_project_template_v_5/project/api/create_api_app.py,sha256=fRYjpKEB5pMpFtWEhUe84mVvaFBKQ2WU5BTwCpb0J2Y,2861
91
+ arpakitlib/_arpakit_project_template_v_5/project/api/create_api_app.py,sha256=-04wCrUWh2ceFijMM8XFHJHLjOvmRcETbedidc4_IAc,2912
92
92
  arpakitlib/_arpakit_project_template_v_5/project/api/create_first_data.py,sha256=sc98-xW74QbhFCT6AW5-fUJVd8RLRxClAOEW5-ec9T0,1815
93
- arpakitlib/_arpakit_project_template_v_5/project/api/event.py,sha256=2DqXb8-iiSMoyh5OJI7nf53N5Bij5HfnFVrbLlI8G3w,2566
93
+ arpakitlib/_arpakit_project_template_v_5/project/api/event.py,sha256=sJ9-GgBdIruJW2Kj7cU-BcqRyD8IItWFQrmGKndZ4nw,2614
94
94
  arpakitlib/_arpakit_project_template_v_5/project/api/exception.py,sha256=cNZaI2DacGLl8Hyn1qIfFpVjvQzOQjwXWsVW4auBrCo,1280
95
95
  arpakitlib/_arpakit_project_template_v_5/project/api/exception_handler.py,sha256=TEzkCNOg_TAELRTZgLtblVagSaHf-vego_oH5FNCbcs,11179
96
96
  arpakitlib/_arpakit_project_template_v_5/project/api/openapi_ui.py,sha256=PLhH-W6zDViO-75AGCs8Vq3IoyHChdqwBYAqLvdQN0U,904
@@ -172,8 +172,11 @@ arpakitlib/_arpakit_project_template_v_5/project/core/dump_file_storage_in_dir.p
172
172
  arpakitlib/_arpakit_project_template_v_5/project/core/easy_openai_api_client.py,sha256=G4J9s0gerNlnvl1LvaWSYy1gdvaMbxyz0ZP35U9nx_Q,1219
173
173
  arpakitlib/_arpakit_project_template_v_5/project/core/jinja2_templates.py,sha256=jCNLaBauGC7YNvZdTLNHuPp7hmRGt94O23Skg6ewo7o,352
174
174
  arpakitlib/_arpakit_project_template_v_5/project/core/media_file_storage_in_dir.py,sha256=fMofTsfJtA8pp5lEUhucEUu3PBsmj-elaRZzExDsdLI,623
175
- arpakitlib/_arpakit_project_template_v_5/project/core/settings.py,sha256=BO6AgjZcK2pwClQFjabtuBObY0bvQ6NWbrrqvT2Kc_c,6270
175
+ arpakitlib/_arpakit_project_template_v_5/project/core/settings.py,sha256=6ES9hzt2Z3wvr993U8lowxGe8gisqE2vKeuK1-RSw8c,6342
176
176
  arpakitlib/_arpakit_project_template_v_5/project/core/util.py,sha256=1ha9UrguVPsTSjoMHhVZVCD0_mNBfhIDGEvcG1nA4Zw,667
177
+ arpakitlib/_arpakit_project_template_v_5/project/emailer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
178
+ arpakitlib/_arpakit_project_template_v_5/project/emailer/send_email.py,sha256=lw-nUFtEYiGEChSZrfuXCtTkoY6fNT45M_Y6QfzOk90,2175
179
+ arpakitlib/_arpakit_project_template_v_5/project/emailer/send_simple_email.py,sha256=yv4fAtUuneK6nmIVn2vAoXqjBVFSoEliBcGssTeHoVs,932
177
180
  arpakitlib/_arpakit_project_template_v_5/project/json_db/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
178
181
  arpakitlib/_arpakit_project_template_v_5/project/json_db/json_db.py,sha256=tBML-z4Y7uY8f_0ggcxvlDNt15Sf93Jr_OUeHwWxqOA,724
179
182
  arpakitlib/_arpakit_project_template_v_5/project/more/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -210,6 +213,7 @@ arpakitlib/_arpakit_project_template_v_5/project/resource/static/swagger-ui/swag
210
213
  arpakitlib/_arpakit_project_template_v_5/project/resource/static/swagger-ui/swagger-ui.js,sha256=yHKu9z0C2kOO5j9n9D8oQzuBLeEoMGrFcMWQN27V554,339285
211
214
  arpakitlib/_arpakit_project_template_v_5/project/resource/static/swagger-ui/swagger-ui.js.map,sha256=jeX-b8zAm2jsTGGCznrc49McbLKSfXspwECPhEAp0Xc,1159444
212
215
  arpakitlib/_arpakit_project_template_v_5/project/resource/templates/healthcheck.txt,sha256=sxSHRe2D3mnWbLKY320QdFehtXS-zAgMQmmu7tAQIG0,11
216
+ arpakitlib/_arpakit_project_template_v_5/project/resource/templates/simple_email.html,sha256=NNfrRzQFrymBSjWZdO-nkNSKk68hyPP9XgvQXpNQI4I,1112
213
217
  arpakitlib/_arpakit_project_template_v_5/project/sandbox/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
214
218
  arpakitlib/_arpakit_project_template_v_5/project/sandbox/sandbox_1.py,sha256=xKSp7tIBu3Ffp_kgJkwVtdam3BcoFZ44JPVHoRRaP0E,163
215
219
  arpakitlib/_arpakit_project_template_v_5/project/sandbox/sandbox_2.py,sha256=xKSp7tIBu3Ffp_kgJkwVtdam3BcoFZ44JPVHoRRaP0E,163
@@ -236,7 +240,7 @@ arpakitlib/_arpakit_project_template_v_5/project/sqladmin_/model_view/__init__.p
236
240
  arpakitlib/_arpakit_project_template_v_5/project/sqladmin_/model_view/api_key.py,sha256=VTpepKLCKrPnftGD-8Ibp75S0dwUrLlUytRfcXDDcKg,1597
237
241
  arpakitlib/_arpakit_project_template_v_5/project/sqladmin_/model_view/common.py,sha256=StdbfHZ92qAP-l2lnvAeyYCaZuMHKskHq1E19zJh6MA,2471
238
242
  arpakitlib/_arpakit_project_template_v_5/project/sqladmin_/model_view/operation.py,sha256=KUC-EZYFlLca92b6PwI0l5leOT8DzjlWm6y-a0PCvQc,3234
239
- arpakitlib/_arpakit_project_template_v_5/project/sqladmin_/model_view/story_log.py,sha256=BFieWjN5cWgft0Vocrdn_9d3YiDvCBxOjQJ3otPJSEQ,1658
243
+ arpakitlib/_arpakit_project_template_v_5/project/sqladmin_/model_view/story_log.py,sha256=EePtnFQsDKvhHcPYQU4ahgo24jC6uBZkuzu2alrTviE,2180
240
244
  arpakitlib/_arpakit_project_template_v_5/project/sqladmin_/model_view/user.py,sha256=Ca92t9vj-Eu6x6NGi0rv8AnxNCx0fhDzuTDqVJpGdW0,2426
241
245
  arpakitlib/_arpakit_project_template_v_5/project/sqladmin_/model_view/user_token.py,sha256=pyeyDTg4rss8-67hIE3-SQlAvNfje6HazuaVnyFBpN8,2054
242
246
  arpakitlib/_arpakit_project_template_v_5/project/sqladmin_/model_view/verification_code.py,sha256=8dfmXKVsmLNf6Id6Ql52uVaZuQtqNCq5nJgBOv3N66A,2883
@@ -329,6 +333,7 @@ arpakitlib/_arpakit_project_template_v_5/project/tg_bot/router/client/raw_messag
329
333
  arpakitlib/_arpakit_project_template_v_5/project/tg_bot/router/client/remove_message.py,sha256=DeHoq6nCIHAhxwPZgcy7zU01Y7cpIJNapwsE_MjiRtY,791
330
334
  arpakitlib/_arpakit_project_template_v_5/project/tg_bot/router/client/start.py,sha256=jD9WbJn4tND6wsfxxxmvYl8DDhoAXAkFziueV9IY4iM,1016
331
335
  arpakitlib/_arpakit_project_template_v_5/project/tg_bot/router/client/support.py,sha256=MCvb-yJCBrJWBoESdU2X8Uft50oxEVe_m5YhZ_oHY4M,1096
336
+ arpakitlib/_arpakit_project_template_v_5/project/tg_bot/router/client/voice_.py,sha256=XscGPPQ__1QoWmQcSLtR3XU94KHfxjMYGiL2khsX1Eg,645
332
337
  arpakitlib/_arpakit_project_template_v_5/project/tg_bot/router/main_router.py,sha256=5r9wZLjhxWTL89I_NF8NUwcMcBkyOQR7IRw9y4gWXWY,2435
333
338
  arpakitlib/_arpakit_project_template_v_5/project/tg_bot/start_tg_bot.py,sha256=vHARWETCD4hlK624aFxnkjsytgEbZY20bt973Oc_Peo,1253
334
339
  arpakitlib/_arpakit_project_template_v_5/project/tg_bot/state/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -348,7 +353,6 @@ arpakitlib/_arpakit_project_template_v_5/project/tg_bot_notifier/tg_bot_notifier
348
353
  arpakitlib/_arpakit_project_template_v_5/project/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
349
354
  arpakitlib/_arpakit_project_template_v_5/project/util/arpakitlib_project_template_util.py,sha256=syA_IuszHVub0zm0sVdB4_7rPJXwXRW4JmQ4qHbjXPk,396
350
355
  arpakitlib/_arpakit_project_template_v_5/project/util/etc.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
351
- arpakitlib/_arpakit_project_template_v_5/project/util/send_email.py,sha256=lw-nUFtEYiGEChSZrfuXCtTkoY6fNT45M_Y6QfzOk90,2175
352
356
  arpakitlib/_arpakit_project_template_v_5/todo.txt,sha256=q132Jbx229ThY77S3YiN-Cj5AVm7k1VlJcMYIbZUHUY,3
353
357
  arpakitlib/ar_additional_model_util.py,sha256=GFg-glLCxH9X95R2bhTJsscVwv37FgE1qbaAAyXrnIE,917
354
358
  arpakitlib/ar_aiogram_util.py,sha256=4bizX5Xg-E2-r2TXXGQGanJozsIWPVf5luO3vKUN8p8,8471
@@ -398,8 +402,8 @@ arpakitlib/ar_ssh_runner_util.py,sha256=yvAwza480MkHKvLkDEsR7JNh2bYNs6P9rCVo4NA8
398
402
  arpakitlib/ar_str_util.py,sha256=CAv0wH8nP5Ja59S-hEdmNhNrM_Fwy935d0zntLpJkx8,4309
399
403
  arpakitlib/ar_type_util.py,sha256=Cs_tef-Fc5xeyAF54KgISCsP11NHyzIsglm4S3Xx7iM,4049
400
404
  arpakitlib/ar_yookassa_api_client_util.py,sha256=VozuZeCJjmLd1zj2BdC9WfiAQ3XYOrIMsdpNK-AUlm0,5347
401
- arpakitlib-1.8.114.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
402
- arpakitlib-1.8.114.dist-info/METADATA,sha256=RF87YlXnrStQ2Qld70zHu6k7AgKoS-cgZP8W5TY-3t8,3566
403
- arpakitlib-1.8.114.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
404
- arpakitlib-1.8.114.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
405
- arpakitlib-1.8.114.dist-info/RECORD,,
405
+ arpakitlib-1.8.134.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
406
+ arpakitlib-1.8.134.dist-info/METADATA,sha256=WyWQRTRGRnChLO9ny5CHJB1Rhj-h0b6uRsQtqXLi_TA,3567
407
+ arpakitlib-1.8.134.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
408
+ arpakitlib-1.8.134.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
409
+ arpakitlib-1.8.134.dist-info/RECORD,,