Readers oracle to workday and the providers 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 11:07:07 +02:00
1 parent a66aac95cf
commit 06eb929eaf
48 files changed
+460 -388

No files matched your search

+9 -30
View File
@@ -7,16 +7,13 @@ Personio.
from __future__ import annotations
import logging
import xml.etree.ElementTree as ET
from collections.abc import Callable
from desk.sources import strip_html
from ._contract import Ask, Fields, Place, Reads
from ._shared import Row, add_place, label_slug_ok, num, only, parse_dt, pay_line, place, table_word, yearly_amount
log = logging.getLogger(__name__)
from ._shared import Row, add_place, label_slug_ok, num, only, parse_dt, pay_line, place, yearly_amount
NAME = "personio"
LABEL = "Personio"
@@ -30,19 +27,6 @@ READS = Reads(
robots="api: no robots.txt check needed (public board API), 2026-09-30",
)
#: `seniority` -> the app's levels. `experienced` is what most roles say and
#: names no level, so it is known and maps to none; a word not listed is
#: logged at debug level so the table can grow.
_SENIORITY = {"entry-level": "junior", "student": "intern", "executive": "exec",
"experienced": ""}
#: `employmentType` when it is not the usual permanent contract, to the app's
#: employment words; `permanent` says nothing about the hours, so `schedule`
#: decides then.
_CONTRACT = {"temporary": "temporary", "freelance": "contract", "intern": "internship",
"working_student": "internship", "trainee": "internship"}
_SCHEDULE = {"full-time": "full_time", "part-time": "part_time"}
#: Personio's `salaryInformation/type` spellings, to the plain period word
#: `pay_line` wants ("yearly" -> "year"). Anything else is passed through.
_PERIODS = {"yearly": "year", "monthly": "month", "hourly": "hour",
@@ -85,18 +69,14 @@ def _salary_text(salary_info: ET.Element) -> str:
salary_info.findtext("currencyCode"), period)
def _seniority(word: str) -> str | None:
return table_word(_SENIORITY, word, log, "seniority")
def _employment(position: ET.Element) -> str | None:
contract = (position.findtext("employmentType") or "").strip().lower()
schedule = (position.findtext("schedule") or "").strip().lower()
if contract in _CONTRACT:
return _CONTRACT[contract]
if contract and contract != "permanent":
log.debug("personio: unknown employmentType %r", contract)
return _SCHEDULE.get(schedule)
"""The host's word for the contract, or, for a `permanent` one (which says
nothing about the hours), the `schedule`."""
contract = (position.findtext("employmentType") or "").strip()
schedule = (position.findtext("schedule") or "").strip()
if contract.lower() in ("", "permanent") and schedule:
return schedule
return contract or None
def _places(position: ET.Element) -> list[Place]:
@@ -148,8 +128,7 @@ def parse(body: bytes, slug: str) -> list[Row]:
"posted": parse_dt(position.findtext("createdAt")),
"department": (position.findtext("department") or "").strip(),
"description": strip_html(description),
"remote": any(p["remote"] for p in places) or None,
"seniority": _seniority(position.findtext("seniority") or ""),
"seniority": (position.findtext("seniority") or "").strip() or None,
"employment": _employment(position),
"salary_text": salary_text,
"salary_min": salary_min,