arpakitlib 1.6.93__py3-none-any.whl → 1.6.95__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.
@@ -4,6 +4,7 @@ from src.core.util import setup_logging
4
4
 
5
5
  _logger = logging.getLogger(__name__)
6
6
 
7
+
7
8
  def command():
8
9
  setup_logging()
9
10
  _logger.info("checking logging")
@@ -0,0 +1,2 @@
1
+ cd ..
2
+ poetry show arpakitlib --no-dev
@@ -1,8 +1,6 @@
1
-
2
1
  def make_test_data_1():
3
2
  pass
4
3
 
5
4
 
6
5
  async def async_make_test_data_1():
7
6
  pass
8
-
@@ -1,8 +1,6 @@
1
-
2
1
  def make_test_data_2():
3
2
  pass
4
3
 
5
4
 
6
5
  async def async_make_test_data_2():
7
6
  pass
8
-
@@ -1,8 +1,6 @@
1
-
2
1
  def make_test_data_3():
3
2
  pass
4
3
 
5
4
 
6
5
  async def async_make_test_data_3():
7
6
  pass
8
-
@@ -1,8 +1,6 @@
1
-
2
1
  def make_test_data_4():
3
2
  pass
4
3
 
5
4
 
6
5
  async def async_make_test_data_4():
7
6
  pass
8
-
@@ -1,8 +1,6 @@
1
-
2
1
  def make_test_data_5():
3
2
  pass
4
3
 
5
4
 
6
5
  async def async_make_test_data_5():
7
6
  pass
8
-
@@ -82,10 +82,10 @@ class ScheduleUUSTAPIClient:
82
82
  response = await async_make_http_request(
83
83
  method=method,
84
84
  url=url,
85
+ headers=self.headers,
85
86
  params=combine_dicts(params, self.auth_params()),
86
87
  proxy_url_=self.api_proxy_url,
87
- raise_for_status_=True,
88
- headers=self.headers
88
+ raise_for_status_=True
89
89
  )
90
90
  return response
91
91
 
@@ -40,6 +40,7 @@ class YookassaAPIClient:
40
40
  self.secret_key = secret_key
41
41
  self.shop_id = shop_id
42
42
  self.headers = {"Content-Type": "application/json"}
43
+ self.timeout_ = timedelta(seconds=3)
43
44
  self._logger = logging.getLogger(self.__class__.__name__)
44
45
 
45
46
  def _sync_make_http_request(
@@ -47,23 +48,21 @@ class YookassaAPIClient:
47
48
  *,
48
49
  method: str,
49
50
  url: str,
51
+ headers: dict[str, Any] | None = None,
50
52
  **kwargs
51
53
  ) -> requests.Response:
52
- if "headers" not in kwargs:
53
- kwargs["headers"] = {}
54
- kwargs["headers"] = combine_dicts(self.headers, kwargs["headers"])
55
- kwargs["auth"] = (self.shop_id, self.secret_key)
56
54
  return sync_make_http_request(
57
55
  method=method,
58
56
  url=url,
59
- timeout_=timedelta(seconds=3),
57
+ headers=combine_dicts(self.headers, (headers if headers is not None else {})),
58
+ timeout_=self.timeout_,
59
+ auth=(self.shop_id, self.secret_key),
60
60
  **kwargs
61
61
  )
62
62
 
63
63
  def sync_create_payment(
64
64
  self,
65
- json_body: dict[str, Any],
66
- idempotence_key: Optional[str] = None
65
+ json_body: dict[str, Any]
67
66
  ) -> dict[str, Any]:
68
67
 
69
68
  """
@@ -85,38 +84,27 @@ class YookassaAPIClient:
85
84
  }
86
85
  """
87
86
 
88
- if idempotence_key is None:
89
- idempotence_key = str(uuid.uuid4())
90
-
91
87
  response = self._sync_make_http_request(
92
88
  method="POST",
93
89
  url="https://api.yookassa.ru/v3/payments",
94
- headers={"Idempotence-Key": idempotence_key},
90
+ headers={"Idempotence-Key": str(uuid.uuid4())},
95
91
  json=json_body,
96
92
  )
97
-
98
93
  json_data = response.json()
99
-
100
94
  response.raise_for_status()
101
-
102
95
  return json_data
103
96
 
104
- def sync_get_payment(self, payment_id: str) -> Optional[dict[str, Any]]:
97
+ def sync_get_payment(self, payment_id: str) -> dict[str, Any] | None:
105
98
  raise_for_type(payment_id, str)
106
-
107
99
  response = self._sync_make_http_request(
108
100
  method="GET",
109
101
  url=f"https://api.yookassa.ru/v3/payments/{payment_id}",
110
102
  headers=self.headers
111
103
  )
112
-
113
104
  json_data = response.json()
114
-
115
105
  if response.status_code == 404:
116
106
  return None
117
-
118
107
  response.raise_for_status()
119
-
120
108
  return json_data
121
109
 
122
110
  async def _async_make_http_request(
@@ -124,21 +112,20 @@ class YookassaAPIClient:
124
112
  *,
125
113
  method: str = "GET",
126
114
  url: str,
115
+ headers: dict[str, Any] | None = None,
127
116
  **kwargs
128
117
  ) -> aiohttp.ClientResponse:
129
- if "headers" not in kwargs:
130
- kwargs["headers"] = {}
131
- kwargs["headers"] = combine_dicts(self.headers, kwargs["headers"])
132
- kwargs["auth"] = aiohttp.BasicAuth(login=str(self.shop_id), password=self.secret_key)
133
118
  return await async_make_http_request(
134
119
  method=method,
135
120
  url=url,
136
- timeout_=timedelta(seconds=3),
121
+ headers=combine_dicts(self.headers, (headers if headers is not None else {})),
122
+ timeout_=self.timeout_,
123
+ auth=aiohttp.BasicAuth(login=str(self.shop_id), password=self.secret_key),
137
124
  **kwargs
138
125
  )
139
126
 
140
127
  async def async_create_payment(
141
- self, json_body: dict[str, Any], idempotence_key: Optional[str] = None
128
+ self, json_body: dict[str, Any]
142
129
  ) -> dict[str, Any]:
143
130
 
144
131
  """
@@ -160,37 +147,26 @@ class YookassaAPIClient:
160
147
  }
161
148
  """
162
149
 
163
- if idempotence_key is None:
164
- idempotence_key = str(uuid.uuid4())
165
-
166
150
  response = await self._async_make_http_request(
167
151
  method="POST",
168
152
  url="https://api.yookassa.ru/v3/payments",
169
- headers={"Idempotence-Key": idempotence_key},
153
+ headers={"Idempotence-Key": str(uuid.uuid4())},
170
154
  json=json_body,
171
155
  )
172
-
173
156
  json_data = await response.json()
174
-
175
157
  response.raise_for_status()
176
-
177
158
  return json_data
178
159
 
179
160
  async def async_get_payment(self, payment_id: str) -> Optional[dict[str, Any]]:
180
161
  raise_for_type(payment_id, str)
181
-
182
162
  response = await self._async_make_http_request(
183
163
  method="GET",
184
164
  url=f"https://api.yookassa.ru/v3/payments/{payment_id}",
185
165
  )
186
-
187
166
  json_data = await response.json()
188
-
189
167
  if response.status == 404:
190
168
  return None
191
-
192
169
  response.raise_for_status()
193
-
194
170
  return json_data
195
171
 
196
172
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: arpakitlib
3
- Version: 1.6.93
3
+ Version: 1.6.95
4
4
  Summary: arpakitlib
5
5
  Home-page: https://github.com/ARPAKIT-Company/arpakitlib
6
6
  License: Apache-2.0
@@ -8,7 +8,7 @@ arpakitlib/_arpakit_project_template/NOTICE,sha256=95aUzaPJjVpDsGAsNzVnq7tHTxAl0
8
8
  arpakitlib/_arpakit_project_template/README.md,sha256=n7bVQwXStxdwN07oMF9ot5076qVjTk_H-rmUaSYfHK8,66
9
9
  arpakitlib/_arpakit_project_template/manage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  arpakitlib/_arpakit_project_template/manage/beutify_json.py,sha256=mzmt-5piAHqgihLsqOpPx1JjDc1qA5F1XHBxDdR-BxY,215
11
- arpakitlib/_arpakit_project_template/manage/check_logging.py,sha256=77OQzbolrlfc6h5EK5nkJ4RamJ034mFVW8s0rVQGnhM,211
11
+ arpakitlib/_arpakit_project_template/manage/check_logging.py,sha256=rfrl4MK5ItRKaLKb0UU_EfQLckRQSYJ1S_2VAQJQ2Yk,212
12
12
  arpakitlib/_arpakit_project_template/manage/check_settings.py,sha256=JYR-IPgvYQOmJedKY9vOctbxEcUlaxZR-P0JXT9L2JQ,143
13
13
  arpakitlib/_arpakit_project_template/manage/docker_ps.sh,sha256=uwm8vHgeuNLCOn0o9hgP_uc-PUkS9FwLyzZh6ItZ3do,15
14
14
  arpakitlib/_arpakit_project_template/manage/generate_env_example.py,sha256=gveKEz6zf5rwKNBXtHacPEjxxjPTbLy4n-Ztv0BqCWE,331
@@ -34,6 +34,7 @@ arpakitlib/_arpakit_project_template/manage/poetry_install.sh,sha256=oLSrFGHKIRW
34
34
  arpakitlib/_arpakit_project_template/manage/poetry_lock.sh,sha256=9oiTdi8ynGQWctQjI3g4ThGkvpT07-g5ajLmG47iVh8,17
35
35
  arpakitlib/_arpakit_project_template/manage/poetry_remove_and_add_arpakitlib.sh,sha256=-DvxXI-oaAQxIZFtiCfNBhqpRgJcWWuxhoHb9Nou0a4,197
36
36
  arpakitlib/_arpakit_project_template/manage/poetry_show.sh,sha256=pclR9efCNrrGyJR2HrdDM4PCUFGg0OSlRtjQ3Srv8W8,24
37
+ arpakitlib/_arpakit_project_template/manage/poetry_show_arpakitlib.sh,sha256=5ibH12wGYc-Cj8zl5abtI_hLVSW0o4ofktt-w7I6wQo,37
37
38
  arpakitlib/_arpakit_project_template/manage/poetry_update.sh,sha256=ZtoXIC4Qq7PMTDxQMwUxvkYC6lTc5LC23ILTywWbyoU,164
38
39
  arpakitlib/_arpakit_project_template/manage/poetry_update_arpakitlib.sh,sha256=hh7vj-yKgKqLfaGb8cjsJ_NTa7fBtE4s3yxzte4D8bw,163
39
40
  arpakitlib/_arpakit_project_template/manage/sandbox/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -58,11 +59,11 @@ arpakitlib/_arpakit_project_template/src/core/const.py,sha256=CZZew674y7LhCAlYhv
58
59
  arpakitlib/_arpakit_project_template/src/core/settings.py,sha256=TNS0T9xUPw089wJV10BGoG8LCBOIb30DrDazxP2NPAU,1184
59
60
  arpakitlib/_arpakit_project_template/src/core/util.py,sha256=EXFC0OqaM9by3jDk6mc2mFO_b9RcLs3VT-qr31QemDc,1387
60
61
  arpakitlib/_arpakit_project_template/src/test_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
61
- arpakitlib/_arpakit_project_template/src/test_data/make_test_data_1.py,sha256=F7c6gRJUPjS14oLEDvRGA34yEabpnb5VH59N_xxkqrI,82
62
- arpakitlib/_arpakit_project_template/src/test_data/make_test_data_2.py,sha256=8fIBiguJWvQJscQzDDBWdk-XeDQNAMBKULVV7RjHoR0,82
63
- arpakitlib/_arpakit_project_template/src/test_data/make_test_data_3.py,sha256=20He7mIb7cUM16he-LQzr5GRk4b9VPXCk8omn-s31yg,82
64
- arpakitlib/_arpakit_project_template/src/test_data/make_test_data_4.py,sha256=WqxgOzaIDsmIER1nFIxrywtKceyvkqtLlyt2ybTxSw0,82
65
- arpakitlib/_arpakit_project_template/src/test_data/make_test_data_5.py,sha256=ogTmetjQiRa57TKNfVH5A6GFTqBrU1Js0vTok6jlL_A,82
62
+ arpakitlib/_arpakit_project_template/src/test_data/make_test_data_1.py,sha256=3WVPgRsNCIxWpA-6t_Phe-nFULdHPhS1S_DO11XRmqk,80
63
+ arpakitlib/_arpakit_project_template/src/test_data/make_test_data_2.py,sha256=MVDc71sj5I1muWin50GwrSxMwYtOOSDOtRmeFErHcXs,80
64
+ arpakitlib/_arpakit_project_template/src/test_data/make_test_data_3.py,sha256=89Rg0wubztpCNHBOWkhjZz3nB8Teilrl9xHlJvDWw9o,80
65
+ arpakitlib/_arpakit_project_template/src/test_data/make_test_data_4.py,sha256=BlVvIhSFclBMQMHftETS57bRaFpkOdKPrZyxMbYJuDY,80
66
+ arpakitlib/_arpakit_project_template/src/test_data/make_test_data_5.py,sha256=7ruCZevqJoLSdqL1OEJWUy3YPCOHQif7JqVTKxZ9acM,80
66
67
  arpakitlib/_arpakit_project_template/src/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
67
68
  arpakitlib/ar_additional_model_util.py,sha256=tNzZhZtvtJ1qC6Cn4UnyoEL58HudfpCdQy5ftkCqyik,473
68
69
  arpakitlib/ar_aiogram_util.py,sha256=5JPCDZpdBGTE-EIWPRez9amCZAX7XemFIVu5YrQK7Pw,12264
@@ -111,25 +112,25 @@ arpakitlib/ar_list_util.py,sha256=2woOAHAU8oTIiVjZ8GLnx15odEaoQUq3Q0JPxlufFF0,45
111
112
  arpakitlib/ar_logging_util.py,sha256=Gyd7B9k0glIXPm6dASiigWLq9LC9lw6vhXTCeWpY5PY,1644
112
113
  arpakitlib/ar_mongodb_util.py,sha256=2ECkTnGAZ92qxioL-fmN6R4yZOSr3bXdXLWTzT1C3vk,4038
113
114
  arpakitlib/ar_need_type_util.py,sha256=xq5bbAXJG-93CRVZUcLW0ZdM22rj-ZUW17C5hX_5grg,1699
114
- arpakitlib/ar_openai_util.py,sha256=dHUbfg1sVVCjsNl_fra3iCMEz1bR-Hk9fE-DdYbu7Wc,1215
115
+ arpakitlib/ar_openai_api_client_util.py,sha256=dHUbfg1sVVCjsNl_fra3iCMEz1bR-Hk9fE-DdYbu7Wc,1215
115
116
  arpakitlib/ar_operation_execution_util.py,sha256=w_dz4XYEM4WbTxpBoYVkknG3U3_391cJmitgljJJTO0,12373
116
117
  arpakitlib/ar_parse_command.py,sha256=-s61xcATIsfw1eV_iD3xi-grsitbGzSDoAFc5V0OFy4,3447
117
118
  arpakitlib/ar_postgresql_util.py,sha256=1AuLjEaa1Lg4pzn-ukCVnDi35Eg1k91APRTqZhIJAdo,945
118
119
  arpakitlib/ar_project_template_util.py,sha256=Yh3tzNYq0rrKc1MY-qsW1Ljhi9ADz8nYXMiPDH-e6PQ,3097
119
120
  arpakitlib/ar_run_cmd_util.py,sha256=D_rPavKMmWkQtwvZFz-Io5Ak8eSODHkcFeLPzNVC68g,1072
120
- arpakitlib/ar_schedule_uust_api_client_util.py,sha256=IoJ5a5JhpS7kmh_xXbX5U82tUdpqfD_j5vWKXBEeBRU,6109
121
+ arpakitlib/ar_schedule_uust_api_client_util.py,sha256=JD-hRUQSs-euK0zq9w_4QUfGO00yWM08gllWUVKTtHc,6109
121
122
  arpakitlib/ar_settings_util.py,sha256=NvFzpIaQhlMp-BZwttUY_9gamMC5cpJk2Kp2B3BtMug,1296
122
123
  arpakitlib/ar_sleep_util.py,sha256=9ZN4Qo4eZ_q3hjM7vNBQjFRcH-9-sqv3QLSjnxVJE90,1405
123
124
  arpakitlib/ar_sqlalchemy_model_util.py,sha256=ttdgOwQfoHTKqgivBtXoSbJoBCASHDjLEFK5tJ9kNNE,4779
124
125
  arpakitlib/ar_sqlalchemy_util.py,sha256=3wejwPbH5VsTZAWvJQ4qQ8tda-PWBmqVThwRyKnyGqo,4153
125
- arpakitlib/ar_ssh_util.py,sha256=jlnss4V4pziBN1rBzoK_lDiWm6nMOqGXfa6NFJSKH-Y,6796
126
+ arpakitlib/ar_ssh_runner_util.py,sha256=jlnss4V4pziBN1rBzoK_lDiWm6nMOqGXfa6NFJSKH-Y,6796
126
127
  arpakitlib/ar_str_util.py,sha256=AhcdrEm-pXRilCaDWCdTfVkQSy0SnbE52ur43Ltr6cI,2128
127
128
  arpakitlib/ar_type_util.py,sha256=5nDnXL5Oyozlg8XvxMrogsoYiG8_atItg46A0mtv-pk,2025
128
- arpakitlib/ar_yookassa_api_client_util.py,sha256=E5fZjPSjkl1nJ556jHEftM76gRwnIwTQCBj76zDTnGw,5403
129
- arpakitlib/ar_zabbix_util.py,sha256=Q-VR4MvoZ9aHwZeYZr9G3LwN-ANx1T5KFmF6pvPM-9M,6402
130
- arpakitlib-1.6.93.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
131
- arpakitlib-1.6.93.dist-info/METADATA,sha256=oFIYbgZ77_17xzXXGqle4Hr3F20Uhue-pQZfhfWOSiM,2739
132
- arpakitlib-1.6.93.dist-info/NOTICE,sha256=95aUzaPJjVpDsGAsNzVnq7tHTxAl0s5UFznCTkVCau4,763
133
- arpakitlib-1.6.93.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
134
- arpakitlib-1.6.93.dist-info/entry_points.txt,sha256=VHkTDXDOMrgcNzGfKhEhoOIIz6T8Kkt46hy95Zc1iL0,74
135
- arpakitlib-1.6.93.dist-info/RECORD,,
129
+ arpakitlib/ar_yookassa_api_client_util.py,sha256=sh4fcUkAkdOetFn9JYoTvjcSXP-M1wU04KEY-ECLfLg,5137
130
+ arpakitlib/ar_zabbix_api_client_util.py,sha256=Q-VR4MvoZ9aHwZeYZr9G3LwN-ANx1T5KFmF6pvPM-9M,6402
131
+ arpakitlib-1.6.95.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
132
+ arpakitlib-1.6.95.dist-info/METADATA,sha256=U80z4aPUmskD6Lw2kxO3FgkL8mxPglIsmXUgGMtZBPI,2739
133
+ arpakitlib-1.6.95.dist-info/NOTICE,sha256=95aUzaPJjVpDsGAsNzVnq7tHTxAl0s5UFznCTkVCau4,763
134
+ arpakitlib-1.6.95.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
135
+ arpakitlib-1.6.95.dist-info/entry_points.txt,sha256=VHkTDXDOMrgcNzGfKhEhoOIIz6T8Kkt46hy95Zc1iL0,74
136
+ arpakitlib-1.6.95.dist-info/RECORD,,
File without changes