Hosts a to l declare READS: places, teaser, stated seniority and employment

Ashby, BambooHR, Deel, Eightfold, Gem, Greenhouse, HiBob, HR Manager, Jibe,
Jobylon and Lever move to feed_url(slug, ask) and page(get, slug, cursor, ask),
declare READS with the robots decision, and drop robots_page. Rows carry
places (Ashby secondaryLocations, Lever allLocations, Greenhouse offices in
place of a Hybrid placeholder), Jobylon keeps its summary as teaser and maps
experience and employment, Eightfold reads creationTs as the posting date and
Ashby reads workplaceType. Fixtures <name>-places.* and jobylon-teaser.html
drive the conformance checks; the eleven names leave UNDECLARED.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Opus 5.5 committed 2026-09-30 09:11:53 +02:00
1 parent 4c0da58da7
commit f2e652a8da
35 files changed
+1290 -391

No files matched your search

+46 -8
View File
@@ -16,12 +16,31 @@ from __future__ import annotations
import html
import json
import logging
import re
from collections.abc import Callable
from typing import Any
from desk.sources import strip_html
from ._shared import Get, Row, label_slug_ok, only, parse_dt
from ._contract import Ask, Fields, Place, Reads, Row
from ._shared import Get, label_slug_ok, only, parse_dt
log = logging.getLogger(__name__)
READS = Reads(
scope="board", listing="whole", text="detail", complete="whole",
places="one",
fields=Fields(posted="trusted", remote="stated", employment="stated"),
robots="read: robots.txt allows /careers (checked 2026-09-29)",
)
#: `employmentStatusLabel` -> the app's employment words. BambooHR's labels are
#: the company's own ("Full-Time", "Part-Time", "Contract", "Intern").
_EMPLOYMENT = {"full-time": "full_time", "full time": "full_time", "part-time": "part_time",
"part time": "part_time", "contract": "contract", "contractor": "contract",
"temporary": "temporary", "intern": "intern", "internship": "intern",
"freelance": "freelance"}
NAME = "bamboohr"
LABEL = "BambooHR"
@@ -54,11 +73,7 @@ def careers_url(slug: str) -> str:
return f"https://{host(slug)}/careers"
def robots_page(slug: str) -> str:
return careers_url(slug)
def feed_url(slug: str) -> str:
def feed_url(slug: str, ask: Ask) -> str:
return f"https://{host(slug)}/careers/list"
@@ -79,6 +94,23 @@ def _place(j: dict[str, Any]) -> str:
return ", ".join(str(p).strip() for p in parts if p and str(p).strip())
def _places(j: dict[str, Any]) -> list[Place]:
"""The one place BambooHR states, if it states any."""
text = _place(j)
return [{"text": text, "remote": True if re.search(r"\bremote\b", text, re.I) else None}] \
if text else []
def _employment(j: dict[str, Any]) -> str | None:
label = str(j.get("employmentStatusLabel") or "").strip()
if not label:
return None
found = _EMPLOYMENT.get(label.lower())
if found is None:
log.debug("bamboohr: unknown employmentStatusLabel %r", label)
return found
def parse(body: bytes, slug: str) -> list[Row]:
"""`/careers/list` -> `{"meta": {"totalCount": n}, "result": [...]}`. A
role has `id`, `jobOpeningName`, `departmentLabel`, `location` (`city`,
@@ -99,9 +131,11 @@ def parse(body: bytes, slug: str) -> list[Row]:
source_id = str(j.get("id") or "")
if not title or not source_id:
continue
out.append({
places = _places(j)
row: Row = {
"source_id": source_id,
"title": title,
"places": places,
"location": _place(j),
"url": f"https://{host(slug)}/careers/{source_id}",
"posted": None,
@@ -109,7 +143,10 @@ def parse(body: bytes, slug: str) -> list[Row]:
"description": "",
"remote": _remote(j),
"salary_text": "", # the list states no pay; the detail's `compensation` was null
})
}
if employment := _employment(j):
row["employment"] = employment
out.append(row)
return out
@@ -130,6 +167,7 @@ def detail(get: Get, slug: str, row: Row) -> dict[str, Any]:
}
if place := _place(opening):
out["location"] = place
out["places"] = _places(opening)
if remote := _remote(opening):
out["remote"] = remote
return out