hh-applicant-tool 0.6.2__tar.gz → 0.6.3__tar.gz

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.

Potentially problematic release.


This version of hh-applicant-tool might be problematic. Click here for more details.

Files changed (31) hide show
  1. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/PKG-INFO +1 -1
  2. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/hh_applicant_tool/operations/reply_employers.py +33 -4
  3. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/pyproject.toml +1 -1
  4. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/README.md +0 -0
  5. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/hh_applicant_tool/__init__.py +0 -0
  6. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/hh_applicant_tool/__main__.py +0 -0
  7. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/hh_applicant_tool/ai/__init__.py +0 -0
  8. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/hh_applicant_tool/ai/blackbox.py +0 -0
  9. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/hh_applicant_tool/api/__init__.py +0 -0
  10. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/hh_applicant_tool/api/client.py +0 -0
  11. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/hh_applicant_tool/api/errors.py +0 -0
  12. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/hh_applicant_tool/color_log.py +0 -0
  13. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/hh_applicant_tool/constants.py +0 -0
  14. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/hh_applicant_tool/jsonc.py +0 -0
  15. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/hh_applicant_tool/main.py +0 -0
  16. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/hh_applicant_tool/mixins.py +0 -0
  17. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/hh_applicant_tool/operations/__init__.py +0 -0
  18. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/hh_applicant_tool/operations/apply_similar.py +0 -0
  19. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/hh_applicant_tool/operations/authorize.py +0 -0
  20. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/hh_applicant_tool/operations/call_api.py +0 -0
  21. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/hh_applicant_tool/operations/clear_negotiations.py +0 -0
  22. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/hh_applicant_tool/operations/config.py +0 -0
  23. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/hh_applicant_tool/operations/delete_telemetry.py +0 -0
  24. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/hh_applicant_tool/operations/get_employer_contacts.py +0 -0
  25. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/hh_applicant_tool/operations/list_resumes.py +0 -0
  26. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/hh_applicant_tool/operations/refresh_token.py +0 -0
  27. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/hh_applicant_tool/operations/update_resumes.py +0 -0
  28. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/hh_applicant_tool/operations/whoami.py +0 -0
  29. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/hh_applicant_tool/telemetry_client.py +0 -0
  30. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/hh_applicant_tool/types.py +0 -0
  31. {hh_applicant_tool-0.6.2 → hh_applicant_tool-0.6.3}/hh_applicant_tool/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: hh-applicant-tool
3
- Version: 0.6.2
3
+ Version: 0.6.3
4
4
  Summary:
5
5
  Author: Senior YAML Developer
6
6
  Author-email: yamldeveloper@proton.me
@@ -13,11 +13,13 @@ from ..mixins import GetResumeIdMixin
13
13
  from ..utils import parse_interval, random_text
14
14
  from ..telemetry_client import TelemetryClient, TelemetryError
15
15
  import re
16
+ from itertools import count
16
17
 
17
18
  try:
18
19
  import readline
19
20
 
20
21
  readline.add_history("/cancel ")
22
+ readline.add_history("/ban")
21
23
  readline.set_history_length(10_000)
22
24
  except ImportError:
23
25
  pass
@@ -100,7 +102,18 @@ class Operation(BaseOperation, GetResumeIdMixin):
100
102
  logger.debug(f"{self.reply_message = }")
101
103
  self._reply_chats()
102
104
 
105
+ def _get_blacklisted(self) -> list[str]:
106
+ rv = []
107
+ for page in count(0):
108
+ r = self.api_client.get("/employers/blacklisted", page=page)
109
+ rv += [item["id"] for item in r["items"]]
110
+ if page >= r["pages"]:
111
+ break
112
+ return rv
113
+
103
114
  def _reply_chats(self) -> None:
115
+ blacklisted = self._get_blacklisted()
116
+ logger.debug(f"{blacklisted = }")
104
117
  me = self.me = self.api_client.get("/me")
105
118
 
106
119
  telemetry_data = {"links": []}
@@ -130,11 +143,19 @@ class Operation(BaseOperation, GetResumeIdMixin):
130
143
  logger.debug(negotiation)
131
144
  nid = negotiation["id"]
132
145
  vacancy = negotiation["vacancy"]
146
+ employer = vacancy.get("employer") or {}
133
147
  salary = vacancy.get("salary") or {}
134
148
 
149
+ if employer.get("id") in blacklisted:
150
+ print(
151
+ "🚫 Пропускаем заблокированного работодателя",
152
+ employer.get("alternate_url"),
153
+ )
154
+ continue
155
+
135
156
  message_placeholders = {
136
157
  "vacancy_name": vacancy.get("name", ""),
137
- "employer_name": vacancy.get("employer", {}).get("name", ""),
158
+ "employer_name": employer.get("name", ""),
138
159
  **basic_message_placeholders,
139
160
  }
140
161
 
@@ -229,8 +250,9 @@ class Operation(BaseOperation, GetResumeIdMixin):
229
250
  print("-" * 10)
230
251
  print()
231
252
  print(
232
- "Чтобы отменить отклик введите /cancel <необязательное сообщение для отказа>"
253
+ "Отмена отклика: /cancel <необязательное сообщение для отказа>"
233
254
  )
255
+ print("Заблокировать работодателя: /ban")
234
256
  print()
235
257
  send_message = input("Ваше сообщение: ").strip()
236
258
  except EOFError:
@@ -254,13 +276,20 @@ class Operation(BaseOperation, GetResumeIdMixin):
254
276
  )
255
277
  )
256
278
 
257
- if send_message.startswith("/cancel"):
279
+ if send_message.startswith("/ban"):
280
+ self.api_client.put(f"/employers/blacklisted/{employer['id']}")
281
+ blacklisted.append(employer["id"])
282
+ print(
283
+ "🚫 Работодатель добавлен в черный список",
284
+ employer.get("alternate_url"),
285
+ )
286
+ elif send_message.startswith("/cancel"):
258
287
  _, decline_allowed = send_message.split("/cancel", 1)
259
288
  self.api_client.delete(
260
289
  f"/negotiations/active/{negotiation['id']}",
261
290
  with_decline_message=decline_allowed.strip(),
262
291
  )
263
- print("Отменили заявку", vacancy["alternate_url"])
292
+ print("Отменили заявку", vacancy["alternate_url"])
264
293
  else:
265
294
  self.api_client.post(
266
295
  f"/negotiations/{nid}/messages",
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "hh-applicant-tool"
3
- version = "0.6.2"
3
+ version = "0.6.3"
4
4
  description = ""
5
5
  authors = ["Senior YAML Developer <yamldeveloper@proton.me>"]
6
6
  readme = "README.md"