Share the readers' place, table-lookup and country helpers, unify the employment vocabulary, and list the enrich switch with the stages

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Opus 5.5 committed 2026-09-30 10:13:24 +02:00
1 parent ca80219bbb
commit 903b69b6d3
34 files changed
+290 -207

No files matched your search

+4 -8
View File
@@ -23,7 +23,7 @@ from typing import Any
from desk.sources import strip_html
from ._contract import Ask, Fields, Reads, Row
from ._shared import Get, Page, label_slug_ok, num, only, parse_dt, pay_line, yearly_amount
from ._shared import Get, Page, label_slug_ok, num, only, parse_dt, pay_line, table_word, yearly_amount
log = logging.getLogger(__name__)
@@ -44,7 +44,7 @@ _EMPLOYMENT = {"regular full time": "full_time", "full time": "full_time",
"full-time": "full_time", "regular part time": "part_time",
"part time": "part_time", "part-time": "part_time", "contract": "contract",
"contractor": "contract", "temporary": "temporary", "fixed term": "temporary",
"intern": "intern", "internship": "intern", "freelance": "freelance"}
"intern": "internship", "internship": "internship", "freelance": "freelance"}
NAME = "hibob"
LABEL = "HiBob"
@@ -132,11 +132,7 @@ def rows(data: dict[str, Any], slug: str) -> list[Row]:
"salary_max": salary_max,
"currency": code,
}
kind = str(ad.get("employmentType") or "").strip()
if kind:
if employment := _EMPLOYMENT.get(kind.lower()):
row["employment"] = employment
else:
log.debug("hibob: unknown employmentType %r", kind)
if employment := table_word(_EMPLOYMENT, ad.get("employmentType"), log, "employmentType"):
row["employment"] = employment
out.append(row)
return out