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

+2 -5
View File
@@ -19,7 +19,7 @@ from collections.abc import Callable
from typing import Any
from ._contract import Ask, Fields, Filters, Place, Reads
from ._shared import Get, Page, Row, only, parse_dt, path_slug_ok
from ._shared import Get, Page, Row, only, parse_dt, path_slug_ok, table_word
log = logging.getLogger(__name__)
@@ -97,10 +97,7 @@ def parse(body: bytes, slug: str) -> list[Row]:
def _word(job: dict[str, Any], key: str, table: dict[str, str]) -> str | None:
"""The `id` of the object `job[key]` looked up in `table`; none for a word
the table maps to none, and a word it does not know is logged."""
word = str((job.get(key) or {}).get("id") or "").strip().lower()
if word and word not in table:
log.debug("smartrecruiters: unknown %s %r", key, word)
return table.get(word) or None
return table_word(table, (job.get(key) or {}).get("id"), log, key)
def rows(data: dict[str, Any], slug: str) -> list[Row]: