hh-applicant-tool 0.3.3__tar.gz → 0.3.4__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 (23) hide show
  1. {hh_applicant_tool-0.3.3 → hh_applicant_tool-0.3.4}/PKG-INFO +1 -1
  2. {hh_applicant_tool-0.3.3 → hh_applicant_tool-0.3.4}/hh_applicant_tool/operations/apply_similar.py +25 -12
  3. {hh_applicant_tool-0.3.3 → hh_applicant_tool-0.3.4}/pyproject.toml +1 -1
  4. {hh_applicant_tool-0.3.3 → hh_applicant_tool-0.3.4}/README.md +0 -0
  5. {hh_applicant_tool-0.3.3 → hh_applicant_tool-0.3.4}/hh_applicant_tool/__init__.py +0 -0
  6. {hh_applicant_tool-0.3.3 → hh_applicant_tool-0.3.4}/hh_applicant_tool/__main__.py +0 -0
  7. {hh_applicant_tool-0.3.3 → hh_applicant_tool-0.3.4}/hh_applicant_tool/api/__init__.py +0 -0
  8. {hh_applicant_tool-0.3.3 → hh_applicant_tool-0.3.4}/hh_applicant_tool/api/client.py +0 -0
  9. {hh_applicant_tool-0.3.3 → hh_applicant_tool-0.3.4}/hh_applicant_tool/api/errors.py +0 -0
  10. {hh_applicant_tool-0.3.3 → hh_applicant_tool-0.3.4}/hh_applicant_tool/color_log.py +0 -0
  11. {hh_applicant_tool-0.3.3 → hh_applicant_tool-0.3.4}/hh_applicant_tool/constants.py +0 -0
  12. {hh_applicant_tool-0.3.3 → hh_applicant_tool-0.3.4}/hh_applicant_tool/main.py +0 -0
  13. {hh_applicant_tool-0.3.3 → hh_applicant_tool-0.3.4}/hh_applicant_tool/operations/__init__.py +0 -0
  14. {hh_applicant_tool-0.3.3 → hh_applicant_tool-0.3.4}/hh_applicant_tool/operations/authorize.py +0 -0
  15. {hh_applicant_tool-0.3.3 → hh_applicant_tool-0.3.4}/hh_applicant_tool/operations/call_api.py +0 -0
  16. {hh_applicant_tool-0.3.3 → hh_applicant_tool-0.3.4}/hh_applicant_tool/operations/clear_negotiations.py +0 -0
  17. {hh_applicant_tool-0.3.3 → hh_applicant_tool-0.3.4}/hh_applicant_tool/operations/list_resumes.py +0 -0
  18. {hh_applicant_tool-0.3.3 → hh_applicant_tool-0.3.4}/hh_applicant_tool/operations/refresh_token.py +0 -0
  19. {hh_applicant_tool-0.3.3 → hh_applicant_tool-0.3.4}/hh_applicant_tool/operations/update_resumes.py +0 -0
  20. {hh_applicant_tool-0.3.3 → hh_applicant_tool-0.3.4}/hh_applicant_tool/operations/whoami.py +0 -0
  21. {hh_applicant_tool-0.3.3 → hh_applicant_tool-0.3.4}/hh_applicant_tool/telemetry_client.py +0 -0
  22. {hh_applicant_tool-0.3.3 → hh_applicant_tool-0.3.4}/hh_applicant_tool/types.py +0 -0
  23. {hh_applicant_tool-0.3.3 → hh_applicant_tool-0.3.4}/hh_applicant_tool/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hh-applicant-tool
3
- Version: 0.3.3
3
+ Version: 0.3.4
4
4
  Summary:
5
5
  Author: Senior YAML Developer
6
6
  Author-email: yamldeveloper@proton.me
@@ -134,7 +134,7 @@ class Operation(BaseOperation):
134
134
  if getenv("TEST_TELEMETRY"):
135
135
  break
136
136
 
137
- if vacancy["has_test"]:
137
+ if vacancy.get("has_test"):
138
138
  print("🚫 Пропускаем тест", vacancy["alternate_url"])
139
139
  continue
140
140
 
@@ -147,16 +147,23 @@ class Operation(BaseOperation):
147
147
  )
148
148
  continue
149
149
 
150
- employer_id = vacancy["employer"]["id"]
151
- employer = api.get(f"/employers/{employer_id}")
150
+ try:
151
+ employer_id = vacancy["employer"]["id"]
152
+ except IndexError:
153
+ logger.warning(
154
+ f"Вакансия без работодателя: {vacancy['alternate_url']}"
155
+ )
156
+ else:
157
+ employer = api.get(f"/employers/{employer_id}")
158
+
159
+ telemetry_data["employers"][employer_id] = {
160
+ "name": employer.get("name"),
161
+ "type": employer.get("type"),
162
+ "description": employer.get("description"),
163
+ "site_url": employer.get("site_url"),
164
+ "area": employer.get("area", {}).get("name"), # город
165
+ }
152
166
 
153
- telemetry_data["employers"][employer_id] = {
154
- "name": employer.get("name"),
155
- "type": employer.get("type"),
156
- "description": employer.get("description"),
157
- "site_url": employer.get("site_url"),
158
- "area": employer.get("area", {}).get("name"), # город
159
- }
160
167
  # Задержка перед отправкой отклика
161
168
  interval = random.uniform(
162
169
  apply_min_interval, apply_max_interval
@@ -242,7 +249,11 @@ class Operation(BaseOperation):
242
249
  "contacts": vacancy.get(
243
250
  "contacts"
244
251
  ), # пиздорванки там телеграм для связи указывают
245
- "employer_id": int(vacancy["employer"]["id"]),
252
+ # HH с точки зрения перфикциониста — кусок говна, где кривые
253
+ # форматы даты, у вакансий может не быть работодателя...
254
+ "employer_id": int(vacancy["employer"]["id"])
255
+ if "employer" in vacancy and "id" in vacancy["employer"]
256
+ else None,
246
257
  # Остальное неинтересно
247
258
  }
248
259
 
@@ -250,7 +261,9 @@ class Operation(BaseOperation):
250
261
  self, telemetry_client, telemetry_data: defaultdict
251
262
  ) -> None:
252
263
  try:
253
- res = telemetry_client.send_telemetry("/collect", dict(telemetry_data))
264
+ res = telemetry_client.send_telemetry(
265
+ "/collect", dict(telemetry_data)
266
+ )
254
267
  logger.debug(res)
255
268
  except TelemetryError as ex:
256
269
  logger.error(ex)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "hh-applicant-tool"
3
- version = "0.3.3"
3
+ version = "0.3.4"
4
4
  description = ""
5
5
  authors = ["Senior YAML Developer <yamldeveloper@proton.me>"]
6
6
  readme = "README.md"