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:
1 parent
a66aac95cf
commit
06eb929eaf
48 files changed
+460
-388
No files matched your search
@@ -18,7 +18,6 @@ from __future__ import annotations
|
||||
|
||||
import html
|
||||
import json
|
||||
import logging
|
||||
from collections.abc import Callable
|
||||
from typing import Any
|
||||
|
||||
@@ -27,8 +26,6 @@ from desk.sources import strip_html
|
||||
from ._contract import Ask, Fields, Reads
|
||||
from ._shared import Row, is_web_url, label_slug_ok, num, only, pay_line, yearly_amount
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
NAME = "pinpoint"
|
||||
LABEL = "Pinpoint"
|
||||
PATTERNS = (r"https?://([a-z0-9-]+)\.pinpointhq\.com",)
|
||||
@@ -39,9 +36,6 @@ READS = Reads(
|
||||
robots="read: robots.txt allows / (checked 2026-09-29)",
|
||||
)
|
||||
|
||||
#: `workplace_type` -> `store._remote`'s words. Anything else says nothing.
|
||||
_REMOTE = {"onsite": "onsite", "on_site": "onsite", "hybrid": "hybrid", "remote": "remote"}
|
||||
|
||||
#: `compensation_frequency` -> the multiplier that makes a figure yearly. The
|
||||
#: spellings are a guess, since no board read so far states pay; a frequency
|
||||
#: not listed leaves the yearly columns empty, and `salary_text` still says it.
|
||||
@@ -51,12 +45,6 @@ _YEARLY = {"annually": 1, "annual": 1, "yearly": 1, "year": 1, "monthly": 12, "m
|
||||
_PERIOD = {"annually": "year", "annual": "year", "yearly": "year", "monthly": "month",
|
||||
"weekly": "week", "daily": "day", "hourly": "hour"}
|
||||
|
||||
#: What `employment_type` (`permanent_full_time`, `fixed_term_full_time`) says,
|
||||
#: the first fragment found deciding, so a contract type beats the hours.
|
||||
_EMPLOYMENT = (("intern", "internship"), ("freelance", "contract"), ("contract", "contract"),
|
||||
("fixed_term", "temporary"), ("temporary", "temporary"),
|
||||
("part_time", "part_time"), ("full_time", "full_time"))
|
||||
|
||||
#: The sections of a posting's text, in the order the page shows them: the
|
||||
#: description, then these fields, each with its own heading in `<field>_header`.
|
||||
_SECTIONS = ("key_responsibilities", "skills_knowledge_expertise", "benefits")
|
||||
@@ -112,16 +100,6 @@ def _place(location: dict[str, Any]) -> str:
|
||||
return ", ".join(parts)
|
||||
|
||||
|
||||
def _employment(code: str) -> str | None:
|
||||
code = code.strip().lower()
|
||||
for fragment, value in _EMPLOYMENT:
|
||||
if fragment in code:
|
||||
return value
|
||||
if code:
|
||||
log.debug("pinpoint: unknown employment_type %r", code)
|
||||
return None
|
||||
|
||||
|
||||
def _pay(j: dict[str, Any]) -> tuple[int | None, int | None, str, str]:
|
||||
"""`(salary_min, salary_max, currency, salary_text)` of a posting whose
|
||||
pay is shown (`compensation_visible`); the free-text `compensation` is the
|
||||
@@ -154,21 +132,21 @@ def parse(body: bytes, slug: str) -> list[Row]:
|
||||
continue
|
||||
job = j.get("job") or {}
|
||||
low, high, currency, salary_text = _pay(j)
|
||||
workplace = str(j.get("workplace_type") or "").strip().lower()
|
||||
workplace = str(j.get("workplace_type") or "").strip()
|
||||
place = _place(j.get("location") or {})
|
||||
out.append({
|
||||
"source_id": source_id,
|
||||
"title": title,
|
||||
"places": [{"text": place, "remote": {"remote": True, "onsite": False,
|
||||
"on_site": False, "hybrid": False}.get(workplace)}]
|
||||
"on_site": False, "hybrid": False}.get(workplace.lower())}]
|
||||
if place else [],
|
||||
"location": place,
|
||||
"url": url,
|
||||
"posted": None, # only the posting's own page has a date
|
||||
"department": str((job.get("department") or {}).get("name") or "").strip(),
|
||||
"description": _text(j),
|
||||
"remote": _REMOTE.get(workplace),
|
||||
"employment": _employment(str(j.get("employment_type") or "")),
|
||||
"remote": workplace or None,
|
||||
"employment": str(j.get("employment_type") or "").strip() or None,
|
||||
"salary_text": salary_text,
|
||||
"salary_min": low,
|
||||
"salary_max": high,
|
||||
|
||||
Reference in new issue
Block a user