arpakitlib 1.6.40__py3-none-any.whl → 1.6.42__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,7 +3,7 @@
3
3
  import asyncio
4
4
  import hashlib
5
5
  import logging
6
- from datetime import datetime
6
+ from datetime import datetime, timedelta
7
7
  from typing import Any
8
8
 
9
9
  import pytz
@@ -83,6 +83,10 @@ class ScheduleUUSTAPIClient:
83
83
  method="GET",
84
84
  params=combine_dicts(params, self.auth_params()),
85
85
  proxy_url_=self.api_proxy_url,
86
+ max_tries_=9,
87
+ timeout_=timedelta(seconds=15),
88
+ raise_for_status_=True,
89
+ headers=self.headers
86
90
  )
87
91
  json_data = await response.json()
88
92
  raise_for_type(json_data, dict)
@@ -0,0 +1,23 @@
1
+ from pydantic import ConfigDict, field_validator
2
+ from pydantic_settings import BaseSettings
3
+
4
+ from arpakitlib.ar_enumeration_util import Enumeration
5
+
6
+
7
+ class ModeTypes(Enumeration):
8
+ local: str = "local"
9
+ dev: str = "dev"
10
+ preprod: str = "preprod"
11
+ prod: str = "prod"
12
+
13
+
14
+ class SimpleSettings(BaseSettings):
15
+ model_config = ConfigDict(extra="ignore")
16
+
17
+ mode_type: str
18
+
19
+ @field_validator("mode_type")
20
+ @classmethod
21
+ def validate_mode_type(cls, v: str):
22
+ ModeTypes.parse_and_validate_values(v)
23
+ return v
@@ -1,7 +1,7 @@
1
1
  # arpakit
2
2
  import asyncio
3
3
  import logging
4
- from datetime import timedelta
4
+ from datetime import timedelta, datetime
5
5
  from typing import Any
6
6
  from uuid import uuid4
7
7
 
@@ -9,6 +9,8 @@ from sqlalchemy import create_engine, QueuePool, text, func
9
9
  from sqlalchemy.orm import sessionmaker, DeclarativeBase
10
10
  from sqlalchemy.orm.session import Session
11
11
 
12
+ from arpakitlib.ar_datetime_util import now_utc_dt
13
+
12
14
  _ARPAKIT_LIB_MODULE_VERSION = "3.0"
13
15
 
14
16
 
@@ -78,9 +80,9 @@ class SQLAlchemyDB:
78
80
  self.engine.connect()
79
81
  self._logger.info("db conn is good")
80
82
 
81
- def new_session(self) -> Session:
83
+ def new_session(self, **kwargs) -> Session:
82
84
  self.func_new_session_counter += 1
83
- return self.sessionmaker(bind=self.engine)
85
+ return self.sessionmaker(**kwargs)
84
86
 
85
87
  def is_conn_good(self) -> bool:
86
88
  try:
@@ -104,6 +106,9 @@ class SQLAlchemyDB:
104
106
  res = str(uuid4())
105
107
  return res
106
108
 
109
+ def generate_creation_dt(self) -> datetime:
110
+ return now_utc_dt()
111
+
107
112
 
108
113
  def __example():
109
114
  pass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: arpakitlib
3
- Version: 1.6.40
3
+ Version: 1.6.42
4
4
  Summary: arpakitlib
5
5
  Home-page: https://github.com/ARPAKIT-Company/arpakitlib
6
6
  License: Apache-2.0
@@ -54,17 +54,18 @@ arpakitlib/ar_operation_execution_util.py,sha256=w_dz4XYEM4WbTxpBoYVkknG3U3_391c
54
54
  arpakitlib/ar_parse_command.py,sha256=qpr2OwG3Bf7DFiL9S3iWgtbvtE80RSC35E5zFJvjG1I,2714
55
55
  arpakitlib/ar_postgresql_util.py,sha256=1AuLjEaa1Lg4pzn-ukCVnDi35Eg1k91APRTqZhIJAdo,945
56
56
  arpakitlib/ar_run_cmd_util.py,sha256=D_rPavKMmWkQtwvZFz-Io5Ak8eSODHkcFeLPzNVC68g,1072
57
- arpakitlib/ar_schedule_uust_api_client_util.py,sha256=Z5BNiHdKWqHmmycinwCbX5_pSNBB59Qn9urvUXU0RDk,5877
57
+ arpakitlib/ar_schedule_uust_api_client_util.py,sha256=0X4yACjt8cxMvuoZUq4S0HuVhVUQW5fGmiPcG7vwM8Y,6027
58
+ arpakitlib/ar_settings_util.py,sha256=vVm2_e0WQ6TH_w7TZ5FIhSfsLg_Hkpd4l1HHPAF_FdU,539
58
59
  arpakitlib/ar_sleep_util.py,sha256=9ZN4Qo4eZ_q3hjM7vNBQjFRcH-9-sqv3QLSjnxVJE90,1405
59
60
  arpakitlib/ar_sqlalchemy_model_util.py,sha256=ttdgOwQfoHTKqgivBtXoSbJoBCASHDjLEFK5tJ9kNNE,4779
60
- arpakitlib/ar_sqlalchemy_util.py,sha256=3jKHu5aUFPUQ492dWaisN0Y_-r2Pif16SfNawrQ_6xY,4012
61
+ arpakitlib/ar_sqlalchemy_util.py,sha256=3wejwPbH5VsTZAWvJQ4qQ8tda-PWBmqVThwRyKnyGqo,4153
61
62
  arpakitlib/ar_ssh_util.py,sha256=jlnss4V4pziBN1rBzoK_lDiWm6nMOqGXfa6NFJSKH-Y,6796
62
63
  arpakitlib/ar_str_util.py,sha256=xSEzmsDvRiZVaxyqFFjcgzpphktCbXg2FHcvsd1DYpA,1885
63
64
  arpakitlib/ar_type_util.py,sha256=I6jbTz7_dxR1lkhz1JfUb5ZyLLdXVhG_-hzjdgT6N6s,1932
64
65
  arpakitlib/ar_yookassa_api_client_util.py,sha256=5GMvu8paByni8buhc1vpHB7n6oXe0gPfj1LSvnyZCrQ,5307
65
66
  arpakitlib/ar_zabbix_util.py,sha256=Q-VR4MvoZ9aHwZeYZr9G3LwN-ANx1T5KFmF6pvPM-9M,6402
66
- arpakitlib-1.6.40.dist-info/LICENSE,sha256=1jqWIkbnMxDfs_i0SXP5qbV6PHjBr1g8506oW7uPjfg,11347
67
- arpakitlib-1.6.40.dist-info/METADATA,sha256=IiMb0_BoA1n4MS3yVBzrBjcmrSqdIgZ8UKTgL_nQuyI,2320
68
- arpakitlib-1.6.40.dist-info/NOTICE,sha256=wHwmiq3wExfFfgMsE5U5TOBP9_l72ocIG82KurEels0,43
69
- arpakitlib-1.6.40.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
70
- arpakitlib-1.6.40.dist-info/RECORD,,
67
+ arpakitlib-1.6.42.dist-info/LICENSE,sha256=1jqWIkbnMxDfs_i0SXP5qbV6PHjBr1g8506oW7uPjfg,11347
68
+ arpakitlib-1.6.42.dist-info/METADATA,sha256=bcps9OfFsy-WR2B6RKGN9_5I_l_KuuvOFrC_MIjP2-M,2320
69
+ arpakitlib-1.6.42.dist-info/NOTICE,sha256=wHwmiq3wExfFfgMsE5U5TOBP9_l72ocIG82KurEels0,43
70
+ arpakitlib-1.6.42.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
71
+ arpakitlib-1.6.42.dist-info/RECORD,,