Readers ashby to lever hand on the host's words; their word tables move to app/prep/hosts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Opus 5.5 committed 2026-09-30 10:54:19 +02:00
1 parent a66aac95cf
commit 6c7ce1090d
37 files changed
+504 -171

No files matched your search

+3 -14
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, table_word, yearly_amount
from ._shared import Get, Page, label_slug_ok, num, only, parse_dt, pay_line, yearly_amount
log = logging.getLogger(__name__)
@@ -38,21 +38,10 @@ READS = Reads(
"app's index page with no rules (checked 2026-09-29)",
)
#: `employmentType`, the company's own name for it -> the app's employment
#: words. "Permanent" says nothing about hours and stays unmapped.
_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": "internship", "internship": "internship", "freelance": "freelance"}
NAME = "hibob"
LABEL = "HiBob"
PATTERNS = (r"https?://([a-z0-9-]+)\.careers\.hibob\.com",)
#: HiBob's `workspaceTypeId` -> `store._remote`'s words.
_REMOTE = {"remote": "remote", "hybrid": "hybrid", "on_site": "onsite", "onsite": "onsite"}
#: The texts of an ad, in the order the ad shows them.
_SECTIONS = ("description", "responsibilities", "requirements", "benefits")
@@ -126,13 +115,13 @@ def rows(data: dict[str, Any], slug: str) -> list[Row]:
"posted": parse_dt(ad.get("publishedAt")),
"department": str(ad.get("department") or "").strip(),
"description": " ".join(html.unescape(text).split()),
"remote": _REMOTE.get(str(ad.get("workspaceTypeId") or "").strip().lower()),
"remote": str(ad.get("workspaceTypeId") or "").strip() or None,
"salary_text": pay_line(lo, hi, currency, period),
"salary_min": salary_min,
"salary_max": salary_max,
"currency": code,
}
if employment := table_word(_EMPLOYMENT, ad.get("employmentType"), log, "employmentType"):
if employment := str(ad.get("employmentType") or "").strip():
row["employment"] = employment
out.append(row)
return out