Declare READS for Oracle, Personio, Phenom, Pinpoint, Recruitee, Rippling, SmartRecruiters, SuccessFactors, Teamtailor, Workable and Workday
Every row carries places (Personio additionalOffices, Workable and Recruitee locations[], every SuccessFactors address, Workday's own read), the list teaser of Phenom and Oracle is kept in teaser, and the level, employment and country a host states are mapped. Workday "N Locations" and "Country - City", and Recruitee "Remote job", are no longer places. Phenom takes dateCreated as posted. robots_page and ROBOTS_ANY_CASE go; READS.robots records the decision. Signatures are feed_url(slug, ask) and page(get, slug, cursor, ask), with an empty Ask as the default so the runner of today still calls them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4c0da58da7
commit
4316624769
42 files changed
+3126
-199
No files matched your search
+45
-15
@@ -12,14 +12,18 @@ 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 ._contract import Ask, Fields, Place, Reads
|
||||
from ._shared import Get, Row, parse_dt, yearly_amount
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
NAME = "rippling"
|
||||
LABEL = "Rippling"
|
||||
KEEP_CASE = True
|
||||
@@ -28,6 +32,13 @@ PATTERNS = (
|
||||
r"api\.rippling\.com/platform/api/ats/v1/board/([A-Za-z0-9][A-Za-z0-9_-]*)",
|
||||
)
|
||||
|
||||
READS = Reads(
|
||||
scope="board", listing="whole", text="detail", complete="whole", places="many",
|
||||
fields=Fields(pay="figures", posted="trusted", employment="stated"),
|
||||
robots=("read: robots.txt allows /<slug>/jobs on ats.rippling.com, the API host has none "
|
||||
"(checked 2026-09-29)"),
|
||||
)
|
||||
|
||||
_API = "api.rippling.com"
|
||||
_SITE = "ats.rippling.com"
|
||||
|
||||
@@ -35,6 +46,11 @@ _SITE = "ats.rippling.com"
|
||||
#: whole; it is also what discovery's patterns take.
|
||||
_SLUG = re.compile(r"[A-Za-z0-9][A-Za-z0-9_-]*")
|
||||
|
||||
#: The words of `employmentType.label` (`SALARIED_FT`), split at "_".
|
||||
_EMPLOYMENT = {"FT": "full_time", "PT": "part_time", "INTERN": "internship",
|
||||
"INTERNSHIP": "internship", "CONTRACT": "contract", "CONTRACTOR": "contract",
|
||||
"TEMP": "temporary", "TEMPORARY": "temporary", "SEASONAL": "temporary"}
|
||||
|
||||
#: A role's id in the board's own links.
|
||||
_UUID = re.compile(r"[0-9A-Za-z-]{8,64}")
|
||||
|
||||
@@ -51,17 +67,17 @@ def careers_url(slug: str) -> str:
|
||||
return f"https://{_SITE}/{slug}/jobs"
|
||||
|
||||
|
||||
def robots_page(slug: str) -> str:
|
||||
"""The page a person opens. The API host has no robots.txt (a 404, which
|
||||
allows), so the site's is the one that says something."""
|
||||
return careers_url(slug)
|
||||
|
||||
|
||||
def _board(slug: str) -> str:
|
||||
return f"https://{_API}/platform/api/ats/v1/board/{slug}"
|
||||
|
||||
|
||||
def feed_url(slug: str) -> str:
|
||||
def _place(text: str) -> Place:
|
||||
"""A place as the board labels it; "Remote (United States)" is remote, any
|
||||
other label says nothing."""
|
||||
return {"text": text, "remote": True if text.lower().startswith("remote") else None}
|
||||
|
||||
|
||||
def feed_url(slug: str, ask: Ask = Ask()) -> str:
|
||||
return f"{_board(slug)}/jobs"
|
||||
|
||||
|
||||
@@ -69,14 +85,14 @@ def parse(body: bytes, slug: str) -> list[Row]:
|
||||
"""The board's array -> one row per role. The array has one entry per
|
||||
role and place, so a role in three cities is three entries with one
|
||||
`uuid` (Rippling's own board: 638 entries, 326 roles); the rows merge
|
||||
them, the places joined with "; ". The entry has no description, date
|
||||
them, the places kept as a list and joined with "; " for `location`. The entry has no description, date
|
||||
or pay: `detail` reads them. `remote` is True only when every place is a
|
||||
"Remote (...)" one, since a label says nothing else about the work."""
|
||||
data = json.loads(body)
|
||||
if not isinstance(data, list):
|
||||
raise ValueError("not a Rippling board: the answer is not a list")
|
||||
roles: dict[str, Row] = {}
|
||||
places: dict[str, list[str]] = {}
|
||||
places: dict[str, list[Place]] = {}
|
||||
for entry in data:
|
||||
job_id = str(entry.get("uuid") or "").strip()
|
||||
title = (entry.get("name") or "").strip()
|
||||
@@ -84,8 +100,8 @@ def parse(body: bytes, slug: str) -> list[Row]:
|
||||
continue
|
||||
place = str(((entry.get("workLocation") or {}).get("label")) or "").strip()
|
||||
places.setdefault(job_id, [])
|
||||
if place and place not in places[job_id]:
|
||||
places[job_id].append(place)
|
||||
if place and place not in (p["text"] for p in places[job_id]):
|
||||
places[job_id].append(_place(place))
|
||||
roles.setdefault(job_id, {
|
||||
"source_id": job_id,
|
||||
"title": title,
|
||||
@@ -96,12 +112,23 @@ def parse(body: bytes, slug: str) -> list[Row]:
|
||||
"salary_text": "", # the board's list states no pay
|
||||
})
|
||||
for job_id, row in roles.items():
|
||||
row["location"] = "; ".join(places[job_id])
|
||||
row["places"] = places[job_id]
|
||||
row["location"] = "; ".join(p["text"] for p in places[job_id])
|
||||
row["remote"] = True if places[job_id] and all(
|
||||
p.lower().startswith("remote") for p in places[job_id]) else None
|
||||
p["remote"] for p in places[job_id]) else None
|
||||
return list(roles.values())
|
||||
|
||||
|
||||
def _employment(kind: Any) -> str | None:
|
||||
label = str((kind or {}).get("label") or "").strip().upper() if isinstance(kind, dict) else ""
|
||||
for word in label.split("_"):
|
||||
if word in _EMPLOYMENT:
|
||||
return _EMPLOYMENT[word]
|
||||
if label:
|
||||
log.debug("rippling: unknown employmentType %r", label)
|
||||
return None
|
||||
|
||||
|
||||
def detail(get: Get, slug: str, row: Row) -> dict[str, Any]:
|
||||
"""`<board>/jobs/<uuid>`: the description as HTML (`description.role`, or
|
||||
the company's text when a role has none), every place in `workLocations`,
|
||||
@@ -114,8 +141,11 @@ def detail(get: Get, slug: str, row: Row) -> dict[str, Any]:
|
||||
"description": html.unescape(strip_html(text.get("role") or text.get("company") or "")),
|
||||
"posted": parse_dt(data.get("createdOn")),
|
||||
}
|
||||
if places := [p for p in (str(p).strip() for p in data.get("workLocations") or []) if p]:
|
||||
found["location"] = "; ".join(dict.fromkeys(places))
|
||||
if names := [p for p in (str(p).strip() for p in data.get("workLocations") or []) if p]:
|
||||
found["places"] = [_place(name) for name in dict.fromkeys(names)]
|
||||
found["location"] = "; ".join(dict.fromkeys(names))
|
||||
if employment := _employment(data.get("employmentType")):
|
||||
found["employment"] = employment
|
||||
ranges = data.get("payRangeDetails") or []
|
||||
if len(ranges) == 1:
|
||||
pay = ranges[0]
|
||||
|
||||
Reference in new issue
Block a user