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:
1 parent
a66aac95cf
commit
6c7ce1090d
37 files changed
+504
-171
No files matched your search
@@ -17,14 +17,13 @@ from __future__ import annotations
|
||||
|
||||
import json
|
||||
import logging
|
||||
import re
|
||||
from collections.abc import Callable
|
||||
from typing import Any
|
||||
|
||||
from desk.sources import strip_html
|
||||
|
||||
from ._contract import Ask, Fields, Place, Reads, Row
|
||||
from ._shared import add_place, is_web_url, num, only, parse_dt, path_slug_ok, pay_line, place, table_word, yearly_amount
|
||||
from ._shared import add_place, is_web_url, num, only, parse_dt, path_slug_ok, pay_line, place, yearly_amount
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -36,13 +35,6 @@ READS = Reads(
|
||||
robots="api: no robots.txt check needed (public board API), 2026-09-30",
|
||||
)
|
||||
|
||||
#: `categories.commitment` -> the app's employment words. A commitment is free
|
||||
#: text on Lever ("Permanent" is seen too and says nothing about hours).
|
||||
_EMPLOYMENT = {"full-time": "full_time", "full time": "full_time", "fulltime": "full_time",
|
||||
"part-time": "part_time", "part time": "part_time", "parttime": "part_time",
|
||||
"intern": "internship", "internship": "internship", "contract": "contract",
|
||||
"contractor": "contract", "temporary": "temporary", "freelance": "freelance"}
|
||||
|
||||
NAME = "lever"
|
||||
LABEL = "Lever"
|
||||
RANK = 20
|
||||
@@ -153,10 +145,10 @@ def parse(body: bytes, slug: str) -> list[Row]:
|
||||
}
|
||||
# `country` is one code, for a role at one place; over several it would
|
||||
# gate the others by the first's country.
|
||||
country = str(j.get("country") or "").strip().upper()
|
||||
if len(places) == 1 and re.fullmatch(r"[A-Z]{2}", country):
|
||||
country = str(j.get("country") or "").strip()
|
||||
if len(places) == 1 and country:
|
||||
row["country"] = country
|
||||
if employment := table_word(_EMPLOYMENT, categories.get("commitment"), log, "commitment"):
|
||||
if employment := str(categories.get("commitment") or "").strip():
|
||||
row["employment"] = employment
|
||||
rows.append(row)
|
||||
return rows
|
||||
Reference in new issue
Block a user