diff --git a/plugins/readers/oracle.py b/plugins/readers/oracle.py index 1e44cb6..e75057a 100644 --- a/plugins/readers/oracle.py +++ b/plugins/readers/oracle.py @@ -21,6 +21,7 @@ from urllib.parse import quote from desk.sources import strip_html +from ._contract import Ask, Fields, Place, Reads from ._shared import Get, Page, Row, only, parse_dt NAME = "oracle" @@ -38,6 +39,14 @@ PATTERNS = ( r"oraclecloud\.(?:com|eu)/hcmUI(?!/CandidateExperience/[A-Za-z_-]+/sites/)", ) +READS = Reads( + scope="board", listing="paged", page_size=200, text="detail", teaser=True, + complete="stated", places="many", + fields=Fields(posted="trusted", remote="stated", country="stated"), + robots=("read: robots.txt allows /hcmUI/CandidateExperience/en/sites//jobs " + "(checked 2026-09-29)"), +) + #: The page size asked for. 200 was answered in full by Nokia (600 roles in #: three calls of about 360 KB, 2026-09-29); the cursor advances by what a page #: returned, so a tenant that caps `limit` lower would not skip a role. @@ -77,15 +86,11 @@ def careers_url(slug: str) -> str: return f"{_base(slug)}/jobs" -def robots_page(slug: str) -> str: - return careers_url(slug) - - def _api(slug: str) -> str: return f"https://{_parts(slug)[0]}/hcmRestApi/resources/latest" -def page(get: Get, slug: str, cursor: Any) -> Page: +def page(get: Get, slug: str, cursor: Any, ask: Ask = Ask()) -> Page: """One page of `recruitingCEJobRequisitions`. The answer's outer `count`, `hasMore` and `limit` describe the one search wrapper in `items`, so the total (`TotalJobsCount`) and the roles (`requisitionList`) are read from @@ -135,22 +140,32 @@ def rows(search: dict[str, Any], slug: str) -> list[Row]: # The id goes into a URL, and a listing is external content. if not title or not re.fullmatch(r"[A-Za-z0-9_-]+", role_id): continue - places: list[str] = [] - for name in (_text(role.get("PrimaryLocation")), - *(_text(s.get("Name")) for s in role.get("secondaryLocations") or [] - if isinstance(s, dict))): - if name and name not in places: - places.append(name) + remote = _REMOTE.get(_text(role.get("WorkplaceTypeCode")).lower()) + places: list[Place] = [] + codes: set[str] = set() + secondary = [s for s in role.get("secondaryLocations") or [] if isinstance(s, dict)] + for name, code in ((_text(role.get("PrimaryLocation")), + _text(role.get("PrimaryLocationCountry"))), + *((_text(s.get("Name")), _text(s.get("CountryCode"))) + for s in secondary)): + if name and name not in (p["text"] for p in places): + places.append({"text": name, "remote": {"remote": True, "hybrid": False, + "onsite": False}.get(remote or "")}) + if code: + codes.add(code.upper()) out.append({ "source_id": role_id, "title": title, - "location": "; ".join(places), + "places": places, + "location": "; ".join(p["text"] for p in places), "url": f"{_base(slug)}/job/{role_id}", "posted": parse_dt(role.get("PostedDate")), "department": (_text(role.get("JobFamily")) or _text(role.get("JobFunction")) or _text(role.get("Department")) or _text(role.get("Organization"))), - "description": _plain(role.get("ShortDescriptionStr")), - "remote": _REMOTE.get(_text(role.get("WorkplaceTypeCode")).lower()), + "description": "", + "teaser": _plain(role.get("ShortDescriptionStr")), + "country": next(iter(codes)) if len(codes) == 1 else None, + "remote": remote, "salary_text": "", # the resource states no pay }) return out diff --git a/plugins/readers/personio.py b/plugins/readers/personio.py index 0e1116c..8427b89 100644 --- a/plugins/readers/personio.py +++ b/plugins/readers/personio.py @@ -7,18 +7,42 @@ 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, label_slug_ok, num, only, parse_dt, pay_line, yearly_amount +log = logging.getLogger(__name__) + NAME = "personio" LABEL = "Personio" RANK = 70 PATTERNS = (r"https?://([a-z0-9-]+)\.jobs\.personio\.(?:de|com)",) +READS = Reads( + scope="board", listing="whole", text="listing", complete="whole", + places="many", + fields=Fields(pay="figures", posted="trusted", seniority="stated", employment="stated"), + 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", @@ -39,7 +63,7 @@ def careers_url(slug: str) -> str: return f"https://{slug}.jobs.personio.de" -def feed_url(slug: str) -> str: +def feed_url(slug: str, ask: Ask = Ask()) -> str: return f"https://{slug}.jobs.personio.de/xml" @@ -61,10 +85,46 @@ def _salary_text(salary_info: ET.Element) -> str: salary_info.findtext("currencyCode"), period) +def _seniority(word: str) -> str | None: + key = word.strip().lower() + if key not in _SENIORITY: + if key: + log.debug("personio: unknown seniority %r", word) + return None + return _SENIORITY[key] or None + + +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) + + +def _places(position: ET.Element) -> list[Place]: + """The `office` and every `additionalOffices/office`, each once. The feed + has no remote flag; an office named "Remote" or "Berlin (Remote)" is + remote, any other says nothing.""" + found: list[Place] = [] + names = [position.findtext("office"), + *(o.text for o in position.findall("additionalOffices/office"))] + for name in names: + text = (name or "").strip() + if text and text not in (p["text"] for p in found): + found.append({"text": text, "remote": True if "remote" in text.lower() else None}) + return found + + def parse(body: bytes, slug: str) -> list[Row]: """`{slug}.jobs.personio.de/xml` -> `...`. No job URL in the feed itself; Personio's own page is `/job/{id}`, confirmed - live against a real posting (2026-09-23).""" + live against a real posting (2026-09-23). `additionalOffices` lists the + other places of a role (116 of 320 at the three boards read); `seniority` + is one of entry-level, experienced, executive, student, and `schedule` and + `employmentType` state the hours and the contract.""" root = ET.fromstring(body) rows = [] for position in root.findall("position"): @@ -84,15 +144,19 @@ def parse(body: bytes, slug: str) -> list[Row]: salary_info.findtext("currencyCode"), salary_info.findtext("type"), {"yearly": 1, "monthly": 12}) salary_text = _salary_text(salary_info) + places = _places(position) rows.append({ "source_id": job_id, "title": title, - "location": (position.findtext("office") or "").strip(), + "places": places, + "location": "; ".join(p["text"] for p in places), "url": f"https://{slug}.jobs.personio.de/job/{job_id}", "posted": parse_dt(position.findtext("createdAt")), "department": (position.findtext("department") or "").strip(), "description": strip_html(description), - "remote": "remote" in (position.findtext("office") or "").lower() or None, + "remote": any(p["remote"] for p in places) or None, + "seniority": _seniority(position.findtext("seniority") or ""), + "employment": _employment(position), "salary_text": salary_text, "salary_min": salary_min, "salary_max": salary_max, diff --git a/plugins/readers/phenom.py b/plugins/readers/phenom.py index 260a6d4..aaeb916 100644 --- a/plugins/readers/phenom.py +++ b/plugins/readers/phenom.py @@ -21,6 +21,7 @@ from typing import Any from desk.sources import strip_html +from ._contract import Ask, Fields, Place, Reads from ._shared import Get, Page, Row, only, parse_dt NAME = "phenom" @@ -34,6 +35,12 @@ PATTERNS = ( r"phenompeople\.com|phenom\.com/careers", ) +READS = Reads( + scope="board", listing="paged", page_size=100, text="detail", teaser=True, + complete="stated", places="many", fields=Fields(posted="trusted", remote="stated"), + robots="read: robots.txt allows ///search-results (checked 2026-09-29)", +) + #: The page size asked for. 100 is what the site's own search sends; `size` #: 200 was answered in full by Just Eat Takeaway and 500 by Philips (of 865), #: but a page is 340 KB at 100 roles already. @@ -70,10 +77,6 @@ def careers_url(slug: str) -> str: return f"{_root(slug)}/search-results" -def robots_page(slug: str) -> str: - return careers_url(slug) - - def _body(slug: str, offset: int) -> dict[str, Any]: """What the site's search page sends for a listing of every role, newest first, less the parts that only tell the page what to draw. `lang` is @@ -99,7 +102,7 @@ def _key(job: dict[str, Any]) -> str: return str(job.get("jobSeqNo") or job.get("jobId") or job.get("reqId") or "").strip() -def page(get: Get, slug: str, cursor: Any) -> Page: +def page(get: Get, slug: str, cursor: Any, ask: Ask = Ask()) -> Page: offset = int(cursor or 0) host = _parts(slug)[0] data = json.loads(get(f"https://{host}/widgets", method="POST", @@ -133,10 +136,12 @@ def _slug_of(title: str) -> str: def rows(search: dict[str, Any], slug: str) -> list[Row]: """The roles of one page, `refineSearch.data.jobs`. A role has the title, - `jobSeqNo`, `postedDate` (a date at midnight), `category`, the locations - as `multi_location` (a list, one per place) beside `location` (the first), - and `descriptionTeaser`, the first paragraph of the text; the full text is - on the role's page, see `detail`. `applyUrl` points at the apply system + `jobSeqNo`, `dateCreated` (the posting) beside `postedDate` (a date at + midnight that the site moves when it refreshes a role: King's "12mth FTC" + role, created in June, says 28 September), `category`, the locations as + `multi_location` (a list, one per place) beside `location` (the first), + and `descriptionTeaser`, the first paragraph of the text, kept as `teaser`; + the full text is on the role's page, see `detail`. `applyUrl` points at the apply system (Workday for Just Eat Takeaway and Philips), so the role's URL is its page on the site. No remote flag and no pay are in the list.""" out = [] @@ -145,19 +150,22 @@ def rows(search: dict[str, Any], slug: str) -> list[Row]: title = _text(job.get("title")) if not title or not key: continue - places: list[str] = [] - for place in (*(job.get("multi_location") or []), job.get("location")): - if isinstance(place, str) and place.strip() and place.strip() not in places: - places.append(place.strip()) + places: list[Place] = [] + for place in (job.get("location"), *(job.get("multi_location") or [])): + if isinstance(place, str) and place.strip() \ + and place.strip() not in (p["text"] for p in places): + places.append({"text": place.strip(), "remote": None}) tail = _slug_of(title) out.append({ "source_id": key, "title": title, - "location": "; ".join(places), + "places": places, + "location": "; ".join(p["text"] for p in places), "url": f"{_root(slug)}/job/{key}" + (f"/{tail}" if tail else ""), - "posted": parse_dt(job.get("postedDate")), + "posted": parse_dt(job.get("dateCreated") or job.get("postedDate")), "department": _text(job.get("category")), - "description": _plain(job.get("descriptionTeaser")), + "description": "", + "teaser": _plain(job.get("descriptionTeaser")), "remote": None, # the list does not say "salary_text": "", # nor does it state pay }) diff --git a/plugins/readers/pinpoint.py b/plugins/readers/pinpoint.py index dd6bd2e..15cf6e3 100644 --- a/plugins/readers/pinpoint.py +++ b/plugins/readers/pinpoint.py @@ -18,17 +18,27 @@ from __future__ import annotations import html import json +import logging from collections.abc import Callable from typing import Any 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",) +READS = Reads( + scope="board", listing="whole", text="listing", complete="whole", places="one", + fields=Fields(pay="figures", remote="stated", employment="stated"), + 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"} @@ -41,6 +51,12 @@ _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 `_header`. _SECTIONS = ("key_responsibilities", "skills_knowledge_expertise", "benefits") @@ -62,11 +78,7 @@ def careers_url(slug: str) -> str: return f"https://{host(slug)}/" -def robots_page(slug: str) -> str: - return careers_url(slug) - - -def feed_url(slug: str) -> str: +def feed_url(slug: str, ask: Ask = Ask()) -> str: return f"https://{host(slug)}/postings.json" @@ -100,6 +112,16 @@ 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 @@ -132,15 +154,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() + place = _place(j.get("location") or {}) out.append({ "source_id": source_id, "title": title, - "location": _place(j.get("location") or {}), + "places": [{"text": place, "remote": {"remote": True, "onsite": False, + "on_site": False, "hybrid": False}.get(workplace)}] + 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(str(j.get("workplace_type") or "").strip().lower()), + "remote": _REMOTE.get(workplace), + "employment": _employment(str(j.get("employment_type") or "")), "salary_text": salary_text, "salary_min": low, "salary_max": high, diff --git a/plugins/readers/recruitee.py b/plugins/readers/recruitee.py index 81e9903..127158c 100644 --- a/plugins/readers/recruitee.py +++ b/plugins/readers/recruitee.py @@ -8,18 +8,45 @@ Recruitee. from __future__ import annotations import json +import logging 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 Row, is_web_url, label_slug_ok, num, only, parse_dt, pay_line, yearly_amount +log = logging.getLogger(__name__) + NAME = "recruitee" LABEL = "Recruitee" RANK = 60 PATTERNS = (r"https?://([a-z0-9-]+)\.recruitee\.com",) +READS = Reads( + scope="board", listing="whole", text="listing", complete="whole", + places="many", + fields=Fields(pay="figures", posted="trusted", remote="stated", country="stated", + seniority="stated", employment="stated"), + robots="api: no robots.txt check needed (public board API), 2026-09-30", +) + +#: `experience_code` -> the app's levels. `experienced` names no level and is +#: known, so it maps to none; a word not listed is logged at debug level. +_SENIORITY = {"student_school": "intern", "entry_level": "junior", "mid_level": "mid", + "experienced": ""} + +#: The words of `employment_type_code` (`fulltime_permanent`), the first that +#: is found deciding, so a contract type beats the hours. +_EMPLOYMENT = (("internship", "internship"), ("intern", "internship"), + ("freelance", "contract"), ("contract", "contract"), + ("temporary", "temporary"), ("fixed", "temporary"), + ("parttime", "part_time"), ("fulltime", "full_time")) + +#: What the board writes as a place for a role that is worked anywhere. +_NO_PLACE = ("remote job",) + def slug_ok(slug: str) -> bool: return label_slug_ok(slug) @@ -35,7 +62,7 @@ def careers_url(slug: str) -> str: return f"https://{slug}.recruitee.com" -def feed_url(slug: str) -> str: +def feed_url(slug: str, ask: Ask = Ask()) -> str: return f"https://{slug}.recruitee.com/api/offers/" @@ -55,7 +82,63 @@ def _salary_text(salary: dict[str, Any]) -> str: salary.get("currency"), period) +def _seniority(code: str) -> str | None: + key = code.strip().lower() + if key not in _SENIORITY: + if key: + log.debug("recruitee: unknown experience_code %r", code) + return None + return _SENIORITY[key] or None + + +def _employment(code: str) -> str | None: + words = set(code.strip().lower().replace("-", "_").split("_")) + for word, value in _EMPLOYMENT: + if word in words: + return value + if code.strip(): + log.debug("recruitee: unknown employment_type_code %r", code) + return None + + +def _places(offer: dict[str, Any]) -> tuple[list[Place], set[str]]: + """Every place of an offer and the countries' codes among them. `locations` + lists them (city, state, country), `location` is the first as one line and + is the fallback for an offer that lists none. The board writes "Remote + job" where an offer has no place: that is not one, and a remote offer with + no other place has the place "Remote".""" + found: list[Place] = [] + codes: set[str] = set() + + def add(text: str) -> None: + text = text.strip() + if text and text.lower() not in _NO_PLACE and text not in (p["text"] for p in found): + found.append({"text": text, "remote": None}) + + for loc in offer.get("locations") or []: + if not isinstance(loc, dict): + continue + parts: list[str] = [] + for part in (loc.get("city") or loc.get("name"), loc.get("state"), loc.get("country")): + part = str(part or "").strip() + if part and part not in parts: + parts.append(part) + add(", ".join(parts)) + if code := str(loc.get("country_code") or "").strip().upper(): + codes.add(code) + if not found: + add(str(offer.get("location") or offer.get("city") or "")) + if code := str(offer.get("country_code") or "").strip().upper(): + codes.add(code) + if not found and offer.get("remote"): + found.append({"text": "Remote", "remote": True}) + return found, codes + + def parse(body: bytes, slug: str) -> list[Row]: + """`{slug}.recruitee.com/api/offers/` -> `{"offers": [...]}`. An offer has + `locations` (a list; 9 of 16 at bunq have two or three), `remote`, + `experience_code` and `employment_type_code`, and the salary object.""" data = json.loads(body) rows = [] for j in data.get("offers") or []: @@ -67,10 +150,12 @@ def parse(body: bytes, slug: str) -> list[Row]: salary_min, salary_max, currency = yearly_amount( salary.get("min"), salary.get("max"), salary.get("currency"), salary.get("period"), {"year": 1, "month": 12}) + places, codes = _places(j) rows.append({ "source_id": str(j.get("id") or ""), "title": title, - "location": (j.get("location") or j.get("city") or "").strip(), + "places": places, + "location": "; ".join(p["text"] for p in places), "url": url, "posted": parse_dt(j.get("published_at") or j.get("created_at")), "department": (j.get("department") or "").strip(), @@ -80,5 +165,8 @@ def parse(body: bytes, slug: str) -> list[Row]: "salary_min": salary_min, "salary_max": salary_max, "currency": currency, + "country": next(iter(codes)) if len(codes) == 1 else None, + "seniority": _seniority(str(j.get("experience_code") or "")), + "employment": _employment(str(j.get("employment_type_code") or "")), }) return rows diff --git a/plugins/readers/rippling.py b/plugins/readers/rippling.py index a8e81f0..171d4e8 100644 --- a/plugins/readers/rippling.py +++ b/plugins/readers/rippling.py @@ -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 //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]: """`/jobs/`: 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] diff --git a/plugins/readers/smartrecruiters.py b/plugins/readers/smartrecruiters.py index 62d2633..021cc0f 100644 --- a/plugins/readers/smartrecruiters.py +++ b/plugins/readers/smartrecruiters.py @@ -8,11 +8,15 @@ SmartRecruiters. from __future__ import annotations import json +import logging from collections.abc import Callable from typing import Any +from ._contract import Ask, Fields, Place, Reads from ._shared import Get, Page, Row, only, parse_dt, path_slug_ok +log = logging.getLogger(__name__) + NAME = "smartrecruiters" LABEL = "SmartRecruiters" RANK = 50 @@ -20,8 +24,28 @@ PATTERNS = ( r"(?:jobs|careers|api)\.smartrecruiters\.com/(?:v1/companies/)?([A-Za-z0-9_-]+)", ) +#: An unknown identifier answers an empty list, which is `empty="suspect"`. +READS = Reads( + scope="board", listing="paged", page_size=100, text="none", complete="stated", + places="one", empty="suspect", + fields=Fields(posted="trusted", remote="stated", country="stated", seniority="stated", + employment="stated"), + robots="api: no robots.txt check needed (public board API), 2026-09-30", +) + _API = "api.smartrecruiters.com" +#: `experienceLevel.id` -> the app's levels. The three in the middle name no +#: level ("associate" is half of Bosch's roles) and are known, so they map to +#: none; an id not listed is logged at debug level. +_SENIORITY = {"internship": "intern", "entry_level": "junior", "director": "director", + "executive": "exec", "associate": "", "mid_senior_level": "", + "not_applicable": ""} + +#: `typeOfEmployment.id` -> the app's employment words. +_EMPLOYMENT = {"permanent": "", "intern": "internship", "temporary": "temporary", + "contract": "contract", "part_time": "part_time", "full_time": "full_time"} + #: The page size asked for, which is also the most the host serves per page. PAGE_SIZE = 100 @@ -48,7 +72,7 @@ def probe_ok(body: bytes) -> bool: return b'"totalFound":' in body and b'"totalFound":0' not in body -def page(get: Get, slug: str, cursor: Any) -> Page: +def page(get: Get, slug: str, cursor: Any, ask: Ask = Ask()) -> Page: offset = int(cursor or 0) data = json.loads(get(f"https://{_API}/v1/companies/{slug}/postings" f"?offset={offset}&limit={PAGE_SIZE}")) @@ -60,13 +84,24 @@ def parse(body: bytes, slug: str) -> list[Row]: return rows(json.loads(body), slug) +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 + + def rows(data: dict[str, Any], slug: str) -> list[Row]: """One page of https://api.smartrecruiters.com/v1/companies/{slug}/postings -> `{"offset", "limit", "totalFound", "content": [...]}`. At most 100 a page, whatever `limit` asks for; the next is `?offset=` further on. The list omits the job description (only the per-posting detail endpoint has it, and fetching one per row would be hundreds of extra requests per - board), so `description` stays empty here.""" + board), so `description` stays empty here. A posting has one location, + its `country` a lower-case ISO code, `experienceLevel` and + `typeOfEmployment` (an `id` and a `label` each).""" out = [] for j in data.get("content") or []: title = (j.get("name") or "").strip() @@ -76,15 +111,24 @@ def rows(data: dict[str, Any], slug: str) -> list[Row]: location = j.get("location") or {} loc_text = (location.get("fullLocation") or ", ".join(p for p in (location.get("city"), location.get("country")) if p)) + # `fullLocation` writes an empty region as ", ,": "Hatvan, , Hungary". + loc_text = ", ".join(part.strip() for part in (loc_text or "").split(",") + if part.strip()) + place: Place = {"text": loc_text, "remote": location.get("remote")} + country = str(location.get("country") or "").strip().upper() out.append({ "source_id": job_id, "title": title, - "location": (loc_text or "").strip(), + "places": [place] if loc_text else [], + "location": loc_text, "url": f"https://jobs.smartrecruiters.com/{slug}/{job_id}", "posted": parse_dt(j.get("releasedDate")), "department": ((j.get("department") or {}).get("label") or "").strip(), "description": "", "remote": location.get("remote"), "salary_text": "", # SmartRecruiters' list endpoint states no pay at all + "country": country if len(country) == 2 else None, + "seniority": _word(j, "experienceLevel", _SENIORITY), + "employment": _word(j, "typeOfEmployment", _EMPLOYMENT), }) return out diff --git a/plugins/readers/successfactors.py b/plugins/readers/successfactors.py index 348bfaa..c9feb57 100644 --- a/plugins/readers/successfactors.py +++ b/plugins/readers/successfactors.py @@ -35,7 +35,8 @@ country filter in this version. A role's own page carries microdata (`itemtype` schema.org JobPosting) with `datePosted` and the address; `detail` reads the description, the date and the -location with its country from it. Novo Nordisk's pages have none: the +places with their country from it; a role at several places repeats the +`jobLocation` block, once per place. Novo Nordisk's pages have none: the description is still in `itemprop="description"`, and the listing's date and location stand. """ @@ -51,6 +52,7 @@ from urllib.parse import urljoin, urlsplit from desk.sources import strip_html +from ._contract import Ask, Fields, Place, Reads from ._shared import Get, Page, Row, is_web_url, only, parse_dt NAME = "successfactors" @@ -75,6 +77,12 @@ PATTERNS = ( # robots.txt rules that name it. KEEP_CASE = True +READS = Reads( + scope="board", listing="paged", text="detail", complete="stated", places="many", + fields=Fields(posted="trusted", country="stated"), + robots="read: robots.txt allows /search/ and /job/ (checked 2026-09-29)", +) + #: A public DNS name in lower case with a letter-only last label, so an address #: (`127.0.0.1`) or a single word (`localhost`) never names a site, and an #: optional prefix of one or more path segments. `ats._get` refuses the local @@ -182,10 +190,6 @@ def careers_url(slug: str) -> str: return f"https://{host}{prefix}/search/" -def robots_page(slug: str) -> str: - return careers_url(slug) - - def _search_url(slug: str, start: int) -> str: host, prefix = _parts(slug) return f"https://{host}{prefix}/search/?q=&locationsearch=&startrow={start}" @@ -291,7 +295,7 @@ def _entries(text: str) -> list[dict[str, Any]]: return out -def page(get: Get, slug: str, cursor: Any) -> Page: +def page(get: Get, slug: str, cursor: Any, ask: Ask = Ask()) -> Page: """One search page. The cursor is `(start row, first role of the page before)`: the next start row is what this page returned, and a page that starts with the same role as the last one is the site ignoring `startrow`, @@ -329,6 +333,7 @@ def rows(decoded: str, slug: str) -> list[Row]: out.append({ "source_id": entry["id"], "title": entry["title"], + "places": [{"text": entry["place"], "remote": None}] if entry["place"] else [], "location": entry["place"], "url": url, "posted": _date(entry["date"]), @@ -368,6 +373,19 @@ def _posted(value: str) -> datetime | None: return parse_dt(value) +def _country_code(meta: dict[str, str]) -> str: + """The address's country as an ISO code: `addressCountry`, or the code that + `_place` reads in a `streetAddress`; '' for neither.""" + code = meta.get("addressCountry", "").strip().upper() + if len(code) == 2: + return code + parts = [part.strip() for part in meta.get("streetAddress", "").split(",")] + for i in range(len(parts) - 1, 0, -1): + if len(parts) - i <= 2 and parts[i] in _COUNTRIES: + return parts[i] + return "" + + def _location(meta: dict[str, str]) -> str: """The address as "City, Country". Vestas and Demant state `addressLocality` and `addressCountry` (a code), the other sites one @@ -386,7 +404,7 @@ def detail(get: Get, slug: str, row: Row) -> dict[str, Any]: """A role's own page: `description` from the block marked `itemprop="description"`, which Novo Nordisk's pages have without the microdata around it, and, from a page that has the `JobPosting` microdata, - `posted` (`datePosted`) and `location` with its country. A page that + `posted` (`datePosted`) and every place with the country's code. A page that is not a role's (the site answers 200 for a closed one with its search) has no description block and gives an empty answer.""" text = get(row["url"]).decode("utf-8", "replace") @@ -402,6 +420,25 @@ def detail(get: Get, slug: str, row: Row) -> dict[str, Any]: meta = {name: html.unescape(value) for name, value in _META.findall(text)} if posted := _posted(meta.get("datePosted", "")): out["posted"] = posted - if place := _location(meta): - out["location"] = place + addresses = _addresses(text) or [meta] + places: list[Place] = [] + for address in addresses: + if (place := _location(address)) and place not in (p["text"] for p in places): + places.append({"text": place, "remote": None}) + if places: + out["places"] = places + out["location"] = "; ".join(p["text"] for p in places) + codes = {_country_code(address) for address in addresses} + if len(codes) == 1 and (code := next(iter(codes))): + out["country"] = code return out + + +def _addresses(text: str) -> list[dict[str, str]]: + """The microdata of each `jobLocation` block, one dict of `itemprop` -> + content per place. A role at several places repeats the block.""" + found = [] + for match in re.finditer(r'<(?:span|div)\b[^>]*\bitemprop="jobLocation"', text): + block = _element(text, match.start()) + found.append({name: html.unescape(value) for name, value in _META.findall(block)}) + return found diff --git a/plugins/readers/teamtailor.py b/plugins/readers/teamtailor.py index 0f0481e..f9f7366 100644 --- a/plugins/readers/teamtailor.py +++ b/plugins/readers/teamtailor.py @@ -16,6 +16,7 @@ from typing import Any from desk.sources import strip_html +from ._contract import Ask, Fields, Place, Reads from ._shared import Get, Page, Row, is_web_url, only, parse_dt NAME = "teamtailor" @@ -28,6 +29,12 @@ PATTERNS = ( r"cdn\.teamtailor\.com|teamtailor-cdn|teamtailor\.com/assets", ) +READS = Reads( + scope="board", listing="paged", page_size=50, text="listing", complete="end", + places="many", fields=Fields(posted="trusted", remote="stated"), + robots="api: no robots.txt check needed (public board API), 2026-09-30", +) + #: The page size, asked for as `per_page`. A feed with neither parameter #: answers with every role (73 of 73 at Shine, 2026-09-29), but says nowhere #: that it is the whole list, so this reads by page to an empty one; @@ -80,7 +87,7 @@ def probe_ok(body: bytes) -> bool: return b"" in body -def page(get: Get, slug: str, cursor: Any) -> Page: +def page(get: Get, slug: str, cursor: Any, ask: Ask = Ask()) -> Page: offset = int(cursor or 0) items = _items(get(f"https://{site(slug)}/jobs.rss?per_page={PAGE_SIZE}&offset={offset}")) results = [{"id": item.findtext("guid") or item.findtext("link") or ""} for item in items] @@ -106,32 +113,36 @@ def rows(items: list[ET.Element], slug: str) -> list[Row]: own domain), a `guid` uuid, `pubDate`, the HTML `description` in full, `remoteStatus` (fully, hybrid, onsite, none or temporary), and, in the `tt:` namespace, `locations` (a list: `city` and `country` each, `name` free - text), `department` and `role`, either of which may be empty. `place` joins - the distinct locations with "; ", which `country_of` reads a location at a - time. No pay is stated anywhere in the feed.""" + text), `department` and `role`, either of which may be empty. `places` keeps + the distinct locations, and `location` joins them with "; ". A place is + remote or an office as far as the role's `remoteStatus` says. No pay is + stated anywhere in the feed.""" out = [] for item in items: title = (item.findtext("title") or "").strip() url = (item.findtext("link") or "").strip() if not title or not is_web_url(url): continue - places: list[str] = [] + status = (item.findtext("remoteStatus") or "").strip() + remote = {"fully": True, "hybrid": False, "onsite": False}.get(status) + places: list[Place] = [] for loc in item.findall(f"{_TT}locations/{_TT}location"): city = (loc.findtext(f"{_TT}city") or loc.findtext(f"{_TT}name") or "").strip() country = (loc.findtext(f"{_TT}country") or "").strip() place = city if country == city else ", ".join(p for p in (city, country) if p) - if place and place not in places: - places.append(place) + if place and place not in (p["text"] for p in places): + places.append({"text": place, "remote": remote}) out.append({ "source_id": (item.findtext("guid") or url).strip(), "title": title, - "location": "; ".join(places), + "places": places, + "location": "; ".join(p["text"] for p in places), "url": url, "posted": parse_dt(item.findtext("pubDate")), "department": ((item.findtext(f"{_TT}department") or "").strip() or (item.findtext(f"{_TT}role") or "").strip()), "description": html.unescape(strip_html(item.findtext("description") or "")), - "remote": _REMOTE.get((item.findtext("remoteStatus") or "").strip()), + "remote": _REMOTE.get(status), "salary_text": "", # Teamtailor's feed states no pay at all }) return out diff --git a/plugins/readers/workable.py b/plugins/readers/workable.py index 9495065..3a6cc52 100644 --- a/plugins/readers/workable.py +++ b/plugins/readers/workable.py @@ -8,11 +8,15 @@ board with roles was seen; jobhunt-hq did not read Workable. from __future__ import annotations import json +import logging from collections.abc import Callable from typing import Any +from ._contract import Ask, Fields, Place, Reads from ._shared import Get, Page, Row, only, parse_dt, path_slug_ok +log = logging.getLogger(__name__) + NAME = "workable" LABEL = "Workable" RANK = 40 @@ -21,8 +25,20 @@ PATTERNS = ( r"https?://(?!apply\.|www\.)([a-z0-9-]+)\.workable\.com", ) +READS = Reads( + scope="board", listing="paged", page_size=10, text="none", complete="stated", + places="many", + fields=Fields(posted="trusted", remote="stated", country="stated", employment="stated"), + robots="api: no robots.txt check needed (public board API), 2026-09-30", +) + _API = "apply.workable.com" +#: `type` -> the app's employment words; a type not listed is logged at debug +#: level so the table can grow. +_EMPLOYMENT = {"full": "full_time", "part": "part_time", "contract": "contract", + "temporary": "temporary", "internship": "internship"} + # No probe: Workable's API sits behind a rate limit that a run of guesses # trips, and a Workable site links its board plainly anyway. @@ -39,7 +55,7 @@ def careers_url(slug: str) -> str: return f"https://{_API}/{slug}" -def page(get: Get, slug: str, cursor: Any) -> Page: +def page(get: Get, slug: str, cursor: Any, ask: Ask = Ask()) -> Page: """One POST of the list; the next page is the same POST with `{"token": nextPage}`, and the last page has no `nextPage`.""" url = f"https://{_API}/api/v3/accounts/{slug}/jobs" @@ -51,6 +67,28 @@ def parse(body: bytes, slug: str) -> list[Row]: return rows(json.loads(body), slug) +def _places(job: dict[str, Any], remote: bool) -> tuple[list[Place], set[str]]: + """Every place of a role and the countries' codes among them. `locations` + lists them (city, region, country; `hidden` ones are stated too), and + `location` is the first alone, the fallback for a role that lists none. + A place is remote when the role is.""" + found: list[Place] = [] + codes: set[str] = set() + listed = [loc for loc in job.get("locations") or [] if isinstance(loc, dict)] + for loc in listed or [job.get("location") or {}]: + parts: list[str] = [] + for part in (loc.get("city"), loc.get("region"), loc.get("country")): + part = str(part or "").strip() + if part and part not in parts: + parts.append(part) + text = ", ".join(parts) + if text and text not in (p["text"] for p in found): + found.append({"text": text, "remote": remote}) + if code := str(loc.get("countryCode") or "").strip().upper(): + codes.add(code) + return found, codes + + def rows(data: dict[str, Any], slug: str) -> list[Row]: """One page of POST https://apply.workable.com/api/v3/accounts/{slug}/jobs -> `{"total": int, "results": [...], "nextPage": token}`, as Hugging @@ -58,28 +96,35 @@ def rows(data: dict[str, Any], slug: str) -> list[Row]: the job page is `https://apply.workable.com/{slug}/j/{shortcode}/`, and the description is only on the per-job endpoint, one request per role, so `description` stays empty here as it does for SmartRecruiters. - `location` is an object and `department` a list; `remote` is a flag - beside `workplace` (remote, hybrid, on_site).""" + `location` is the first place and `locations` all of them; `department` + is a list; `remote` is a flag beside `workplace` (remote, hybrid, + on_site); `type` is the hours or the contract (full, part, ...).""" out = [] for j in data.get("results") or []: title = (j.get("title") or "").strip() shortcode = (j.get("shortcode") or "").strip() if not title or not shortcode: continue - loc = j.get("location") or {} - location = ", ".join(p for p in (loc.get("city"), loc.get("region"), loc.get("country")) if p) + remote = bool(j.get("remote")) or j.get("workplace") == "remote" + places, codes = _places(j, remote) + kind = str(j.get("type") or "").strip().lower() + if kind and kind not in _EMPLOYMENT: + log.debug("workable: unknown type %r", kind) dept = j.get("department") or "" if isinstance(dept, list): dept = ", ".join(d for d in dept if d) out.append({ "source_id": str(j.get("id") or shortcode), "title": title, - "location": location, + "places": places, + "location": "; ".join(p["text"] for p in places), "url": f"https://{_API}/{slug}/j/{shortcode}/", "posted": parse_dt(j.get("published")), "department": dept.strip(), "description": "", - "remote": bool(j.get("remote")) or j.get("workplace") == "remote", + "remote": remote, "salary_text": "", # Workable's list endpoint states no pay at all + "country": next(iter(codes)) if len(codes) == 1 else None, + "employment": _EMPLOYMENT.get(kind), }) return out diff --git a/plugins/readers/workday.py b/plugins/readers/workday.py index 5aad007..b6f8738 100644 --- a/plugins/readers/workday.py +++ b/plugins/readers/workday.py @@ -18,6 +18,7 @@ from __future__ import annotations import html import json +import logging import re from collections.abc import Callable from datetime import UTC, datetime, timedelta @@ -25,14 +26,21 @@ from typing import Any from desk.sources import strip_html +from ._contract import Ask, Fields, Place, Reads from ._shared import Get, Page, Row, only, parse_dt +log = logging.getLogger(__name__) + NAME = "workday" LABEL = "Workday" KEEP_CASE = True -#: A tenant answers `/jobs` and `/Jobs` alike, so a rule in either case -#: forbids the site. -ROBOTS_ANY_CASE = True + +READS = Reads( + scope="board", listing="paged", page_size=20, ceiling=2000, text="detail", + complete="stated", places="many", + fields=Fields(posted="trusted", remote="stated", country="stated", employment="stated"), + robots="read: robots.txt allows // (checked 2026-09-29)", +) #: One group for `.` and one for the site, which discovery joins #: into the slug with "/". A locale segment (`/en-US/`, `/de-DE/`) may come @@ -86,14 +94,7 @@ def careers_url(slug: str) -> str: return f"https://{_host(slug)}/{_parts(slug)[2]}" # type: ignore[index] -def robots_page(slug: str) -> str: - """With the trailing slash, since the rules the tenants write are - `Disallow: //` and read as prefixes: `/` alone would slip - past the very rule that forbids the site.""" - return careers_url(slug) + "/" - - -def page(get: Get, slug: str, cursor: Any) -> Page: +def page(get: Get, slug: str, cursor: Any, ask: Ask = Ask()) -> Page: """`cursor` is `(offset, total)`. `total` is read on the first page only: on the later ones it is 0 on most tenants and the real figure on a few, so it is carried. An offset at or past the end does not answer an empty @@ -160,6 +161,32 @@ def _remote(value: Any) -> str | None: return _REMOTE.get(str(value or "").strip().lower()) +#: `timeType` -> the app's employment words. +_EMPLOYMENT = {"full time": "full_time", "part time": "part_time"} + +#: What `locationsText` says of a role at several places: "2 Locations". The +#: places arrive with the role's own read. +_COUNT = re.compile(r"\d+ locations?", re.I) + + +def _place(text: Any, remote: str | None) -> Place | None: + """A place as Workday writes it, or None for none. Some tenants write + "Country - City" ("Denmark - Copenhagen", "USA - Texas - Austin"), which + is turned round to the order the rest of the app reads, "Copenhagen, + Denmark"; a place that starts with a work-mode word ("Remote - Germany") + is left as it is. A place is remote or an office as far as the role's + `remoteType` says.""" + text = " ".join(str(text or "").split()) + if not text or _COUNT.fullmatch(text): + return None + parts = [part.strip() for part in text.split(" - ")] + if len(parts) > 1 and "," not in text and all(parts) \ + and not parts[0].lower().startswith(("remote", "hybrid", "on-site", "onsite")): + text = ", ".join(reversed(parts)) + return {"text": text, "remote": {"remote": True, "hybrid": False, "onsite": False}.get( + remote or "")} + + def rows(decoded: dict[str, Any], slug: str) -> list[Row]: """One page of `.../wday/cxs///jobs` -> `{"total", "jobPostings": [...], "facets": [...]}`. A posting has `title`, @@ -167,7 +194,7 @@ def rows(decoded: dict[str, Any], slug: str) -> list[Row]: (a place, or "2 Locations"), `postedOn` (relative text) and `bulletFields`, which lead with the requisition id, and on some tenants `remoteType`. No description, no date and no country: `detail` has - those. The id is the requisition id where the path carries it, and the + those, and the places of a role that "2 Locations" hides. The id is the requisition id where the path carries it, and the path where not; a posting with no title or no path is skipped.""" out = [] for p in decoded.get("jobPostings") or []: @@ -175,15 +202,18 @@ def rows(decoded: dict[str, Any], slug: str) -> list[Row]: path = (p.get("externalPath") or "").strip() if not title or not _ROLE_PATH.fullmatch(path): continue + remote = _remote(p.get("remoteType")) + place = _place(p.get("locationsText"), remote) out.append({ "source_id": _requisition(p, path) or path, "title": title, - "location": (p.get("locationsText") or "").strip(), + "places": [place] if place else [], + "location": place["text"] if place else "", "url": f"https://{_host(slug)}/{_parts(slug)[2]}{path}", # type: ignore[index] "posted": _posted(p.get("postedOn") or ""), "department": "", "description": "", - "remote": _remote(p.get("remoteType")), + "remote": remote, "salary_text": "", # no field for pay, only the description's text }) return out @@ -208,26 +238,40 @@ def detail(get: Get, slug: str, row: Row) -> dict[str, Any]: if description := " ".join(html.unescape(strip_html(posting.get("jobDescription") or "")) .split()): out["description"] = description - if location := _location(posting): - out["location"] = location + remote = _remote(posting.get("remoteType")) + if places := _places(posting, remote): + out["places"] = places + out["location"] = "; ".join(p["text"] for p in places) + if len(places) == 1 and (code := _country_code(posting)): + out["country"] = code + if employment := _EMPLOYMENT.get(str(posting.get("timeType") or "").strip().lower()): + out["employment"] = employment if posted := parse_dt(posting.get("startDate")): out["posted"] = posted - if remote := _remote(posting.get("remoteType")): + if remote: out["remote"] = remote return out -def _location(posting: dict[str, Any]) -> str: - """The main location and the others, joined by "; " as Teamtailor does, so - that `country_of` reads them one at a time and the listing's "2 Locations" - is replaced by places. A single location that does not name its country +def _country_code(posting: dict[str, Any]) -> str | None: + """The role's country as an ISO code, from the requisition's location. The + code belongs to the main location only, so it is used for a role with one + place.""" + country = (posting.get("jobRequisitionLocation") or {}).get("country") or {} + code = str(country.get("alpha2Code") or "").strip().upper() + return code if len(code) == 2 else None + + +def _places(posting: dict[str, Any], remote: str | None) -> list[Place]: + """The main location and the additional ones, each once, which replace the + listing's "2 Locations". A single location that does not name its country (LEGO's "Billund") gets it from the role's `country`.""" - places: list[str] = [] - for place in [posting.get("location"), *(posting.get("additionalLocations") or [])]: - place = str(place or "").strip() - if place and place not in places: - places.append(place) + found: list[Place] = [] + for name in [posting.get("location"), *(posting.get("additionalLocations") or [])]: + place = _place(name, remote) + if place and place["text"] not in (p["text"] for p in found): + found.append(place) country = str((posting.get("country") or {}).get("descriptor") or "").strip() - if len(places) == 1 and country and country.lower() not in places[0].lower(): - places[0] += f", {country}" - return "; ".join(places) + if len(found) == 1 and country and country.lower() not in found[0]["text"].lower(): + found[0]["text"] += f", {country}" + return found diff --git a/tests/fixtures/ats/oracle-places.json b/tests/fixtures/ats/oracle-places.json new file mode 100644 index 0000000..3350995 --- /dev/null +++ b/tests/fixtures/ats/oracle-places.json @@ -0,0 +1,302 @@ +{ + "items": [ + { + "SearchId": 1, + "Keyword": null, + "CorrectedKeyword": null, + "UseExactKeywordFlag": false, + "SuggestedKeyword": null, + "ExecuteSpellCheckFlag": true, + "Location": null, + "LocationId": null, + "Radius": 0, + "RadiusUnit": "MI", + "Facets": "TITLES;LOCATIONS;LOCATION_LEVEL1;LOCATION_LEVEL2;LOCATION_LEVEL3;CATEGORIES;POSTING_DATES;WORK_LOCATIONS;FLEX_FIELDS;ORGANIZATIONS;WORKPLACE_TYPES", + "Offset": 0, + "Limit": 5, + "SortBy": "RELEVANCY", + "TotalJobsCount": 600, + "Latitude": null, + "Longitude": null, + "SiteNumber": "CX_1", + "JobFamilyId": null, + "PostingStartDate": null, + "PostingEndDate": null, + "RequisitionId": null, + "CandidateNumber": null, + "WorkLocationZipCode": null, + "WorkLocationCountryCode": null, + "SelectedFlexFieldsFacets": null, + "OrganizationId": null, + "UserTargetFacetName": null, + "UserTargetFacetInputTerm": null, + "HotJobFlag": null, + "WorkplaceType": null, + "BotQRShortCode": null, + "requisitionList": [ + { + "Id": "39905", + "Title": "Supply Chain Program Manager", + "PostedDate": "2026-09-28", + "PostingEndDate": null, + "Language": "US", + "PrimaryLocationCountry": "TH", + "GeographyId": 300000000480081, + "HotJobFlag": true, + "WorkplaceTypeCode": "ORA_HYBRID", + "JobFamily": null, + "JobFunction": null, + "WorkerType": null, + "ContractType": null, + "ManagerLevel": null, + "JobSchedule": null, + "JobShift": null, + "JobType": null, + "StudyLevel": null, + "DomesticTravelRequired": null, + "InternationalTravelRequired": null, + "WorkDurationYears": null, + "WorkDurationMonths": null, + "WorkHours": null, + "WorkDays": null, + "LegalEmployer": null, + "BusinessUnit": null, + "Department": null, + "Organization": null, + "BusinessUnitId": 300000006664259, + "LegalEmployerId": 300000006365816, + "OrganizationId": 10003297, + "MediaThumbURL": null, + "ShortDescriptionStr": "Nokia is searching for a Supply Chain Program Management Leader to support our local contract manufacturers in SE Asia across multiple Subsystems products. This person will be accountable to work in a cross functional team with local Nokia teams and our ...", + "PrimaryLocation": "Thailand", + "Distance": 15, + "TrendingFlag": false, + "BeFirstToApplyFlag": false, + "Relevancy": 15, + "WorkplaceType": "Hybrid", + "ExternalQualificationsStr": null, + "ExternalResponsibilitiesStr": null, + "secondaryLocations": [ + { + "RequisitionLocationId": 300002190470822, + "GeographyNodeId": 100002145190119, + "GeographyId": 300000000471904, + "Name": "Malaysia", + "CountryCode": "MY", + "Latitude": 4.38933, + "Longitude": 102.08986 + } + ] + }, + { + "Id": "37189", + "Title": "IP NPI Specialist", + "PostedDate": "2026-09-24", + "PostingEndDate": null, + "Language": "US", + "PrimaryLocationCountry": "MY", + "GeographyId": 300000000471904, + "HotJobFlag": true, + "WorkplaceTypeCode": "ORA_HYBRID", + "JobFamily": null, + "JobFunction": null, + "WorkerType": null, + "ContractType": null, + "ManagerLevel": null, + "JobSchedule": null, + "JobShift": null, + "JobType": null, + "StudyLevel": null, + "DomesticTravelRequired": null, + "InternationalTravelRequired": null, + "WorkDurationYears": null, + "WorkDurationMonths": null, + "WorkHours": null, + "WorkDays": null, + "LegalEmployer": null, + "BusinessUnit": null, + "Department": null, + "Organization": null, + "BusinessUnitId": 300000006664259, + "LegalEmployerId": 300000006365205, + "OrganizationId": 53235948, + "MediaThumbURL": null, + "ShortDescriptionStr": "The New Product Introduction Specialist defines and execute demos, proof of concept, type approvals tests, field trials, and in general any New Product Introduction (NPI) related activities with our customer for any new product or solution. Accountable from ...", + "PrimaryLocation": "Malaysia", + "Distance": 13, + "TrendingFlag": false, + "BeFirstToApplyFlag": false, + "Relevancy": 13, + "WorkplaceType": "Hybrid", + "ExternalQualificationsStr": null, + "ExternalResponsibilitiesStr": null, + "secondaryLocations": [ + { + "RequisitionLocationId": 300001975383156, + "GeographyNodeId": 100002145190018, + "GeographyId": 300000000471961, + "Name": "Philippines", + "CountryCode": "PH", + "Latitude": 17.20662, + "Longitude": 121.6106 + }, + { + "RequisitionLocationId": 300002107689780, + "GeographyNodeId": 100002145190100, + "GeographyId": 300000000471733, + "Name": "Indonesia", + "CountryCode": "ID", + "Latitude": 2.82116, + "Longitude": 99.61807 + }, + { + "RequisitionLocationId": 300002107689781, + "GeographyNodeId": 100002145190039, + "GeographyId": 300000000480081, + "Name": "Thailand", + "CountryCode": "TH", + "Latitude": 13.75336, + "Longitude": 100.50483 + } + ] + }, + { + "Id": "40316", + "Title": "Safety Manager 3", + "PostedDate": "2026-09-28", + "PostingEndDate": null, + "Language": "US", + "PrimaryLocationCountry": "IN", + "GeographyId": 300000000471745, + "HotJobFlag": true, + "WorkplaceTypeCode": "ORA_ON_SITE", + "JobFamily": null, + "JobFunction": null, + "WorkerType": null, + "ContractType": null, + "ManagerLevel": null, + "JobSchedule": null, + "JobShift": null, + "JobType": null, + "StudyLevel": null, + "DomesticTravelRequired": null, + "InternationalTravelRequired": null, + "WorkDurationYears": null, + "WorkDurationMonths": null, + "WorkHours": null, + "WorkDays": null, + "LegalEmployer": null, + "BusinessUnit": null, + "Department": null, + "Organization": null, + "BusinessUnitId": 300000006664246, + "LegalEmployerId": 300000006387938, + "OrganizationId": 10008015, + "MediaThumbURL": null, + "ShortDescriptionStr": "The Safety Manager is responsible for leading Health, Safety, and Environment (HSE) operations at the Nokia Repair Factory in Gurgaon. This role ensures a safe, healthy, and compliant workplace by driving risk management initiatives, regulatory compliance, ...", + "PrimaryLocation": "India", + "Distance": 15, + "TrendingFlag": true, + "BeFirstToApplyFlag": false, + "Relevancy": 15, + "WorkplaceType": "Onsite", + "ExternalQualificationsStr": null, + "ExternalResponsibilitiesStr": null, + "secondaryLocations": [] + }, + { + "Id": "40975", + "Title": "High-Speed Converters Test and Validation Engineer", + "PostedDate": "2026-09-28", + "PostingEndDate": null, + "Language": "US", + "PrimaryLocationCountry": "DE", + "GeographyId": 300000000471601, + "HotJobFlag": false, + "WorkplaceTypeCode": null, + "JobFamily": null, + "JobFunction": null, + "WorkerType": null, + "ContractType": null, + "ManagerLevel": null, + "JobSchedule": null, + "JobShift": null, + "JobType": null, + "StudyLevel": null, + "DomesticTravelRequired": null, + "InternationalTravelRequired": null, + "WorkDurationYears": null, + "WorkDurationMonths": null, + "WorkHours": null, + "WorkDays": null, + "LegalEmployer": null, + "BusinessUnit": null, + "Department": null, + "Organization": null, + "BusinessUnitId": 300000006664259, + "LegalEmployerId": 300001149364006, + "OrganizationId": 300000806569044, + "MediaThumbURL": null, + "ShortDescriptionStr": "We are looking for a High-Speed ADC/DAC Test Engineer with strong hands-on laboratory experience. This is a practical, lab-focused engineering position for someone who is comfortable working directly with high-frequency test and measurement equipment and has ...", + "PrimaryLocation": "Germany", + "Distance": 9, + "TrendingFlag": false, + "BeFirstToApplyFlag": false, + "Relevancy": 9, + "WorkplaceType": "", + "ExternalQualificationsStr": null, + "ExternalResponsibilitiesStr": null, + "secondaryLocations": [] + }, + { + "Id": "31680", + "Title": "Sr. Director of Application Engineering", + "PostedDate": "2026-07-15", + "PostingEndDate": null, + "Language": "US", + "PrimaryLocationCountry": "US", + "GeographyId": 300000000480126, + "HotJobFlag": true, + "WorkplaceTypeCode": "ORA_REMOTE", + "JobFamily": null, + "JobFunction": null, + "WorkerType": null, + "ContractType": null, + "ManagerLevel": null, + "JobSchedule": null, + "JobShift": null, + "JobType": null, + "StudyLevel": null, + "DomesticTravelRequired": null, + "InternationalTravelRequired": null, + "WorkDurationYears": null, + "WorkDurationMonths": null, + "WorkHours": null, + "WorkDays": null, + "LegalEmployer": null, + "BusinessUnit": null, + "Department": null, + "Organization": null, + "BusinessUnitId": 300000006664259, + "LegalEmployerId": 300001149319675, + "OrganizationId": 300000806569328, + "MediaThumbURL": null, + "ShortDescriptionStr": "As the Sr. Director of Applications Engineering for Photonic Component Solutions at Nokia, you will be at the forefront of integrating advanced photonics technology into the Hyperscaler and optical module markets. Your core mission is to connect innovative ...", + "PrimaryLocation": "United States", + "Distance": 7, + "TrendingFlag": true, + "BeFirstToApplyFlag": false, + "Relevancy": 7, + "WorkplaceType": "Remote", + "ExternalQualificationsStr": null, + "ExternalResponsibilitiesStr": null, + "secondaryLocations": [] + } + ] + } + ], + "count": 1, + "hasMore": false, + "limit": 5, + "offset": 0 +} \ No newline at end of file diff --git a/tests/fixtures/ats/oracle-teaser.json b/tests/fixtures/ats/oracle-teaser.json new file mode 100644 index 0000000..3350995 --- /dev/null +++ b/tests/fixtures/ats/oracle-teaser.json @@ -0,0 +1,302 @@ +{ + "items": [ + { + "SearchId": 1, + "Keyword": null, + "CorrectedKeyword": null, + "UseExactKeywordFlag": false, + "SuggestedKeyword": null, + "ExecuteSpellCheckFlag": true, + "Location": null, + "LocationId": null, + "Radius": 0, + "RadiusUnit": "MI", + "Facets": "TITLES;LOCATIONS;LOCATION_LEVEL1;LOCATION_LEVEL2;LOCATION_LEVEL3;CATEGORIES;POSTING_DATES;WORK_LOCATIONS;FLEX_FIELDS;ORGANIZATIONS;WORKPLACE_TYPES", + "Offset": 0, + "Limit": 5, + "SortBy": "RELEVANCY", + "TotalJobsCount": 600, + "Latitude": null, + "Longitude": null, + "SiteNumber": "CX_1", + "JobFamilyId": null, + "PostingStartDate": null, + "PostingEndDate": null, + "RequisitionId": null, + "CandidateNumber": null, + "WorkLocationZipCode": null, + "WorkLocationCountryCode": null, + "SelectedFlexFieldsFacets": null, + "OrganizationId": null, + "UserTargetFacetName": null, + "UserTargetFacetInputTerm": null, + "HotJobFlag": null, + "WorkplaceType": null, + "BotQRShortCode": null, + "requisitionList": [ + { + "Id": "39905", + "Title": "Supply Chain Program Manager", + "PostedDate": "2026-09-28", + "PostingEndDate": null, + "Language": "US", + "PrimaryLocationCountry": "TH", + "GeographyId": 300000000480081, + "HotJobFlag": true, + "WorkplaceTypeCode": "ORA_HYBRID", + "JobFamily": null, + "JobFunction": null, + "WorkerType": null, + "ContractType": null, + "ManagerLevel": null, + "JobSchedule": null, + "JobShift": null, + "JobType": null, + "StudyLevel": null, + "DomesticTravelRequired": null, + "InternationalTravelRequired": null, + "WorkDurationYears": null, + "WorkDurationMonths": null, + "WorkHours": null, + "WorkDays": null, + "LegalEmployer": null, + "BusinessUnit": null, + "Department": null, + "Organization": null, + "BusinessUnitId": 300000006664259, + "LegalEmployerId": 300000006365816, + "OrganizationId": 10003297, + "MediaThumbURL": null, + "ShortDescriptionStr": "Nokia is searching for a Supply Chain Program Management Leader to support our local contract manufacturers in SE Asia across multiple Subsystems products. This person will be accountable to work in a cross functional team with local Nokia teams and our ...", + "PrimaryLocation": "Thailand", + "Distance": 15, + "TrendingFlag": false, + "BeFirstToApplyFlag": false, + "Relevancy": 15, + "WorkplaceType": "Hybrid", + "ExternalQualificationsStr": null, + "ExternalResponsibilitiesStr": null, + "secondaryLocations": [ + { + "RequisitionLocationId": 300002190470822, + "GeographyNodeId": 100002145190119, + "GeographyId": 300000000471904, + "Name": "Malaysia", + "CountryCode": "MY", + "Latitude": 4.38933, + "Longitude": 102.08986 + } + ] + }, + { + "Id": "37189", + "Title": "IP NPI Specialist", + "PostedDate": "2026-09-24", + "PostingEndDate": null, + "Language": "US", + "PrimaryLocationCountry": "MY", + "GeographyId": 300000000471904, + "HotJobFlag": true, + "WorkplaceTypeCode": "ORA_HYBRID", + "JobFamily": null, + "JobFunction": null, + "WorkerType": null, + "ContractType": null, + "ManagerLevel": null, + "JobSchedule": null, + "JobShift": null, + "JobType": null, + "StudyLevel": null, + "DomesticTravelRequired": null, + "InternationalTravelRequired": null, + "WorkDurationYears": null, + "WorkDurationMonths": null, + "WorkHours": null, + "WorkDays": null, + "LegalEmployer": null, + "BusinessUnit": null, + "Department": null, + "Organization": null, + "BusinessUnitId": 300000006664259, + "LegalEmployerId": 300000006365205, + "OrganizationId": 53235948, + "MediaThumbURL": null, + "ShortDescriptionStr": "The New Product Introduction Specialist defines and execute demos, proof of concept, type approvals tests, field trials, and in general any New Product Introduction (NPI) related activities with our customer for any new product or solution. Accountable from ...", + "PrimaryLocation": "Malaysia", + "Distance": 13, + "TrendingFlag": false, + "BeFirstToApplyFlag": false, + "Relevancy": 13, + "WorkplaceType": "Hybrid", + "ExternalQualificationsStr": null, + "ExternalResponsibilitiesStr": null, + "secondaryLocations": [ + { + "RequisitionLocationId": 300001975383156, + "GeographyNodeId": 100002145190018, + "GeographyId": 300000000471961, + "Name": "Philippines", + "CountryCode": "PH", + "Latitude": 17.20662, + "Longitude": 121.6106 + }, + { + "RequisitionLocationId": 300002107689780, + "GeographyNodeId": 100002145190100, + "GeographyId": 300000000471733, + "Name": "Indonesia", + "CountryCode": "ID", + "Latitude": 2.82116, + "Longitude": 99.61807 + }, + { + "RequisitionLocationId": 300002107689781, + "GeographyNodeId": 100002145190039, + "GeographyId": 300000000480081, + "Name": "Thailand", + "CountryCode": "TH", + "Latitude": 13.75336, + "Longitude": 100.50483 + } + ] + }, + { + "Id": "40316", + "Title": "Safety Manager 3", + "PostedDate": "2026-09-28", + "PostingEndDate": null, + "Language": "US", + "PrimaryLocationCountry": "IN", + "GeographyId": 300000000471745, + "HotJobFlag": true, + "WorkplaceTypeCode": "ORA_ON_SITE", + "JobFamily": null, + "JobFunction": null, + "WorkerType": null, + "ContractType": null, + "ManagerLevel": null, + "JobSchedule": null, + "JobShift": null, + "JobType": null, + "StudyLevel": null, + "DomesticTravelRequired": null, + "InternationalTravelRequired": null, + "WorkDurationYears": null, + "WorkDurationMonths": null, + "WorkHours": null, + "WorkDays": null, + "LegalEmployer": null, + "BusinessUnit": null, + "Department": null, + "Organization": null, + "BusinessUnitId": 300000006664246, + "LegalEmployerId": 300000006387938, + "OrganizationId": 10008015, + "MediaThumbURL": null, + "ShortDescriptionStr": "The Safety Manager is responsible for leading Health, Safety, and Environment (HSE) operations at the Nokia Repair Factory in Gurgaon. This role ensures a safe, healthy, and compliant workplace by driving risk management initiatives, regulatory compliance, ...", + "PrimaryLocation": "India", + "Distance": 15, + "TrendingFlag": true, + "BeFirstToApplyFlag": false, + "Relevancy": 15, + "WorkplaceType": "Onsite", + "ExternalQualificationsStr": null, + "ExternalResponsibilitiesStr": null, + "secondaryLocations": [] + }, + { + "Id": "40975", + "Title": "High-Speed Converters Test and Validation Engineer", + "PostedDate": "2026-09-28", + "PostingEndDate": null, + "Language": "US", + "PrimaryLocationCountry": "DE", + "GeographyId": 300000000471601, + "HotJobFlag": false, + "WorkplaceTypeCode": null, + "JobFamily": null, + "JobFunction": null, + "WorkerType": null, + "ContractType": null, + "ManagerLevel": null, + "JobSchedule": null, + "JobShift": null, + "JobType": null, + "StudyLevel": null, + "DomesticTravelRequired": null, + "InternationalTravelRequired": null, + "WorkDurationYears": null, + "WorkDurationMonths": null, + "WorkHours": null, + "WorkDays": null, + "LegalEmployer": null, + "BusinessUnit": null, + "Department": null, + "Organization": null, + "BusinessUnitId": 300000006664259, + "LegalEmployerId": 300001149364006, + "OrganizationId": 300000806569044, + "MediaThumbURL": null, + "ShortDescriptionStr": "We are looking for a High-Speed ADC/DAC Test Engineer with strong hands-on laboratory experience. This is a practical, lab-focused engineering position for someone who is comfortable working directly with high-frequency test and measurement equipment and has ...", + "PrimaryLocation": "Germany", + "Distance": 9, + "TrendingFlag": false, + "BeFirstToApplyFlag": false, + "Relevancy": 9, + "WorkplaceType": "", + "ExternalQualificationsStr": null, + "ExternalResponsibilitiesStr": null, + "secondaryLocations": [] + }, + { + "Id": "31680", + "Title": "Sr. Director of Application Engineering", + "PostedDate": "2026-07-15", + "PostingEndDate": null, + "Language": "US", + "PrimaryLocationCountry": "US", + "GeographyId": 300000000480126, + "HotJobFlag": true, + "WorkplaceTypeCode": "ORA_REMOTE", + "JobFamily": null, + "JobFunction": null, + "WorkerType": null, + "ContractType": null, + "ManagerLevel": null, + "JobSchedule": null, + "JobShift": null, + "JobType": null, + "StudyLevel": null, + "DomesticTravelRequired": null, + "InternationalTravelRequired": null, + "WorkDurationYears": null, + "WorkDurationMonths": null, + "WorkHours": null, + "WorkDays": null, + "LegalEmployer": null, + "BusinessUnit": null, + "Department": null, + "Organization": null, + "BusinessUnitId": 300000006664259, + "LegalEmployerId": 300001149319675, + "OrganizationId": 300000806569328, + "MediaThumbURL": null, + "ShortDescriptionStr": "As the Sr. Director of Applications Engineering for Photonic Component Solutions at Nokia, you will be at the forefront of integrating advanced photonics technology into the Hyperscaler and optical module markets. Your core mission is to connect innovative ...", + "PrimaryLocation": "United States", + "Distance": 7, + "TrendingFlag": true, + "BeFirstToApplyFlag": false, + "Relevancy": 7, + "WorkplaceType": "Remote", + "ExternalQualificationsStr": null, + "ExternalResponsibilitiesStr": null, + "secondaryLocations": [] + } + ] + } + ], + "count": 1, + "hasMore": false, + "limit": 5, + "offset": 0 +} \ No newline at end of file diff --git a/tests/fixtures/ats/oracle.slug b/tests/fixtures/ats/oracle.slug new file mode 100644 index 0000000..4142ec4 --- /dev/null +++ b/tests/fixtures/ats/oracle.slug @@ -0,0 +1 @@ +fa-ewto-saasfaprod1.fa.ocs.oraclecloud.com/CX_1 diff --git a/tests/fixtures/ats/personio-places.xml b/tests/fixtures/ats/personio-places.xml new file mode 100644 index 0000000..30780a7 --- /dev/null +++ b/tests/fixtures/ats/personio-places.xml @@ -0,0 +1,67 @@ + + + + + + 6001 + Acme AG + Remote - Germany + + Berlin + Hamburg + Berlin + + Sales + Customer Success + Business Development Representative + + + Your mission + Grow our pipeline.

]]>
+
+
+ permanent + entry-level + full-time + 2026-08-19T10:04:22+00:00 + + 42000.00 + 55000.00 + € + EUR + yearly + +
+ + + 6002 + Acme AG + Munich + Engineering + Backend Engineer (all genders) + + permanent + executive + full-time + 2026-09-21T14:53:35+00:00 + + + + 6003 + Acme AG + Munich + Operations + Office Coordinator + + working_student + student + part-time + 2026-09-05T09:00:00+00:00 + + 3000 + 3600 + monthly + + + +
diff --git a/tests/fixtures/ats/phenom-places.json b/tests/fixtures/ats/phenom-places.json new file mode 100644 index 0000000..73887e0 --- /dev/null +++ b/tests/fixtures/ats/phenom-places.json @@ -0,0 +1,322 @@ +{ + "refineSearch": { + "status": 200, + "hits": 5, + "totalHits": 32, + "data": { + "jobs": [ + { + "type": "Regular", + "descriptionTeaser": "Become part of our team and help shape the economic and systemic foundations of an unannounced Merge 2 game. Take ownership of the game\u2019s economy, ensuring a clear, sustainable player journey. Ideal for a senior designer with proven ...", + "state": "", + "siteType": "external", + "multi_category": [ + "Games Design & Production" + ], + "reqId": "R028168", + "city": "Barcelona", + "latitude": "41.38879", + "multi_location": [ + "Barcelona, Spain", + "London, London, United Kingdom", + "Stockholm, Stockholm County, Sweden" + ], + "address": "Carrer Ciutat de Granada, 150, Floor 16th Floor, 08018 Barcelona, Spain", + "applyUrl": "https://xboxgaming.wd1.myworkdayjobs.com/King_External_Careers/job/Barcelona---King---PG/Principal-Economy-Designer---New-Games_R028168/apply", + "externalApply": false, + "cityState": "Barcelona", + "country": "Spain", + "visibilityType": "External", + "longitude": "2.15899", + "jobId": "R028168", + "locale": "en_US", + "title": "Principal Economy Designer | New Games", + "jobSeqNo": "ACMKDSUSR028168EXTERNALENUS", + "postedDate": "2026-09-29T00:00:00.000+0000", + "dateCreated": "2026-09-29T09:59:51.253+0000", + "cityStateCountry": "Barcelona, Spain", + "jobVisibility": [ + "external" + ], + "location": "Barcelona, Spain", + "category": "Games Design & Production", + "isMultiLocation": true, + "multi_location_array": [ + { + "latlong": { + "lon": 2.15899, + "lat": 41.38879 + }, + "location": "Barcelona, Spain" + }, + { + "latlong": { + "lon": -0.12574, + "lat": 51.50853 + }, + "location": "London, London, United Kingdom" + }, + { + "latlong": { + "lon": 18.06871, + "lat": 59.32938 + }, + "location": "Stockholm, Stockholm County, Sweden" + } + ], + "isMultiCategory": false, + "multi_category_array": [ + { + "category": "Games Design & Production" + } + ], + "badge": "" + }, + { + "type": "Regular", + "descriptionTeaser": "Take on the role of Senior Data Visualisation Engineer to develop and maintain dashboards and analytical tools for business intelligence. Collaborate with cross-functional teams to deliver insightful visualisations and support high-volume ...", + "state": "Stockholm County", + "siteType": "external", + "multi_category": [ + "Technology & Development" + ], + "reqId": "R027656", + "city": "Stockholm", + "latitude": "59.32938", + "multi_location": [ + "Stockholm, Stockholm County, Sweden" + ], + "address": "Malmskillnadsgatan 19, 111 57 Stockholm, Sweden", + "applyUrl": "https://xboxgaming.wd1.myworkdayjobs.com/King_External_Careers/job/Stockholm---King---Malmskillnadsgatan/Senior-Data-Visualisation-Engineer--12mth-FTC-_R027656-1/apply", + "externalApply": false, + "cityState": "Stockholm, Stockholm County", + "country": "Sweden", + "visibilityType": "External", + "longitude": "18.06871", + "jobId": "R027656", + "locale": "en_US", + "title": "Senior Data Visualisation Engineer (12mth FTC)", + "jobSeqNo": "ACMKDSUSR027656EXTERNALENUS", + "postedDate": "2026-09-28T00:00:00.000+0000", + "dateCreated": "2026-06-15T17:02:06.245+0000", + "cityStateCountry": "Stockholm, Stockholm County, Sweden", + "jobVisibility": [ + "external" + ], + "location": "Stockholm, Stockholm County, Sweden", + "category": "Technology & Development", + "isMultiLocation": true, + "multi_location_array": [ + { + "latlong": { + "lon": 18.06871, + "lat": 59.32938 + }, + "location": "Stockholm, Stockholm County, Sweden" + } + ], + "isMultiCategory": false, + "multi_category_array": [ + { + "category": "Technology & Development" + } + ], + "badge": "" + }, + { + "type": "Regular", + "descriptionTeaser": "We are looking for a Technical Artist to shape the visual direction of new games, collaborating with artists, designers, and engineers to deliver polished, in-engine experiences. This senior role focuses on building shaders, materials, and ...", + "state": "London", + "siteType": "external", + "multi_category": [ + "Other" + ], + "reqId": "R028172", + "city": "London", + "latitude": "51.50853", + "multi_location": [ + "London, London, United Kingdom", + "Barcelona, Spain", + "Stockholm, Stockholm County, Sweden" + ], + "address": "The Ampersand Building, 178 Wardour Street, London, London, W1F 8FY, United Kingdom", + "applyUrl": "https://xboxgaming.wd1.myworkdayjobs.com/King_External_Careers/job/London---King---Ampersand/Technical-Artist---New-Games_R028172-1/apply", + "externalApply": false, + "cityState": "London, London", + "country": "United Kingdom", + "visibilityType": "External", + "longitude": "-0.12574", + "jobId": "R028172", + "locale": "en_US", + "title": "Technical Artist | New Games", + "jobSeqNo": "ACMKDSUSR028172EXTERNALENUS", + "postedDate": "2026-09-28T00:00:00.000+0000", + "dateCreated": "2026-09-28T13:01:25.961+0000", + "cityStateCountry": "London, London, United Kingdom", + "jobVisibility": [ + "external" + ], + "location": "London, London, United Kingdom", + "category": "Other", + "isMultiLocation": true, + "multi_location_array": [ + { + "latlong": { + "lon": -0.12574, + "lat": 51.50853 + }, + "location": "London, London, United Kingdom" + }, + { + "latlong": { + "lon": 2.15899, + "lat": 41.38879 + }, + "location": "Barcelona, Spain" + }, + { + "latlong": { + "lon": 18.06871, + "lat": 59.32938 + }, + "location": "Stockholm, Stockholm County, Sweden" + } + ], + "isMultiCategory": false, + "multi_category_array": [ + { + "category": "Other" + } + ], + "badge": "" + }, + { + "type": "Regular", + "descriptionTeaser": "We are currently hiring an Engineering Manager to lead the development and evolution of shared platforms supporting King\u2019s games. Drive high-performing teams, foster innovation, and ensure impactful delivery. Ideal for experienced leaders ...", + "state": "Stockholm County", + "siteType": "external", + "multi_category": [ + "Technology & Development" + ], + "reqId": "R028147", + "city": "Stockholm", + "latitude": "59.32938", + "multi_location": [ + "Stockholm, Stockholm County, Sweden", + "Barcelona, Spain" + ], + "address": "Malmskillnadsgatan 19, 111 57 Stockholm, Sweden", + "applyUrl": "https://xboxgaming.wd1.myworkdayjobs.com/King_External_Careers/job/Stockholm---King---Malmskillnadsgatan/Engineering-Manager---Shared-Tech_R028147/apply", + "externalApply": false, + "cityState": "Stockholm, Stockholm County", + "country": "Sweden", + "visibilityType": "External", + "longitude": "18.06871", + "jobId": "R028147", + "locale": "en_US", + "title": "Engineering Manager | Shared Tech", + "jobSeqNo": "ACMKDSUSR028147EXTERNALENUS", + "postedDate": "2026-09-28T00:00:00.000+0000", + "dateCreated": "2026-09-22T13:01:36.026+0000", + "cityStateCountry": "Stockholm, Stockholm County, Sweden", + "jobVisibility": [ + "external" + ], + "location": "Stockholm, Stockholm County, Sweden", + "category": "Technology & Development", + "isMultiLocation": true, + "multi_location_array": [ + { + "latlong": { + "lon": 18.06871, + "lat": 59.32938 + }, + "location": "Stockholm, Stockholm County, Sweden" + }, + { + "latlong": { + "lon": 2.15899, + "lat": 41.38879 + }, + "location": "Barcelona, Spain" + } + ], + "isMultiCategory": false, + "multi_category_array": [ + { + "category": "Technology & Development" + } + ], + "badge": "" + }, + { + "type": "Regular", + "descriptionTeaser": "Join us as a Principal Game Designer to shape the core gameplay of a new King casual puzzle game. Lead the design and evolution of engaging, challenging levels and interaction systems, collaborating with multidisciplinary teams. Ideal for ...", + "state": "London", + "siteType": "external", + "multi_category": [ + "Other" + ], + "reqId": "R028167", + "city": "London", + "latitude": "51.50853", + "multi_location": [ + "London, London, United Kingdom", + "Barcelona, Spain", + "Stockholm, Stockholm County, Sweden" + ], + "address": "The Ampersand Building, 178 Wardour Street, London, London, W1F 8FY, United Kingdom", + "applyUrl": "https://xboxgaming.wd1.myworkdayjobs.com/King_External_Careers/job/London---King---Ampersand/Principal-Game-Designer---New-Games_R028167/apply", + "externalApply": false, + "cityState": "London, London", + "country": "United Kingdom", + "visibilityType": "External", + "longitude": "-0.12574", + "jobId": "R028167", + "locale": "en_US", + "title": "Principal Game Designer | New Games", + "jobSeqNo": "ACMKDSUSR028167EXTERNALENUS", + "postedDate": "2026-09-25T00:00:00.000+0000", + "dateCreated": "2026-09-25T13:14:11.065+0000", + "cityStateCountry": "London, London, United Kingdom", + "jobVisibility": [ + "external" + ], + "location": "London, London, United Kingdom", + "category": "Other", + "isMultiLocation": true, + "multi_location_array": [ + { + "latlong": { + "lon": -0.12574, + "lat": 51.50853 + }, + "location": "London, London, United Kingdom" + }, + { + "latlong": { + "lon": 2.15899, + "lat": 41.38879 + }, + "location": "Barcelona, Spain" + }, + { + "latlong": { + "lon": 18.06871, + "lat": 59.32938 + }, + "location": "Stockholm, Stockholm County, Sweden" + } + ], + "isMultiCategory": false, + "multi_category_array": [ + { + "category": "Other" + } + ], + "badge": "" + } + ] + } + } +} \ No newline at end of file diff --git a/tests/fixtures/ats/phenom-teaser.json b/tests/fixtures/ats/phenom-teaser.json new file mode 100644 index 0000000..73887e0 --- /dev/null +++ b/tests/fixtures/ats/phenom-teaser.json @@ -0,0 +1,322 @@ +{ + "refineSearch": { + "status": 200, + "hits": 5, + "totalHits": 32, + "data": { + "jobs": [ + { + "type": "Regular", + "descriptionTeaser": "Become part of our team and help shape the economic and systemic foundations of an unannounced Merge 2 game. Take ownership of the game\u2019s economy, ensuring a clear, sustainable player journey. Ideal for a senior designer with proven ...", + "state": "", + "siteType": "external", + "multi_category": [ + "Games Design & Production" + ], + "reqId": "R028168", + "city": "Barcelona", + "latitude": "41.38879", + "multi_location": [ + "Barcelona, Spain", + "London, London, United Kingdom", + "Stockholm, Stockholm County, Sweden" + ], + "address": "Carrer Ciutat de Granada, 150, Floor 16th Floor, 08018 Barcelona, Spain", + "applyUrl": "https://xboxgaming.wd1.myworkdayjobs.com/King_External_Careers/job/Barcelona---King---PG/Principal-Economy-Designer---New-Games_R028168/apply", + "externalApply": false, + "cityState": "Barcelona", + "country": "Spain", + "visibilityType": "External", + "longitude": "2.15899", + "jobId": "R028168", + "locale": "en_US", + "title": "Principal Economy Designer | New Games", + "jobSeqNo": "ACMKDSUSR028168EXTERNALENUS", + "postedDate": "2026-09-29T00:00:00.000+0000", + "dateCreated": "2026-09-29T09:59:51.253+0000", + "cityStateCountry": "Barcelona, Spain", + "jobVisibility": [ + "external" + ], + "location": "Barcelona, Spain", + "category": "Games Design & Production", + "isMultiLocation": true, + "multi_location_array": [ + { + "latlong": { + "lon": 2.15899, + "lat": 41.38879 + }, + "location": "Barcelona, Spain" + }, + { + "latlong": { + "lon": -0.12574, + "lat": 51.50853 + }, + "location": "London, London, United Kingdom" + }, + { + "latlong": { + "lon": 18.06871, + "lat": 59.32938 + }, + "location": "Stockholm, Stockholm County, Sweden" + } + ], + "isMultiCategory": false, + "multi_category_array": [ + { + "category": "Games Design & Production" + } + ], + "badge": "" + }, + { + "type": "Regular", + "descriptionTeaser": "Take on the role of Senior Data Visualisation Engineer to develop and maintain dashboards and analytical tools for business intelligence. Collaborate with cross-functional teams to deliver insightful visualisations and support high-volume ...", + "state": "Stockholm County", + "siteType": "external", + "multi_category": [ + "Technology & Development" + ], + "reqId": "R027656", + "city": "Stockholm", + "latitude": "59.32938", + "multi_location": [ + "Stockholm, Stockholm County, Sweden" + ], + "address": "Malmskillnadsgatan 19, 111 57 Stockholm, Sweden", + "applyUrl": "https://xboxgaming.wd1.myworkdayjobs.com/King_External_Careers/job/Stockholm---King---Malmskillnadsgatan/Senior-Data-Visualisation-Engineer--12mth-FTC-_R027656-1/apply", + "externalApply": false, + "cityState": "Stockholm, Stockholm County", + "country": "Sweden", + "visibilityType": "External", + "longitude": "18.06871", + "jobId": "R027656", + "locale": "en_US", + "title": "Senior Data Visualisation Engineer (12mth FTC)", + "jobSeqNo": "ACMKDSUSR027656EXTERNALENUS", + "postedDate": "2026-09-28T00:00:00.000+0000", + "dateCreated": "2026-06-15T17:02:06.245+0000", + "cityStateCountry": "Stockholm, Stockholm County, Sweden", + "jobVisibility": [ + "external" + ], + "location": "Stockholm, Stockholm County, Sweden", + "category": "Technology & Development", + "isMultiLocation": true, + "multi_location_array": [ + { + "latlong": { + "lon": 18.06871, + "lat": 59.32938 + }, + "location": "Stockholm, Stockholm County, Sweden" + } + ], + "isMultiCategory": false, + "multi_category_array": [ + { + "category": "Technology & Development" + } + ], + "badge": "" + }, + { + "type": "Regular", + "descriptionTeaser": "We are looking for a Technical Artist to shape the visual direction of new games, collaborating with artists, designers, and engineers to deliver polished, in-engine experiences. This senior role focuses on building shaders, materials, and ...", + "state": "London", + "siteType": "external", + "multi_category": [ + "Other" + ], + "reqId": "R028172", + "city": "London", + "latitude": "51.50853", + "multi_location": [ + "London, London, United Kingdom", + "Barcelona, Spain", + "Stockholm, Stockholm County, Sweden" + ], + "address": "The Ampersand Building, 178 Wardour Street, London, London, W1F 8FY, United Kingdom", + "applyUrl": "https://xboxgaming.wd1.myworkdayjobs.com/King_External_Careers/job/London---King---Ampersand/Technical-Artist---New-Games_R028172-1/apply", + "externalApply": false, + "cityState": "London, London", + "country": "United Kingdom", + "visibilityType": "External", + "longitude": "-0.12574", + "jobId": "R028172", + "locale": "en_US", + "title": "Technical Artist | New Games", + "jobSeqNo": "ACMKDSUSR028172EXTERNALENUS", + "postedDate": "2026-09-28T00:00:00.000+0000", + "dateCreated": "2026-09-28T13:01:25.961+0000", + "cityStateCountry": "London, London, United Kingdom", + "jobVisibility": [ + "external" + ], + "location": "London, London, United Kingdom", + "category": "Other", + "isMultiLocation": true, + "multi_location_array": [ + { + "latlong": { + "lon": -0.12574, + "lat": 51.50853 + }, + "location": "London, London, United Kingdom" + }, + { + "latlong": { + "lon": 2.15899, + "lat": 41.38879 + }, + "location": "Barcelona, Spain" + }, + { + "latlong": { + "lon": 18.06871, + "lat": 59.32938 + }, + "location": "Stockholm, Stockholm County, Sweden" + } + ], + "isMultiCategory": false, + "multi_category_array": [ + { + "category": "Other" + } + ], + "badge": "" + }, + { + "type": "Regular", + "descriptionTeaser": "We are currently hiring an Engineering Manager to lead the development and evolution of shared platforms supporting King\u2019s games. Drive high-performing teams, foster innovation, and ensure impactful delivery. Ideal for experienced leaders ...", + "state": "Stockholm County", + "siteType": "external", + "multi_category": [ + "Technology & Development" + ], + "reqId": "R028147", + "city": "Stockholm", + "latitude": "59.32938", + "multi_location": [ + "Stockholm, Stockholm County, Sweden", + "Barcelona, Spain" + ], + "address": "Malmskillnadsgatan 19, 111 57 Stockholm, Sweden", + "applyUrl": "https://xboxgaming.wd1.myworkdayjobs.com/King_External_Careers/job/Stockholm---King---Malmskillnadsgatan/Engineering-Manager---Shared-Tech_R028147/apply", + "externalApply": false, + "cityState": "Stockholm, Stockholm County", + "country": "Sweden", + "visibilityType": "External", + "longitude": "18.06871", + "jobId": "R028147", + "locale": "en_US", + "title": "Engineering Manager | Shared Tech", + "jobSeqNo": "ACMKDSUSR028147EXTERNALENUS", + "postedDate": "2026-09-28T00:00:00.000+0000", + "dateCreated": "2026-09-22T13:01:36.026+0000", + "cityStateCountry": "Stockholm, Stockholm County, Sweden", + "jobVisibility": [ + "external" + ], + "location": "Stockholm, Stockholm County, Sweden", + "category": "Technology & Development", + "isMultiLocation": true, + "multi_location_array": [ + { + "latlong": { + "lon": 18.06871, + "lat": 59.32938 + }, + "location": "Stockholm, Stockholm County, Sweden" + }, + { + "latlong": { + "lon": 2.15899, + "lat": 41.38879 + }, + "location": "Barcelona, Spain" + } + ], + "isMultiCategory": false, + "multi_category_array": [ + { + "category": "Technology & Development" + } + ], + "badge": "" + }, + { + "type": "Regular", + "descriptionTeaser": "Join us as a Principal Game Designer to shape the core gameplay of a new King casual puzzle game. Lead the design and evolution of engaging, challenging levels and interaction systems, collaborating with multidisciplinary teams. Ideal for ...", + "state": "London", + "siteType": "external", + "multi_category": [ + "Other" + ], + "reqId": "R028167", + "city": "London", + "latitude": "51.50853", + "multi_location": [ + "London, London, United Kingdom", + "Barcelona, Spain", + "Stockholm, Stockholm County, Sweden" + ], + "address": "The Ampersand Building, 178 Wardour Street, London, London, W1F 8FY, United Kingdom", + "applyUrl": "https://xboxgaming.wd1.myworkdayjobs.com/King_External_Careers/job/London---King---Ampersand/Principal-Game-Designer---New-Games_R028167/apply", + "externalApply": false, + "cityState": "London, London", + "country": "United Kingdom", + "visibilityType": "External", + "longitude": "-0.12574", + "jobId": "R028167", + "locale": "en_US", + "title": "Principal Game Designer | New Games", + "jobSeqNo": "ACMKDSUSR028167EXTERNALENUS", + "postedDate": "2026-09-25T00:00:00.000+0000", + "dateCreated": "2026-09-25T13:14:11.065+0000", + "cityStateCountry": "London, London, United Kingdom", + "jobVisibility": [ + "external" + ], + "location": "London, London, United Kingdom", + "category": "Other", + "isMultiLocation": true, + "multi_location_array": [ + { + "latlong": { + "lon": -0.12574, + "lat": 51.50853 + }, + "location": "London, London, United Kingdom" + }, + { + "latlong": { + "lon": 2.15899, + "lat": 41.38879 + }, + "location": "Barcelona, Spain" + }, + { + "latlong": { + "lon": 18.06871, + "lat": 59.32938 + }, + "location": "Stockholm, Stockholm County, Sweden" + } + ], + "isMultiCategory": false, + "multi_category_array": [ + { + "category": "Other" + } + ], + "badge": "" + } + ] + } + } +} \ No newline at end of file diff --git a/tests/fixtures/ats/phenom.slug b/tests/fixtures/ats/phenom.slug new file mode 100644 index 0000000..7bc3095 --- /dev/null +++ b/tests/fixtures/ats/phenom.slug @@ -0,0 +1 @@ +careers.king.com/us/en diff --git a/tests/fixtures/ats/pinpoint-places.json b/tests/fixtures/ats/pinpoint-places.json new file mode 100644 index 0000000..6cffdcb --- /dev/null +++ b/tests/fixtures/ats/pinpoint-places.json @@ -0,0 +1 @@ +{"data":[{"id":"581878","benefits":"\u003cul\u003e\u003cli\u003e\u003c!--block--\u003eWe will help you \u003cstrong\u003egrow your career:\u003c/strong\u003e We help you identify areas of growth for you, whether you want to grow as a specialist in your field or eventually want to go into a leadership/management role.\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eWe have a \u003cstrong\u003etransparent and open work environment\u003c/strong\u003e where everyone is empowered to make an impact and encouraged to voice their ideas.\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eKeeping true to our value, “\u003cstrong\u003eXeneta is one”\u003c/strong\u003e, we regularly bring colleagues together across locations. We organize an annual global company trip, and we aim to create opportunities for people to meet in person from time to time.\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eYou will receive an\u003cstrong\u003e individual education budget \u003c/strong\u003eand can educate yourself during work hours: you can spend several hours each month attending courses, reading books, or getting involved in communities.\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eYou will enjoy our\u003cstrong\u003e generous vacation plan\u003c/strong\u003e: 26 paid days of vacation per year.\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eWe value \u003cstrong\u003ework-life balance \u003c/strong\u003eand want to make sure you can spend quality time with your family or enjoy your hobbies when your workday is over.\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eWe have \u003cstrong\u003eflexible working hours\u003c/strong\u003e (core time with meetings is 11:00 to 16:00 EET, the rest is up to you).\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eFull-time position, employed through GI Group, our staffing partner in Romania.\u003c/li\u003e\u003c/ul\u003e\u003cdiv\u003e\u003c!--block--\u003e\u003cbr\u003eWhy you will love it here\u003c/div\u003e\u003cul\u003e\u003cli\u003e\u003c!--block--\u003e\u003cstrong\u003eOur Impact\u003c/strong\u003e: We’re category leaders digitalizing the way ocean and air freight is procured bringing on-demand actionable data to all industry stakeholders. We’re moving fast.\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003e\u003cstrong\u003eOur Technology\u003c/strong\u003e: Deep data analytics and integrations coupled with a scalable, sleek and beautiful user interface.\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003e\u003cstrong\u003eOur Team\u003c/strong\u003e: Shipping, consulting and tech all-stars on our roster.\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003e\u003cstrong\u003eOur Values\u003c/strong\u003e: Xeneta is One. Transparency builds trust. Ownership drives Impact. Modernization through data. Diversity is our Superpower.\u003c/li\u003e\u003c/ul\u003e\u003cdiv\u003e\u003c!--block--\u003eMake sure to highlight your past achievements that you think are relevant. Be sure to give us an idea of who you are as a real live person and not just your professional experience. \u0026nbsp;\u003cbr\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003c!--block--\u003eXeneta is an equal opportunity employer. We celebrate diversity and are committed to creating an inclusive environment for all employees. \u0026nbsp;\u003cbr\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003c!--block--\u003eLooking forward to hearing from you!\u0026nbsp;\u003c/div\u003e","benefits_header":"Job Benefits","compensation":null,"compensation_minimum":null,"compensation_maximum":null,"compensation_currency":null,"compensation_frequency":null,"compensation_visible":false,"deadline_at":null,"description":"\u003cdiv\u003e\u003c!--block--\u003e\u003cstrong\u003eData Detective Wanted to join our Data \u0026amp; Analytics Team\u003c/strong\u003e \u003cbr\u003e\u003cbr\u003e\u003cem\u003eLocation: Bucharest, Romania\u003c/em\u003e\u003cbr\u003e\u003cbr\u003eAs a \u003cstrong\u003eData Operations Analyst \u003c/strong\u003eat Xeneta, you’ll learn how to master complex data analytics within the world of supply chain and logistics. Xeneta is one of the world's leading data platforms providing market intelligence to the ocean and air freight industry. We have a big team of skilled Data Analysts that will help you learn the ropes from the ground up, while enabling you to collect and analyze data in one of the world’s greatest container shipping datasets. \u0026nbsp;\u003c/div\u003e\u003cdiv\u003e\u003c!--block--\u003e\u003cbr\u003eBring your analytical mindset and a genuine curiosity for how global shipping works and join our team!\u0026nbsp;\u003c/div\u003e","employment_type":"permanent_full_time","employment_type_text":"Permanent - Full Time","key_responsibilities":"\u003cdiv\u003e\u003c!--block--\u003eJoin our Liner Data \u0026amp; Analytics Team (LDAT) and own a portfolio of container shipping services for the world's largest ocean carriers. Liner shipping data is messy, inconsistent, and constantly changing. You'll turn that chaos into the accurate database our customers rely on to make shipping decisions, working at the center of a fast-moving industry with direct ownership over the data that shapes how the world sees ocean freight.\u0026nbsp;\u003cbr\u003e\u003cbr\u003eYour key tasks will be:\u003c/div\u003e\u003cul\u003e\u003cli\u003e\u003c!--block--\u003eReview and validate liner service data on a recurring cycle.\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eMonitor vessel movements, deployment changes, blank sailings, and schedule updates for your portfolio, and update our platform to reflect the current state. \u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eInvestigate and resolve data quality exceptions: missing vessel assignments, stale voyage legs, unmatched data points and carrier discrepancies.\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eQuery our database to dig into data issues and support your own analysis. \u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eWork closely with Customer Success and Sales teams in answering customers´ data requests throughout their procurement life cycle journey.\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eMaintain forecast accuracy for your portfolio. \u0026nbsp;\u003c/li\u003e\u003c/ul\u003e","key_responsibilities_header":"Key Responsibilities","reporting_to":"John Kingori","skills_knowledge_expertise":"\u003cdiv\u003e\u003c!--block--\u003eIn this role, we are looking for someone with the following background and skills:\u0026nbsp;\u003c/div\u003e\u003cul\u003e\u003cli\u003e\u003c!--block--\u003eBachelor's degree in Business Administration, Economics, Mathematics, Engineering, Logistics, and related fields.\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eFluent in English, oral and written.\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eHigh attention to detail; you catch discrepancies across large datasets.\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eAnalytical and problem-solving mindset.\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eComfortable working async across time zones in a distributed team.\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eOutstanding team player, also fully capable of working independently.\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eYou're curious by nature and learn new tools and systems quickly, always asking why the data looks the way it does, not just what it shows.\u0026nbsp;\u003c/li\u003e\u003c/ul\u003e\u003cdiv\u003e\u003c!--block--\u003e\u003cstrong\u003eBonus points for\u003c/strong\u003e\u0026nbsp;\u003c/div\u003e\u003cul\u003e\u003cli\u003e\u003c!--block--\u003eExperience as a Data Analyst\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eFamiliarity with container shipping, vessel schedules, or liner service structures.\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eProficiency with AI tools to speed up data analysis, scripting, or documentation.\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eWorking knowledge of SQL; comfortable writing and troubleshooting queries against a relational database.\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eComfortable building and maintaining dashboards in Power BI.\u0026nbsp;\u003c/li\u003e\u003c/ul\u003e\u003cdiv\u003e\u003c!--block--\u003e\u003cem\u003ePlease note that English is our working language, so we ask that your application and CV are submitted in English.\u003c/em\u003e\u003c/div\u003e","skills_knowledge_expertise_header":"Skills, Knowledge \u0026 Expertise","title":"Data Operations Analyst - LSP","url":"https://xeneta.pinpointhq.com/en/postings/a85d5d45-b334-4f5c-aaea-d0b399b08a2e","path":"/en/postings/a85d5d45-b334-4f5c-aaea-d0b399b08a2e","workplace_type":"hybrid","workplace_type_text":"Hybrid","job":{"id":"582848","requisition_id":"REQ-0328","department":{"id":"51942","name":"RMT - LSP"},"division":null,"structure_custom_group_one":null},"location":{"id":"71041","city":"Bucharest","name":"Bucharest","postal_code":"","province":"Bucharest","street_address":""}},{"id":"587635","benefits":"\u003cul\u003e\u003cli\u003e\u003c!--block--\u003eWe have a \u003cstrong\u003etransparent and open work environment\u003c/strong\u003e where everyone is empowered to make an impact and encouraged to voice their ideas.\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eKeeping true to our value, “\u003cstrong\u003eXeneta is one”\u003c/strong\u003e, we regularly bring colleagues together across locations. We organize an annual global company trip, and we aim to create opportunities for people to meet in person.\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eYou will enjoy our\u003cstrong\u003e generous vacation plan\u003c/strong\u003e: 26 paid days of vacation per year.\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eWe value \u003cstrong\u003ework-life balance \u003c/strong\u003eand want to make sure you can spend quality time with your family or enjoy your hobbies when your workday is over.\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eWe have \u003cstrong\u003eflexible working hours\u003c/strong\u003e (core time with meetings is 11:00 to 16:00 EET, the rest is up to you).\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eNote that the positions is employed through \u003cstrong\u003eGI Group,\u003c/strong\u003e our staffing partner in Romania.\u003c/li\u003e\u003c/ul\u003e\u003cdiv\u003e\u003c!--block--\u003eWhy you will love it here\u003c/div\u003e\u003cul\u003e\u003cli\u003e\u003c!--block--\u003e\u003cstrong\u003eOur Impact\u003c/strong\u003e: We’re category leaders digitalizing the way ocean and air freight is procured bringing on-demand actionable data to all industry stakeholders. We’re moving fast.\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003e\u003cstrong\u003eOur Technology\u003c/strong\u003e: Deep data analytics and integrations coupled with a scalable, sleek and beautiful user interface.\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003e\u003cstrong\u003eOur Team\u003c/strong\u003e: Shipping, consulting and tech all-stars on our roster.\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003e\u003cstrong\u003eOur Values\u003c/strong\u003e: Xeneta is One. Transparency builds trust. Ownership drives Impact. Modernization through data. Diversity is our Superpower.\u003c/li\u003e\u003c/ul\u003e\u003cdiv\u003e\u003c!--block--\u003eMake sure to highlight your past achievements that you think are relevant. Be sure to give us an idea of who you are as a real live person and not just your professional experience. \u0026nbsp;\u003cbr\u003e\u003cbr\u003e\u003c/div\u003e\u003cdiv\u003e\u003c!--block--\u003eXeneta is an equal opportunity employer. We celebrate diversity and are committed to creating an inclusive environment for all employees. Looking forward to hearing from you!\u0026nbsp;\u003c/div\u003e","benefits_header":"Benefits","compensation":null,"compensation_minimum":null,"compensation_maximum":null,"compensation_currency":null,"compensation_frequency":null,"compensation_visible":false,"deadline_at":"2026-10-09T23:59:59+02:00","description":"\u003cdiv\u003e\u003c!--block--\u003eWe are looking for a \u003cstrong\u003ePeople \u0026amp; Culture Assistant \u003c/strong\u003eto join our People Experience Team. This is a temporary, 12-month contract for a full-time role, as one of our team members is on leave.\u0026nbsp;\u003c/div\u003e\u003cdiv\u003e\u003c!--block--\u003e\u0026nbsp;\u003cbr\u003eCustomer centricity is a core principle in Xeneta. For the People \u0026amp; Culture team, our colleagues are our customers. As People and Culture Assistant, you will ensure our Executive Leadership's days run as smoothly and efficiently as possible. You will be their business partner who enables them to focus on their core responsibilities and helps them meet their business goals and objectives. You will work with our C-suite and thus get exposure to all the different areas of our business.\u0026nbsp; \u003cbr\u003e\u0026nbsp;\u003cbr\u003eWe're seeking a diligent and self-motivated person to join our People \u0026amp; Culture team. This is an exciting opportunity to work with various tasks and responsibilities in an international tech company!\u0026nbsp; \u003cbr\u003e\u003cbr\u003e\u003cem\u003eWe would prefer someone who can start quickly and we will call candidates in for interviews on a continuous basis, so please apply as soon as possible.\u0026nbsp;\u003c/em\u003e\u003c/div\u003e","employment_type":"fixed_term_full_time","employment_type_text":"Fixed Term - Full Time","key_responsibilities":"\u003cdiv\u003e\u003c!--block--\u003eYour main responsibility will be to support the CEO, CPO, and CRO. As such, your key tasks will be: \u0026nbsp;\u003c/div\u003e\u003cul\u003e\u003cli\u003e\u003c!--block--\u003eOwn calendar management: organizing inboxes, scheduling meetings, resolving scheduling conflicts, prioritizing calendar events, communicating urgent requests and changes to relevant stakeholders.\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eManage Xeneta Board meeting logistics, including liaising with Board members, setting Board calendar, ensuring timely delivery of Board materials, and scheduling Board dinners.\u0026nbsp; \u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eArrange and coordinate travel plans, itineraries, and agendas.\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eSupport with various administrative and ad hoc tasks, such as processing expense reimbursements.\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eSchedule and coordinate various events for C-Suite and Extended Leadership Team members, such as offsite meetings, departmental events, team-building events, etc.\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eSupport the People Experience Team on other global events and initiatives, such as supporting the Senior People Experience Partner on ticketing systems and ad hoc office management.\u003c/li\u003e\u003c/ul\u003e","key_responsibilities_header":"Key Responsibilities","reporting_to":"","skills_knowledge_expertise":"\u003cdiv\u003e\u003c!--block--\u003eWe are looking for someone who has the following experience and skills: \u0026nbsp;\u003c/div\u003e\u003cul\u003e\u003cli\u003e\u003c!--block--\u003eIdeally 1-3 years of experience in a similar role, such as Scheduling Assistant, Personal Assistant, Coordinator, or Executive Assistant.\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eBusiness fluent in English, oral and written.\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eDemonstrated proficiency in Microsoft Suite (Outlook, Teams, Word, PowerPoint, Excel).\u0026nbsp;\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eExcellent communication, interpersonal, and organizational skills.\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eSelf-motivated; able to work independently and efficiently.\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eYou thrive in an international, fast-working environment and enjoy making people's lives easier. You remain calm and composed, even while handling tasks that demand detail-focus and accuracy.\u003c/li\u003e\u003cli\u003e\u003c!--block--\u003eAbility to quickly familiarize yourself with new topics. You like digging into new things and can deal with multiple issues simultaneously.\u0026nbsp;\u003c/li\u003e\u003c/ul\u003e","skills_knowledge_expertise_header":"Skills, Knowledge and Expertise","title":"People \u0026 Culture Assistant","url":"https://xeneta.pinpointhq.com/en/postings/ae6a3963-acf7-4ed0-8147-7138f7ebb21e","path":"/en/postings/ae6a3963-acf7-4ed0-8147-7138f7ebb21e","workplace_type":"hybrid","workplace_type_text":"Hybrid","job":{"id":"588176","requisition_id":"REQ-0331","department":{"id":"9357","name":"People \u0026 Culture"},"division":null,"structure_custom_group_one":null},"location":{"id":"71041","city":"Bucharest","name":"Bucharest","postal_code":"","province":"Bucharest","street_address":""}}]} \ No newline at end of file diff --git a/tests/fixtures/ats/recruitee-places.json b/tests/fixtures/ats/recruitee-places.json new file mode 100644 index 0000000..7af47a1 --- /dev/null +++ b/tests/fixtures/ats/recruitee-places.json @@ -0,0 +1,84 @@ +{ + "offers": [ + { + "id": 7001, + "title": "Head of People", + "careers_url": "https://acme.example/o/head-of-people", + "department": "People", + "city": "Amsterdam", + "location": "Amsterdam, Noord-Holland, Netherlands", + "country_code": "NL", + "remote": false, + "hybrid": true, + "on_site": true, + "published_at": "2026-09-29 16:01:39 UTC", + "description": "

Lead people.

", + "experience_code": "experienced", + "employment_type_code": "fulltime_permanent", + "salary": { + "min": null, + "max": null, + "currency": null, + "period": null + }, + "locations": [ + { + "id": 1, + "name": "Amsterdam", + "city": "Amsterdam", + "state": "Noord-Holland", + "country": "Netherlands", + "country_code": "NL" + }, + { + "id": 1, + "name": "Sofia", + "city": "Sofia", + "state": null, + "country": "Bulgaria", + "country_code": "BG" + } + ] + }, + { + "id": 7002, + "title": "Support Agent", + "careers_url": "https://acme.example/o/support-agent", + "department": "Support", + "city": "", + "location": "Remote job", + "remote": true, + "published_at": "2026-09-20 10:00:00 UTC", + "description": "", + "experience_code": "entry_level", + "employment_type_code": "parttime_permanent", + "salary": {}, + "locations": [] + }, + { + "id": 7003, + "title": "Intern Finance", + "careers_url": "https://acme.example/o/intern-finance", + "department": "Finance", + "city": "Berlin", + "location": "Berlin, Berlin, Germany", + "country_code": "DE", + "remote": false, + "published_at": "2026-09-01 00:00:00 UTC", + "description": "", + "experience_code": "student_school", + "employment_type_code": "internship", + "salary": {}, + "locations": [ + { + "id": 1, + "name": "Berlin", + "city": "Berlin", + "state": "Berlin", + "country": "Germany", + "country_code": "DE" + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/fixtures/ats/rippling-places.json b/tests/fixtures/ats/rippling-places.json new file mode 100644 index 0000000..893505d --- /dev/null +++ b/tests/fixtures/ats/rippling-places.json @@ -0,0 +1,106 @@ +[ + { + "uuid": "75ad50c6-778f-42ee-9c63-70d1cd687202", + "name": "Account Executive, Broker Channel (Austin & San Antonio)", + "department": { + "id": "Sales", + "label": "Sales" + }, + "url": "https://ats.rippling.com/rippling/jobs/75ad50c6-778f-42ee-9c63-70d1cd687202", + "workLocation": { + "label": "Austin, TX", + "id": "Austin, TX" + } + }, + { + "uuid": "94486f41-6474-446a-b67a-c164e11354ea", + "name": "Account Executive, Broker Channel (Pittsburgh or Cleveland)", + "department": { + "id": "Sales", + "label": "Sales" + }, + "url": "https://ats.rippling.com/rippling/jobs/94486f41-6474-446a-b67a-c164e11354ea", + "workLocation": { + "label": "Pittsburgh, PA", + "id": "Pittsburgh, PA" + } + }, + { + "uuid": "94486f41-6474-446a-b67a-c164e11354ea", + "name": "Account Executive, Broker Channel (Pittsburgh or Cleveland)", + "department": { + "id": "Sales", + "label": "Sales" + }, + "url": "https://ats.rippling.com/rippling/jobs/94486f41-6474-446a-b67a-c164e11354ea", + "workLocation": { + "label": "Cleveland, OH", + "id": "Cleveland, OH" + } + }, + { + "uuid": "2f2ae4c8-ec56-4d1f-8f2a-0d295674e19c", + "name": "Director of Engineering - Infrastructure", + "department": { + "id": "Engineering", + "label": "Engineering" + }, + "url": "https://ats.rippling.com/rippling/jobs/2f2ae4c8-ec56-4d1f-8f2a-0d295674e19c", + "workLocation": { + "label": "San Francisco, CA", + "id": "San Francisco, CA" + } + }, + { + "uuid": "2f2ae4c8-ec56-4d1f-8f2a-0d295674e19c", + "name": "Director of Engineering - Infrastructure", + "department": { + "id": "Engineering", + "label": "Engineering" + }, + "url": "https://ats.rippling.com/rippling/jobs/2f2ae4c8-ec56-4d1f-8f2a-0d295674e19c", + "workLocation": { + "label": "Seattle, WA", + "id": "Seattle, WA" + } + }, + { + "uuid": "2f2ae4c8-ec56-4d1f-8f2a-0d295674e19c", + "name": "Director of Engineering - Infrastructure", + "department": { + "id": "Engineering", + "label": "Engineering" + }, + "url": "https://ats.rippling.com/rippling/jobs/2f2ae4c8-ec56-4d1f-8f2a-0d295674e19c", + "workLocation": { + "label": "New York, NY", + "id": "New York, NY" + } + }, + { + "uuid": "46b4af52-824b-4803-be84-e8ed57bd33a1", + "name": "Account Executive, Private Equity", + "department": { + "id": "Sales", + "label": "Sales" + }, + "url": "https://ats.rippling.com/rippling/jobs/46b4af52-824b-4803-be84-e8ed57bd33a1", + "workLocation": { + "label": "Remote (United States)", + "id": "Remote (United States)" + } + }, + { + "uuid": "19ae5b34-e7b7-4164-99d4-fc8f84bb37fe", + "name": "Accounting Manager, PEO Compliance", + "department": { + "id": "Finance", + "label": "Finance" + }, + "url": "https://ats.rippling.com/rippling/jobs/19ae5b34-e7b7-4164-99d4-fc8f84bb37fe", + "workLocation": { + "label": "Remote (United States)", + "id": "Remote (United States)" + } + } +] diff --git a/tests/fixtures/ats/smartrecruiters-places.json b/tests/fixtures/ats/smartrecruiters-places.json new file mode 100644 index 0000000..46efc4f --- /dev/null +++ b/tests/fixtures/ats/smartrecruiters-places.json @@ -0,0 +1,31 @@ +{ + "offset": 0, + "limit": 2, + "totalFound": 3, + "content": [ + { + "id": "744000151326819", + "name": "Dir, Software Engrg Mgmt", + "company": {"identifier": "Acme", "name": "Acme"}, + "releasedDate": "2026-09-23T08:47:37.279Z", + "location": { + "city": "Berlin", + "country": "de", + "remote": false, + "hybrid": false, + "fullLocation": "Berlin, Germany" + }, + "department": {"id": "2294038", "label": "Engineering, Infrastructure and Operations"}, + "function": {"id": "engineering", "label": "Engineering"} + }, + { + "id": "744000147485112", + "name": "Sales Enablement Manager", + "company": {"identifier": "Acme", "name": "Acme"}, + "releasedDate": "2026-09-10T09:00:00.000Z", + "location": {"city": "", "country": "", "remote": true, "fullLocation": "Remote"}, + "department": {"id": "1", "label": "Sales"}, + "function": {"id": "sales", "label": "Sales"} + } + ] +} diff --git a/tests/fixtures/ats/successfactors-places-detail.html b/tests/fixtures/ats/successfactors-places-detail.html new file mode 100644 index 0000000..7d8b511 --- /dev/null +++ b/tests/fixtures/ats/successfactors-places-detail.html @@ -0,0 +1,98 @@ + +Director, Service Commercial Job Details | Vestas + +
+
+
+
+ +
+
+
+
+
+
+

+Director, Service Commercial + +

+
+
+
+
+
+
+
+
+Requisition ID:  + +78026 + +
+
+
+
+
+
+
+
+Location(s):  + + +

+Seoul, Seoul-teukpyolsi, KR, 04323 + +

+
+
+
+
+
+
+
+
+
+Work experience:  + +Senior Management + +
+
+
+
+
+
+
+
+Type of position:  + +Full-Time + +
+
+
+
+
+
+
+
+Job Family:  + +Commercial + +
+
+
+
+
+
+
+
+ +

 Vestas Factory

+

Senior Management | Full-Time | Commercial 

Are you an inspiring, customer-centric people leader with a clear commercial focus? Then this could be an opportunity for you.

+

The Service Commercial Asia team is a motivated, international group that thrives at the intersection of customer value and commercial performance. With diverse perspectives spanning regions and cultures, we support our offshore and onshore service business in Asia. We are commercially minded and deeply customer focused, looking beyond the numbers to understand our customers’ real challenges and opportunities. Curiosity and innovation guide how we work, how we partner with customers, and how we grow the business. Collaboration, openness, and progressive thinking define our culture - creating a team where ideas are welcomed, people are supported in their development, and impact is visible on a global scale.

+

 

+

Responsibilities

diff --git a/tests/fixtures/ats/successfactors-places.html b/tests/fixtures/ats/successfactors-places.html new file mode 100644 index 0000000..4496600 --- /dev/null +++ b/tests/fixtures/ats/successfactors-places.html @@ -0,0 +1,243 @@ + +Vestas Jobs + +
+
+
+
+
+ +
+
+
+ +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +Job Title + + + + +Location + + + + +Job Family + + + + +Work Experience + + +
+ + + + + + + + +
+ + + + +Reset +
+
+ +Director, Service Commercial + +
+ +Director, Service Commercial + + + +Seoul, Seoul-teukpyolsi, KR, 04323 + +29 Sept 2026 + +
+
+ +Seoul, Seoul-teukpyolsi, KR, 04323 + + +Commercial + +Senior Management +
+ +Stock Keeper + +
+ +Stock Keeper + + + +Chetwynd, British Columbia, CA + +29 Sept 2026 + +
+
+ +Chetwynd, British Columbia, CA + + +Supply Chain and Logistics + +Skilled Worker / Semi-Skilled Worker +
+ +Wind Technician II Panther Grove II- Gridley, IL + +
+ +Wind Technician II Panther Grove II- Gridley, IL + + + +Gridley, IL, US + +29 Sept 2026 + +
+
+ +Gridley, IL, US + + +Field Operations + +Skilled Worker / Semi-Skilled Worker +
+ +Wind Site Technician III - Moriarty, NM + +
+ +Wind Site Technician III - Moriarty, NM + + + +Clines Corners, NM, US + +29 Sept 2026 + +
+
+ +Clines Corners, NM, US + + +Field Operations + +Skilled Worker / Semi-Skilled Worker +
+ +Manufacturing Finance Controller + +
+ +Manufacturing Finance Controller + + + +Pasay, 00, PH, 1300 + +29 Sept 2026 + +
+
+ +Pasay, 00, PH, 1300 + + +Finance + +Professional +
diff --git a/tests/fixtures/ats/successfactors.slug b/tests/fixtures/ats/successfactors.slug new file mode 100644 index 0000000..920abf5 --- /dev/null +++ b/tests/fixtures/ats/successfactors.slug @@ -0,0 +1 @@ +careers.vestas.com diff --git a/tests/fixtures/ats/teamtailor-places.xml b/tests/fixtures/ats/teamtailor-places.xml new file mode 100644 index 0000000..be08e20 --- /dev/null +++ b/tests/fixtures/ats/teamtailor-places.xml @@ -0,0 +1,64 @@ + + + + Kry + Job openings + https://career.kry.se/jobs + + Software Engineer + <h1>About the role</h1><p>Build &amp; run care.</p> + Wed, 23 Sep 2026 12:59:53 +0200 + https://career.kry.se/jobs/8440833-software-engineer + hybrid + 39ac1fca-a904-4905-b780-18c599e99b07 + Kry + + + Sverige + SverigeSweden + + + Stockholm, SverigeTorsgatan 21 + 113 21StockholmSweden + + + Stockholm, SverigeTorsgatan 21 + 113 21StockholmSweden + + + Engineering + + + + Läkare + <p>Träffa patienter.</p> + Fri, 31 Jul 2026 14:51:42 +0200 + https://career.kry.se/jobs/8156121-lakare + fully + 9787a509-ff84-400a-ad68-84e22c4cf2fb + + + SwedenKarlsrovägen 2D + 182 53DanderydSweden + + + + Software Development + + + Sales Lead + + https://career.kry.se/jobs/8156122-sales-lead + none + 0a0a0a0a-ff84-400a-ad68-84e22c4cf2fb + + Sales + + + + Elsewhere + javascript:alert(1) + bad + + + diff --git a/tests/fixtures/ats/workable-places.json b/tests/fixtures/ats/workable-places.json new file mode 100644 index 0000000..172824b --- /dev/null +++ b/tests/fixtures/ats/workable-places.json @@ -0,0 +1,96 @@ +{ + "total": 3, + "nextPage": null, + "results": [ + { + "id": 8001, + "shortcode": "AAA111", + "title": "Support Engineer", + "remote": false, + "location": { + "country": "Germany", + "countryCode": "DE", + "city": "Berlin", + "region": null, + "hidden": false + }, + "locations": [ + { + "country": "Germany", + "countryCode": "DE", + "city": "Berlin", + "region": null, + "hidden": false + }, + { + "country": "Germany", + "countryCode": "DE", + "city": "Munich", + "region": "Bavaria", + "hidden": false + }, + { + "country": "France", + "countryCode": "FR", + "city": "Paris", + "region": null, + "hidden": false + } + ], + "state": "published", + "published": "2026-09-21T00:00:00.000Z", + "type": "full", + "department": [ + "Support" + ], + "workplace": "hybrid" + }, + { + "id": 8002, + "shortcode": "BBB222", + "title": "Recruiter", + "remote": true, + "location": { + "country": "France", + "countryCode": "FR", + "city": "", + "region": null, + "hidden": true + }, + "locations": [ + { + "country": "France", + "countryCode": "FR", + "city": "", + "region": null, + "hidden": true + } + ], + "state": "published", + "published": "2026-09-22T00:00:00.000Z", + "type": "part", + "department": [ + "People" + ], + "workplace": "remote" + }, + { + "id": 8003, + "shortcode": "CCC333", + "title": "Analyst", + "remote": false, + "location": { + "country": "Norway", + "countryCode": "NO", + "city": "Oslo", + "region": null, + "hidden": false + }, + "state": "published", + "published": "2026-09-23T00:00:00.000Z", + "type": "volunteer", + "department": [], + "workplace": "on_site" + } + ] +} \ No newline at end of file diff --git a/tests/fixtures/ats/workday-places-detail.json b/tests/fixtures/ats/workday-places-detail.json new file mode 100644 index 0000000..ad7d569 --- /dev/null +++ b/tests/fixtures/ats/workday-places-detail.json @@ -0,0 +1,14 @@ +{ + "jobPostingInfo": { + "id": "a3e856e804b51001b17f97f048070000", + "title": "Associate Solutions Architect", + "jobDescription": "

Support customers.

", + "location": "Denmark - Copenhagen", + "additionalLocations": ["Sweden - Stockholm", "Remote, Mexico City, Mexico", "Denmark - Copenhagen"], + "startDate": "2026-09-29", + "timeType": "Full time", + "country": {"descriptor": "Denmark", "id": "x"}, + "jobRequisitionLocation": {"descriptor": "Denmark - Copenhagen", "country": {"descriptor": "Denmark", "id": "x", "alpha2Code": "DK"}}, + "remoteType": "Hybrid" + } +} diff --git a/tests/fixtures/ats/workday-places.json b/tests/fixtures/ats/workday-places.json new file mode 100644 index 0000000..ed913d6 --- /dev/null +++ b/tests/fixtures/ats/workday-places.json @@ -0,0 +1,56 @@ +{ + "total": 124, + "jobPostings": [ + { + "title": "Associate Solutions Architect", + "externalPath": "/job/Remote-Mexico-City-Mexico/Associate-Solutions-Architect_R35358", + "locationsText": "Remote, Mexico City, Mexico", + "postedOn": "Posted Today", + "remoteType": "Fully Flexible", + "bulletFields": [ + "R35358" + ] + }, + { + "title": "Business Development Representative", + "externalPath": "/job/Lisbon-Portugal/Business-Development-Representative_R35239", + "locationsText": "Lisbon, Portugal", + "postedOn": "Posted Today", + "remoteType": "In Office", + "bulletFields": [ + "R35239" + ] + }, + { + "title": "Sales Development Representative", + "externalPath": "/job/Lisbon-Portugal/Sales-Development-Representative_R35277", + "locationsText": "Lisbon, Portugal", + "postedOn": "Posted Today", + "remoteType": "Hybrid", + "bulletFields": [ + "R35277" + ] + }, + { + "title": "FSS RevOps Customer Support Sr. Specialist", + "externalPath": "/job/Manila-Philippines/FSS-RevOps-Customer-Support-Sr-Specialist_R35551-1", + "locationsText": "Manila, Philippines", + "postedOn": "Posted Today", + "remoteType": "Fully Flexible", + "bulletFields": [ + "R35551" + ] + }, + { + "title": "FSS RevOps Deal Support Sr. Specialist", + "externalPath": "/job/Manila-Philippines/FSS-Revenue-Operations-Sr-Specialist_R35544-1", + "locationsText": "Manila, Philippines", + "postedOn": "Posted Today", + "remoteType": "Hybrid", + "bulletFields": [ + "R35544" + ] + } + ], + "userAuthenticated": false +} diff --git a/tests/fixtures/ats/workday.slug b/tests/fixtures/ats/workday.slug new file mode 100644 index 0000000..796b03a --- /dev/null +++ b/tests/fixtures/ats/workday.slug @@ -0,0 +1 @@ +zendesk.wd1/zendesk diff --git a/tests/test_ats_oracle.py b/tests/test_ats_oracle.py index 91e17f5..e5b4123 100644 --- a/tests/test_ats_oracle.py +++ b/tests/test_ats_oracle.py @@ -46,7 +46,8 @@ def test_rows_carry_the_listing_fields() -> None: assert first["title"] == "Supply Chain Program Manager" assert first["url"] == f"https://{HOST}/hcmUI/CandidateExperience/en/sites/CX_1/job/39905" assert first["posted"] is not None and first["posted"].isoformat() == "2026-09-28T00:00:00+00:00" - assert first["description"].startswith("Nokia is searching for a Supply Chain Program") + assert first["description"] == "" # the text comes with the role's own read + assert first["teaser"].startswith("Nokia is searching for a Supply Chain Program") assert first["salary_text"] == "" and "salary_min" not in first assert all(is_web_url(r["url"]) for r in rows) @@ -58,6 +59,17 @@ def test_the_locations_are_the_primary_and_the_secondary_ones() -> None: assert rows[2]["location"] == "India" +def test_every_place_is_kept_with_its_work_mode_and_the_countrys_code() -> None: + rows = _rows() + assert [p["text"] for p in rows[1]["places"]] == [ + "Malaysia", "Philippines", "Indonesia", "Thailand"] + assert [p["remote"] for p in rows[0]["places"]] == [False, False] # hybrid + assert [p["remote"] for p in rows[4]["places"]] == [True] # remote + assert [p["remote"] for p in rows[3]["places"]] == [None] # states none + # One country when the places share one, none over several. + assert [r["country"] for r in rows] == [None, None, "IN", "DE", "US"] + + def test_remote_follows_the_workplace_type_code() -> None: assert [r["remote"] for r in _rows()] == ["hybrid", "hybrid", "onsite", None, "remote"] @@ -237,11 +249,11 @@ def test_only_the_pod_named_by_the_slug_is_allowed() -> None: assert ats._allowed_host("oracle", SLUG)(HOST) -def test_the_careers_page_is_the_candidate_site_and_robots_reads_it() -> None: +def test_the_careers_page_is_the_candidate_site() -> None: url = f"https://{HOST}/hcmUI/CandidateExperience/en/sites/CX_1/jobs" assert oracle.careers_url(SLUG) == ats.careers_url(f"oracle:{SLUG}") == url - assert oracle.robots_page(SLUG) == url - assert oracle.allowed(SLUG)(httpx.URL(oracle.robots_page(SLUG)).host) + assert oracle.allowed(SLUG)(httpx.URL(url).host) + assert not hasattr(oracle, "robots_page") # decided when built, see READS.robots def test_a_slug_written_with_capitals_names_the_same_pod() -> None: diff --git a/tests/test_ats_personio.py b/tests/test_ats_personio.py new file mode 100644 index 0000000..cb644b7 --- /dev/null +++ b/tests/test_ats_personio.py @@ -0,0 +1,59 @@ +"""Personio: every office of a role, the level and the employment it states. +No network: the fixtures are saved feeds.""" + +from __future__ import annotations + +import logging +import sys +from pathlib import Path + +import pytest + +ROOT = Path(__file__).resolve().parents[1] +if str(ROOT) not in sys.path: + sys.path.insert(0, str(ROOT)) + +from app.models import SENIORITIES # noqa: E402 +from plugins.readers import Ask, personio # noqa: E402 + +FIXTURES = ROOT / "tests" / "fixtures" / "ats" + + +def _rows() -> list[dict]: + return personio.parse((FIXTURES / "personio-places.xml").read_bytes(), "acme") + + +def test_the_declaration_says_what_the_feed_gives() -> None: + reads = personio.READS + assert (reads.listing, reads.places, reads.text) == ("whole", "many", "listing") + assert reads.fields.posted == "trusted" and reads.fields.seniority == "stated" + assert reads.robots.startswith("api: no robots.txt check needed") + assert not hasattr(personio, "robots_page") + assert personio.feed_url("acme", Ask()) == "https://acme.jobs.personio.de/xml" + + +def test_additional_offices_are_places_of_the_role_each_once() -> None: + first = _rows()[0] + assert [p["text"] for p in first["places"]] == ["Remote - Germany", "Berlin", "Hamburg"] + assert [p["remote"] for p in first["places"]] == [True, None, None] + assert first["location"] == "Remote - Germany; Berlin; Hamburg" + assert first["remote"] is True # one of the places is remote + assert _rows()[1]["places"] == [{"text": "Munich", "remote": None}] + assert _rows()[1]["remote"] is None + + +def test_the_stated_level_and_employment_are_mapped() -> None: + rows = _rows() + assert [r["seniority"] for r in rows] == ["junior", "exec", "intern"] + # permanent + full-time; permanent + full-time; working student wins over part-time + assert [r["employment"] for r in rows] == ["full_time", "full_time", "internship"] + + +def test_the_table_speaks_the_apps_vocabulary_and_a_new_word_is_logged( + caplog: pytest.LogCaptureFixture) -> None: + assert {v for v in personio._SENIORITY.values() if v} <= set(SENIORITIES) + with caplog.at_level(logging.DEBUG, logger=personio.__name__): + assert personio._seniority("wizard") is None + assert personio._seniority("experienced") is None # known, names no level + assert personio._seniority("") is None + assert [r.getMessage() for r in caplog.records] == ["personio: unknown seniority 'wizard'"] diff --git a/tests/test_ats_phenom.py b/tests/test_ats_phenom.py index 9ea73d5..0decca2 100644 --- a/tests/test_ats_phenom.py +++ b/tests/test_ats_phenom.py @@ -45,12 +45,25 @@ def test_rows_carry_the_listing_fields() -> None: first = rows[0] assert first["title"] == "Principal Economy Designer | New Games" assert first["department"] == "Games Design & Production" - assert first["posted"] is not None and first["posted"].isoformat() == "2026-09-29T00:00:00+00:00" - assert first["description"].startswith("Become part of our team and help shape the economic") + assert first["description"] == "" # the text comes with the role's own page + assert first["teaser"].startswith("Become part of our team and help shape the economic") assert first["remote"] is None and first["salary_text"] == "" assert all(is_web_url(r["url"]) for r in rows) +def test_posted_is_the_date_the_role_was_created_not_the_one_the_site_moves() -> None: + """The second role was created on 15 June and is listed as posted on 28 + September; Phenom refreshes `postedDate`, so the creation date is taken, and + `postedDate` only where a site sends no `dateCreated`.""" + rows = _rows() + assert rows[0]["posted"].isoformat() == "2026-09-29T09:59:51.253000+00:00" + assert rows[1]["posted"].isoformat() == "2026-06-15T17:02:06.245000+00:00" + data = _answer() + del data["refineSearch"]["data"]["jobs"][1]["dateCreated"] + assert phenom.parse(json.dumps(data).encode(), SLUG)[1]["posted"].isoformat() == \ + "2026-09-28T00:00:00+00:00" + + def test_the_url_is_the_role_page_on_the_site_not_the_apply_system() -> None: """`applyUrl` points at Workday; the role's page is `/job//`.""" assert _answer()["refineSearch"]["data"]["jobs"][0]["applyUrl"].startswith("https://xboxgaming.") @@ -66,6 +79,14 @@ def test_the_locations_are_every_place_the_role_names() -> None: assert rows[1]["location"] == "Stockholm, Stockholm County, Sweden" +def test_every_place_is_kept_once_and_the_first_is_the_roles_own() -> None: + rows = _rows() + assert [p["text"] for p in rows[0]["places"]] == [ + "Barcelona, Spain", "London, London, United Kingdom", "Stockholm, Stockholm County, Sweden"] + assert rows[2]["places"][0]["text"] == "London, London, United Kingdom" + assert all(p["remote"] is None for r in rows for p in r["places"]) + + def test_a_role_with_one_place_only_uses_location() -> None: data = _answer() job = data["refineSearch"]["data"]["jobs"][0] @@ -264,11 +285,11 @@ def test_only_the_site_named_by_the_slug_is_allowed() -> None: assert ats._allowed_host("phenom", SLUG)("careers.king.com") -def test_the_careers_page_is_the_search_page_and_robots_reads_it() -> None: +def test_the_careers_page_is_the_search_page() -> None: url = "https://careers.king.com/us/en/search-results" assert phenom.careers_url(SLUG) == ats.careers_url(f"phenom:{SLUG}") == url - assert phenom.robots_page(SLUG) == url - assert phenom.allowed(SLUG)(httpx.URL(phenom.robots_page(SLUG)).host) + assert phenom.allowed(SLUG)(httpx.URL(url).host) + assert not hasattr(phenom, "robots_page") # decided when built, see READS.robots assert phenom.careers_url("www.careers.philips.com/global/en") == \ "https://www.careers.philips.com/global/en/search-results" diff --git a/tests/test_ats_pinpoint.py b/tests/test_ats_pinpoint.py index 59d0ba0..bffc5cb 100644 --- a/tests/test_ats_pinpoint.py +++ b/tests/test_ats_pinpoint.py @@ -116,7 +116,7 @@ def test_the_board_is_read_through_the_app_and_is_complete() -> None: def test_the_slug_the_urls_and_the_allow_list() -> None: assert pinpoint.slug_ok("xeneta") and pinpoint.slug_ok("Xeneta") and pinpoint.slug_ok("a-b1") assert pinpoint.careers_url("xeneta") == "https://xeneta.pinpointhq.com/" - assert pinpoint.robots_page("xeneta") == "https://xeneta.pinpointhq.com/" + assert not hasattr(pinpoint, "robots_page") # decided when built, see READS.robots assert pinpoint.feed_url("Xeneta") == "https://xeneta.pinpointhq.com/postings.json" allow = pinpoint.allowed("Xeneta") assert allow("xeneta.pinpointhq.com") and allow("XENETA.pinpointhq.com") @@ -153,3 +153,17 @@ def test_a_pinpoint_board_is_not_probed() -> None: assert not hasattr(pinpoint, "probe_url") + + +def test_a_role_has_its_one_place_with_the_work_mode_of_the_role() -> None: + rows = pinpoint.parse((FIXTURES / "pinpoint.json").read_bytes(), "xeneta") + assert rows[0]["places"] == [{"text": "Bucharest", "remote": False}] # hybrid + assert rows[0]["location"] == "Bucharest" + + +def test_employment_is_read_from_the_type_and_an_unknown_one_is_left() -> None: + rows = pinpoint.parse((FIXTURES / "pinpoint.json").read_bytes(), "xeneta") + assert [r["employment"] for r in rows] == ["full_time", "temporary"] + assert pinpoint._employment("permanent_part_time") == "part_time" + assert pinpoint._employment("internship") == "internship" + assert pinpoint._employment("something_new") is None diff --git a/tests/test_ats_recruitee.py b/tests/test_ats_recruitee.py new file mode 100644 index 0000000..33f031e --- /dev/null +++ b/tests/test_ats_recruitee.py @@ -0,0 +1,75 @@ +"""Recruitee: every location of an offer, the placeholder that is not one, the +level and the employment it states. No network: the fixture has the shape of +bunq's board, read on 2026-09-30.""" + +from __future__ import annotations + +import logging +import sys +from pathlib import Path + +import pytest + +ROOT = Path(__file__).resolve().parents[1] +if str(ROOT) not in sys.path: + sys.path.insert(0, str(ROOT)) + +from app.models import SENIORITIES # noqa: E402 +from plugins.readers import Ask, recruitee # noqa: E402 + +FIXTURES = ROOT / "tests" / "fixtures" / "ats" + + +def _rows() -> list[dict]: + return recruitee.parse((FIXTURES / "recruitee-places.json").read_bytes(), "acme") + + +def test_the_declaration_says_what_the_feed_gives() -> None: + reads = recruitee.READS + assert (reads.listing, reads.places, reads.text) == ("whole", "many", "listing") + assert reads.fields.posted == "trusted" and reads.fields.country == "stated" + assert reads.robots.startswith("api: no robots.txt check needed") + assert recruitee.feed_url("acme", Ask()) == "https://acme.recruitee.com/api/offers/" + + +def test_every_location_is_a_place_and_the_country_is_stated_when_they_share_one() -> None: + first, _remote, berlin = _rows() + assert [p["text"] for p in first["places"]] == [ + "Amsterdam, Noord-Holland, Netherlands", "Sofia, Bulgaria"] + assert first["location"] == "Amsterdam, Noord-Holland, Netherlands; Sofia, Bulgaria" + assert first["country"] is None # NL and BG + assert berlin["places"] == [{"text": "Berlin, Germany", "remote": None}] + assert berlin["country"] == "DE" + + +def test_remote_job_is_not_a_place() -> None: + remote = _rows()[1] + assert remote["places"] == [{"text": "Remote", "remote": True}] + assert remote["location"] == "Remote" + offer = {"id": 1, "title": "T", "careers_url": "https://a.example/o/t", "location": "Remote job", + "remote": False} + assert recruitee._places(offer) == ([], set()) + + +def test_an_offer_without_a_locations_list_falls_back_to_its_location() -> None: + offer = {"location": "Lisbon, Portugal", "country_code": "pt"} + assert recruitee._places(offer) == ([{"text": "Lisbon, Portugal", "remote": None}], {"PT"}) + + +def test_the_stated_level_and_employment_are_mapped() -> None: + rows = _rows() + assert [r["seniority"] for r in rows] == [None, "junior", "intern"] + assert [r["employment"] for r in rows] == ["full_time", "part_time", "internship"] + assert recruitee._employment("fulltime_fixed_term") == "temporary" + assert recruitee._employment("freelance") == "contract" + + +def test_the_table_speaks_the_apps_vocabulary_and_a_new_word_is_logged( + caplog: pytest.LogCaptureFixture) -> None: + assert {v for v in recruitee._SENIORITY.values() if v} <= set(SENIORITIES) + with caplog.at_level(logging.DEBUG, logger=recruitee.__name__): + assert recruitee._seniority("senior_level") is None + assert recruitee._employment("odd_job") is None + assert [r.getMessage() for r in caplog.records] == [ + "recruitee: unknown experience_code 'senior_level'", + "recruitee: unknown employment_type_code 'odd_job'"] diff --git a/tests/test_ats_rippling.py b/tests/test_ats_rippling.py index 54b94dc..74da897 100644 --- a/tests/test_ats_rippling.py +++ b/tests/test_ats_rippling.py @@ -88,10 +88,11 @@ def test_detail_reads_description_places_date_and_a_single_yearly_range() -> Non found = rippling.detail(_get((FIXTURES / "rippling-role.json").read_bytes(), asked), "rippling", row) assert asked == [f"https://api.rippling.com/platform/api/ats/v1/board/rippling/jobs/{DIRECTOR}"] - assert set(found) <= set(ats.DETAIL_FIELDS) assert found["description"].startswith("About The Role") assert "<" not in found["description"] assert found["location"] == "San Francisco, CA; Seattle, WA; New York, NY" + assert [p["text"] for p in found["places"]] == ["San Francisco, CA", "Seattle, WA", "New York, NY"] + assert found["employment"] == "full_time" # employmentType.label SALARIED_FT assert found["posted"] is not None and found["posted"].isoformat() == \ "2025-04-07T12:29:19.348000-07:00" assert (found["salary_min"], found["salary_max"], found["currency"]) == (216000, 378000, "USD") @@ -102,6 +103,7 @@ def test_detail_without_pay_leaves_the_pay_columns_out() -> None: "prisma-careers", {"source_id": "x"}) assert found["description"].startswith("What is it like to work at Prisma?") assert found["location"] == "Remote (Germany)" + assert found["places"] == [{"text": "Remote (Germany)", "remote": True}] assert not {"salary_min", "salary_max", "currency"} & set(found) @@ -155,16 +157,6 @@ def test_the_board_is_one_request_and_complete(web: dict[str, Any]) -> None: assert len(rows) == 5 and complete and web["asked"] == [FEED] -def test_robots_are_read_from_the_site_and_disallow_only_internal( - web: dict[str, Any]) -> None: - web["answers"]["https://ats.rippling.com/robots.txt"] = b"User-agent: *\nDisallow: /internal/\n" - with httpx.Client() as client: - ats._check_robots(client, "rippling:prisma-careers") - web["answers"]["https://ats.rippling.com/robots.txt"] = b"User-agent: *\nDisallow: /\n" - with pytest.raises(ats._Disallowed): - ats._check_robots(client, "rippling:prisma-careers") - - # ------------------------------------------------------- slugs and hosts def test_the_module_is_registered_as_a_feed_host_with_detail() -> None: @@ -173,10 +165,10 @@ def test_the_module_is_registered_as_a_feed_host_with_detail() -> None: assert hasattr(rippling, "detail") and not hasattr(rippling, "page") -def test_the_urls_and_the_robots_page() -> None: +def test_the_urls() -> None: assert rippling.feed_url("rippling") == FEED assert rippling.careers_url("prisma-careers") == "https://ats.rippling.com/prisma-careers/jobs" - assert rippling.robots_page("prisma-careers") == rippling.careers_url("prisma-careers") + assert not hasattr(rippling, "robots_page") # decided when built, see READS.robots allow = rippling.allowed("rippling") assert allow("api.rippling.com") and allow("ATS.RIPPLING.COM") for host in ("rippling.com", "www.rippling.com", "api.rippling.com.evil.example", "localhost"): @@ -199,8 +191,7 @@ def test_a_hostile_slug_is_refused(slug: str) -> None: def test_no_slug_reaches_another_host() -> None: for slug in ("rippling", "Prisma-Careers", "a-b_c"): - for url in (rippling.feed_url(slug), rippling.careers_url(slug), - rippling.robots_page(slug)): + for url in (rippling.feed_url(slug), rippling.careers_url(slug)): assert httpx.URL(url).host in ("api.rippling.com", "ats.rippling.com") @@ -210,3 +201,15 @@ def test_discovery_finds_the_board_slug() -> None: '<script>fetch("https://api.rippling.com/platform/api/ats/v1/board/beta/jobs")</script>') assert [(h, s) for h, s, _ in boards_in(page)] == [ ("rippling", "prisma-careers"), ("rippling", "Acme"), ("rippling", "beta")] + + +def test_a_role_at_several_places_keeps_each_once_and_is_remote_only_if_all_are() -> None: + rows = {r["source_id"]: r for r in rippling.parse(BOARD, "rippling")} + director = rows[DIRECTOR] + assert [p["text"] for p in director["places"]] == [ + "San Francisco, CA", "Seattle, WA", "New York, NY"] + assert director["location"] == "San Francisco, CA; Seattle, WA; New York, NY" + assert director["remote"] is None + remote = next(r for r in rows.values() if r["places"] == [ + {"text": "Remote (United States)", "remote": True}]) + assert remote["remote"] is True diff --git a/tests/test_ats_smartrecruiters.py b/tests/test_ats_smartrecruiters.py new file mode 100644 index 0000000..aa616c7 --- /dev/null +++ b/tests/test_ats_smartrecruiters.py @@ -0,0 +1,92 @@ +"""SmartRecruiters: the place, country, level and employment a posting states. +No network: the shapes are those of Bosch's board, read on 2026-09-30.""" + +from __future__ import annotations + +import json +import logging +import sys +from pathlib import Path + +import pytest + +ROOT = Path(__file__).resolve().parents[1] +if str(ROOT) not in sys.path: + sys.path.insert(0, str(ROOT)) + +from app.models import SENIORITIES # noqa: E402 +from plugins.readers import Ask, smartrecruiters # noqa: E402 + +FIXTURES = ROOT / "tests" / "fixtures" / "ats" + + +def _posting(**fields: object) -> dict: + return {"id": "1", "name": "Engineer", "releasedDate": "2026-09-30T06:57:01.920Z", + "location": {"city": "Hatvan", "country": "hu", "remote": False, + "fullLocation": "Hatvan, , Hungary"}, **fields} + + +def _rows(*postings: dict) -> list[dict]: + return smartrecruiters.rows({"content": list(postings)}, "BoschGroup") + + +def test_the_declaration_says_what_the_list_gives() -> None: + reads = smartrecruiters.READS + assert (reads.listing, reads.page_size, reads.places, reads.text, reads.empty) == \ + ("paged", 100, "one", "none", "suspect") + assert reads.fields.posted == "trusted" and reads.fields.seniority == "stated" + assert reads.robots.startswith("api: no robots.txt check needed") + + +def test_page_reads_by_offset_and_takes_the_ask() -> None: + asked: list[str] = [] + + def get(url: str, **_: object) -> bytes: + asked.append(url) + return (FIXTURES / "smartrecruiters.json").read_bytes() + + _data, results, total, cursor = smartrecruiters.page(get, "Acme", None, Ask()) + assert asked == ["https://api.smartrecruiters.com/v1/companies/Acme/postings" + "?offset=0&limit=100"] + assert (len(results), total, cursor) == (2, 3, 2) + + +def test_the_place_is_one_clean_line_with_its_remote_flag_and_country() -> None: + [row] = _rows(_posting()) + assert row["places"] == [{"text": "Hatvan, Hungary", "remote": False}] # ", ," gone + assert row["location"] == "Hatvan, Hungary" and row["country"] == "HU" + [remote] = _rows(_posting(location={"remote": True, "fullLocation": "Remote", "country": ""})) + assert remote["places"] == [{"text": "Remote", "remote": True}] and remote["country"] is None + [none] = _rows(_posting(location={})) + assert none["places"] == [] and none["location"] == "" + + +def test_the_stated_level_and_employment_are_mapped() -> None: + [row] = _rows(_posting(experienceLevel={"id": "internship", "label": "Internship"}, + typeOfEmployment={"id": "intern", "label": "Intern"})) + assert (row["seniority"], row["employment"]) == ("intern", "internship") + levels = {"entry_level": "junior", "director": "director", "executive": "exec", + "associate": None, "mid_senior_level": None, "not_applicable": None} + for word, want in levels.items(): + [row] = _rows(_posting(experienceLevel={"id": word})) + assert row["seniority"] == want, word + [row] = _rows(_posting(typeOfEmployment={"id": "permanent"})) + assert row["employment"] is None + [row] = _rows(_posting()) + assert row["seniority"] is None and row["employment"] is None + + +def test_the_table_speaks_the_apps_vocabulary_and_a_new_word_is_logged( + caplog: pytest.LogCaptureFixture) -> None: + assert {v for v in smartrecruiters._SENIORITY.values() if v} <= set(SENIORITIES) + with caplog.at_level(logging.DEBUG, logger=smartrecruiters.__name__): + [row] = _rows(_posting(experienceLevel={"id": "guru"})) + assert row["seniority"] is None + assert [r.getMessage() for r in caplog.records] == [ + "smartrecruiters: unknown experienceLevel 'guru'"] + + +def test_the_saved_page_still_reads() -> None: + data = json.loads((FIXTURES / "smartrecruiters.json").read_bytes()) + assert [r["location"] for r in smartrecruiters.rows(data, "Acme")] == ["Berlin, Germany", + "Remote"] diff --git a/tests/test_ats_successfactors.py b/tests/test_ats_successfactors.py index df84b6e..044b62d 100644 --- a/tests/test_ats_successfactors.py +++ b/tests/test_ats_successfactors.py @@ -323,13 +323,39 @@ def test_detail_reads_the_description_the_date_and_the_country_code_of_an_addres assert got["posted"] == datetime(2026, 9, 29, 2, tzinfo=UTC) # The locality and the country's name; the region is cut to "Seou" by the site. assert got["location"] == "Seoul, South Korea" - assert set(got) <= set(ats.DETAIL_FIELDS) + assert got["places"] == [{"text": "Seoul, South Korea", "remote": None}] + assert got["country"] == "KR" + + +def test_detail_keeps_every_address_of_a_role_at_several_places() -> None: + """The page repeats the `jobLocation` block per place; the last one used to win.""" + got = _detail("successfactors-places-detail.html") + assert [p["text"] for p in got["places"]] == [ + "Seoul, South Korea", "Busan, South Korea", "Aarhus, Denmark"] + assert got["location"] == "Seoul, South Korea; Busan, South Korea; Aarhus, Denmark" + assert "country" not in got # KR and DK: no single country for the role + + +def test_detail_states_the_country_when_every_address_is_in_it() -> None: + text = _read("successfactors-places-detail.html").replace( + 'content="Aarhus, DK, 8200"', 'content="Daegu, KR, 41200"') + got = successfactors.detail(lambda url, **kw: text.encode(), "careers.vestas.com", + {"url": "https://careers.vestas.com/job/x/1/"}) + assert got["country"] == "KR" + + +def test_the_listing_place_is_the_roles_only_place_until_its_page_is_read() -> None: + rows = successfactors.rows(_read("successfactors-table.html"), "careers.vestas.com") + assert rows[0]["places"] == [{"text": "Seoul, Seoul-teukpyolsi, South Korea", "remote": None}] + assert all(r["places"] == ([{"text": r["location"], "remote": None}] if r["location"] else []) + for r in rows) def test_detail_reads_the_country_from_a_street_address() -> None: """Systematic and most other sites give one `streetAddress`, "City, CC, zip".""" got = _detail("successfactors-job-street.html") assert got["location"] == "Bern, Switzerland" + assert got["country"] == "CH" assert got["posted"] == datetime(2026, 9, 28, 2, tzinfo=UTC) assert got["description"].startswith("Senior Solution Engineer Defence") @@ -426,15 +452,16 @@ def test_a_redirect_to_the_back_end_is_refused() -> None: "careers.vestas.com") -def test_careers_url_and_robots_page_are_the_search_page() -> None: +def test_careers_url_is_the_search_page() -> None: assert ats.careers_url("successfactors:careers.vestas.com") == \ "https://careers.vestas.com/search/" assert ats.careers_url("successfactors:jobs.teradyne.com/MiR") == \ "https://jobs.teradyne.com/MiR/search/" for slug in GOOD: - page = successfactors.robots_page(slug) + page = successfactors.careers_url(slug) assert httpx.URL(page).host == slug.split("/")[0] assert successfactors.allowed(slug)(httpx.URL(page).host) + assert not hasattr(successfactors, "robots_page") # decided when built, see READS.robots def test_the_module_is_case_sensitive_about_the_prefix() -> None: @@ -443,24 +470,6 @@ def test_the_module_is_case_sensitive_about_the_prefix() -> None: assert successfactors._parts("jobs.teradyne.com/MiR") == ("jobs.teradyne.com", "/MiR") -# ------------------------------------------------------------------ robots - -def test_the_robots_txt_of_these_sites_allows_search_and_jobs_not_services() -> None: - robots = (FIXTURES / "successfactors-robots.txt").read_bytes() - for slug in GOOD: - assert ats._robots_allows(robots, successfactors.robots_page(slug)), slug - assert ats._robots_allows(robots, "https://careers.vestas.com/job/x/1431772533/") - assert not ats._robots_allows(robots, "https://careers.vestas.com/services/rss/job/") - assert not ats._robots_allows(robots, "https://careers.vestas.com/talentcommunity/apply/1/") - - -def test_a_site_that_disallows_its_search_is_refused(monkeypatch: pytest.MonkeyPatch) -> None: - robots = b"User-agent: *\nDisallow: /search/\n" - monkeypatch.setattr(ats, "_get", lambda client, url, host, slug, **kw: robots) - with pytest.raises(ats._Disallowed): - ats._check_robots(object(), "successfactors:careers.acme.com") # type: ignore[arg-type] - - # ---------------------------------------------------------------- discovery def test_discovery_finds_a_board_from_a_link_to_one_of_its_roles() -> None: diff --git a/tests/test_ats_teamtailor.py b/tests/test_ats_teamtailor.py new file mode 100644 index 0000000..46502ad --- /dev/null +++ b/tests/test_ats_teamtailor.py @@ -0,0 +1,50 @@ +"""Teamtailor: every location of a role, kept as a place. No network: the +fixture is the trimmed feed of Kry and Tobii, read on 2026-09-29.""" + +from __future__ import annotations + +import sys +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +if str(ROOT) not in sys.path: + sys.path.insert(0, str(ROOT)) + +from plugins.readers import Ask, teamtailor # noqa: E402 + +FIXTURES = ROOT / "tests" / "fixtures" / "ats" + + +def _rows() -> list[dict]: + return teamtailor.parse((FIXTURES / "teamtailor-places.xml").read_bytes(), "kry") + + +def test_the_declaration_says_what_the_feed_gives() -> None: + reads = teamtailor.READS + assert (reads.listing, reads.page_size, reads.places, reads.text, reads.complete) == \ + ("paged", 50, "many", "listing", "end") + assert reads.fields.posted == "trusted" and reads.fields.remote == "stated" + assert reads.robots.startswith("api: no robots.txt check needed") + assert not hasattr(teamtailor, "robots_page") + + +def test_page_takes_the_ask_and_reads_the_same_url() -> None: + asked: list[str] = [] + + def get(url: str, **_: object) -> bytes: + asked.append(url) + return (FIXTURES / "teamtailor-places.xml").read_bytes() + + _items, results, total, cursor = teamtailor.page(get, "kry", None, Ask()) + assert asked == ["https://kry.teamtailor.com/jobs.rss?per_page=50&offset=0"] + assert len(results) == 4 and total is None and cursor == 4 + + +def test_every_distinct_location_is_a_place_with_the_roles_work_mode() -> None: + first, second, third = _rows() + # "Sverige" (a city that is a country) once, Stockholm's twin once. + assert first["places"] == [{"text": "Sverige, Sweden", "remote": False}, # hybrid + {"text": "Stockholm, Sweden", "remote": False}] + assert first["location"] == "Sverige, Sweden; Stockholm, Sweden" + assert second["places"] == [{"text": "Danderyd, Sweden", "remote": True}] # fully + assert third["places"] == [] and third["location"] == "" diff --git a/tests/test_ats_workable.py b/tests/test_ats_workable.py new file mode 100644 index 0000000..db5291f --- /dev/null +++ b/tests/test_ats_workable.py @@ -0,0 +1,71 @@ +"""Workable: every location of a role, the country and the hours it states. +No network: the fixture has the shape of Hugging Face's board, read on +2026-09-30.""" + +from __future__ import annotations + +import json +import logging +import sys +from pathlib import Path + +import pytest + +ROOT = Path(__file__).resolve().parents[1] +if str(ROOT) not in sys.path: + sys.path.insert(0, str(ROOT)) + +from plugins.readers import Ask, workable # noqa: E402 + +FIXTURES = ROOT / "tests" / "fixtures" / "ats" + + +def _rows() -> list[dict]: + return workable.parse((FIXTURES / "workable-places.json").read_bytes(), "acme") + + +def test_the_declaration_says_what_the_list_gives() -> None: + reads = workable.READS + assert (reads.listing, reads.page_size, reads.places, reads.text) == \ + ("paged", 10, "many", "none") + assert reads.fields.posted == "trusted" and reads.fields.employment == "stated" + assert reads.robots.startswith("api: no robots.txt check needed") + + +def test_page_takes_the_ask_and_posts_the_same_body() -> None: + sent: list[dict] = [] + + def get(url: str, *, method: str = "GET", payload: dict | None = None, **_: object) -> bytes: + sent.append({"url": url, "method": method, "payload": payload}) + return b'{"total": 0, "results": []}' + + workable.page(get, "acme", None, Ask()) + workable.page(get, "acme", "tok", Ask()) + assert [s["payload"] for s in sent] == [{}, {"token": "tok"}] + + +def test_every_location_of_a_role_is_a_place_once() -> None: + first, remote, oslo = _rows() + assert [p["text"] for p in first["places"]] == ["Berlin, Germany", "Munich, Bavaria, Germany", + "Paris, France"] + assert first["location"] == "Berlin, Germany; Munich, Bavaria, Germany; Paris, France" + assert first["country"] is None # DE and FR + assert [p["remote"] for p in first["places"]] == [False] * 3 + assert remote["places"] == [{"text": "France", "remote": True}] + assert remote["country"] == "FR" + # A list-less answer (the older shape) still gives its one place. + assert oslo["places"] == [{"text": "Oslo, Norway", "remote": False}] + assert oslo["country"] == "NO" + + +def test_the_stated_hours_are_mapped_and_an_unknown_type_is_logged( + caplog: pytest.LogCaptureFixture) -> None: + with caplog.at_level(logging.DEBUG, logger=workable.__name__): + rows = _rows() + assert [r["employment"] for r in rows] == ["full_time", "part_time", None] + assert [r.getMessage() for r in caplog.records] == ["workable: unknown type 'volunteer'"] + + +def test_the_shape_of_a_real_list_answer_is_read() -> None: + data = json.loads((FIXTURES / "workable-places.json").read_bytes()) + assert workable.rows(data, "acme")[0]["url"] == "https://apply.workable.com/acme/j/AAA111/" diff --git a/tests/test_ats_workday.py b/tests/test_ats_workday.py index 8a6cfaa..dadb2b3 100644 --- a/tests/test_ats_workday.py +++ b/tests/test_ats_workday.py @@ -1,6 +1,6 @@ """The Workday host module: rows from saved listings, the paging quirks of a tenant's list endpoint against a fake `get`, `detail` from saved responses, -the slug and its allow-list, robots.txt and discovery's patterns. No network +the slug and its allow-list and discovery's patterns. No network -- every answer is a file under `tests/fixtures/ats/` or written here.""" from __future__ import annotations @@ -74,7 +74,10 @@ def test_rows_of_a_site_called_jobs_state_the_requisition_id_and_no_date_past_30 rows = workday.rows(_load("workday-redhat.json"), "redhat.wd5/jobs") assert [r["source_id"] for r in rows] == [ "R-059377", "R-058740", "R-059566", "R-058743"] # not the reposts' "-1" and "-2" - assert rows[2]["location"] == "2 Locations" + # "2 Locations" is a count, not a place: the role's own read names them. + assert rows[2]["location"] == "" and rows[2]["places"] == [] + assert rows[0]["places"] == [{"text": "Raleigh", "remote": False}] # Onsite + assert rows[1]["places"] == [{"text": "Remote US TX", "remote": True}] assert rows[2]["url"].startswith("https://redhat.wd5.myworkdayjobs.com/jobs/job/") assert rows[3]["posted"] is None # "Posted 30+ Days Ago" says only that it is older assert [r["remote"] for r in rows] == ["onsite", "remote", "remote", "hybrid"] @@ -272,11 +275,13 @@ def test_detail_reads_the_description_date_remote_and_place_of_the_role() -> Non SLUG, row) assert asked == [f"https://{HOST}/wday/cxs/zendesk/zendesk" "/job/Remote-Mexico-City-Mexico/Associate-Solutions-Architect_R35358"] - assert set(got) <= set(ats.DETAIL_FIELDS) - assert set(got) == {"description", "location", "posted", "remote"} + assert set(got) == {"description", "location", "places", "posted", "remote", "country", + "employment"} assert got["posted"] == datetime(2026, 9, 29, tzinfo=UTC) assert got["remote"] == "remote" assert got["location"] == "Remote, Mexico City, Mexico" + assert got["places"] == [{"text": "Remote, Mexico City, Mexico", "remote": True}] + assert (got["country"], got["employment"]) == ("MX", "full_time") assert got["description"].startswith("Job Description") or len(got["description"]) > 200 assert "<" not in got["description"] and " " not in got["description"] assert " " not in got["description"] @@ -290,6 +295,8 @@ def test_detail_names_every_location_of_a_role_listed_as_several() -> None: assert asked == ["https://redhat.wd5.myworkdayjobs.com/wday/cxs/redhat/jobs" "/job/Remote-Italy/Telco-Cloud-Consultant_R-059566-2"] assert got["location"] == "Remote Italy; Remote Spain" + assert [p["text"] for p in got["places"]] == ["Remote Italy", "Remote Spain"] + assert "country" not in got # the code belongs to the main location alone def _detail(**info: Any) -> bytes: @@ -303,6 +310,7 @@ def test_detail_of_a_tenant_without_remote_type_leaves_it_out() -> None: startDate="2026-09-28"), []), "saxobank.wd3/CareeratSaxoBank", row) assert got == {"description": "Trade & settle", "location": "Singapore", + "places": [{"text": "Singapore", "remote": None}], "posted": datetime(2026, 9, 28, tzinfo=UTC)} @@ -310,7 +318,23 @@ def test_detail_adds_the_country_to_a_place_that_does_not_name_it() -> None: row = workday.rows(_load("workday.json"), SLUG)[0] got = workday.detail( _get_of(_detail(location="Billund", country={"descriptor": "Denmark"}), []), SLUG, row) - assert got == {"location": "Billund, Denmark"} + assert got == {"location": "Billund, Denmark", + "places": [{"text": "Billund, Denmark", "remote": None}]} + + +def test_a_country_dash_city_place_is_turned_round() -> None: + row = workday.rows(_load("workday.json"), SLUG)[0] + got = workday.detail( + _get_of((FIXTURES / "workday-places-detail.json").read_bytes(), []), SLUG, row) + # Twice the same city is once; a place that starts with a work mode is kept as written. + assert [p["text"] for p in got["places"]] == [ + "Copenhagen, Denmark", "Stockholm, Sweden", "Remote, Mexico City, Mexico"] + assert got["location"] == "Copenhagen, Denmark; Stockholm, Sweden; Remote, Mexico City, Mexico" + assert all(p["remote"] is False for p in got["places"]) # remoteType Hybrid + assert workday._place("USA - Texas - Austin", None)["text"] == "Austin, Texas, USA" + assert workday._place("Remote - Germany", None)["text"] == "Remote - Germany" + assert workday._place("Denmark - Copenhagen, DK", None)["text"] == "Denmark - Copenhagen, DK" + assert workday._place("12 Locations", None) is None def test_detail_takes_no_word_for_remote_it_does_not_know() -> None: @@ -423,37 +447,10 @@ def test_the_case_of_the_site_is_kept() -> None: assert "workday" in ats.HOSTS and ats.HOSTS["workday"] == "Workday" -def test_robots_page_is_the_site_with_its_closing_slash() -> None: - page = workday.robots_page("novonesis.wd103/Novonesis_Careers") - assert page == "https://novonesis.wd103.myworkdayjobs.com/Novonesis_Careers/" - assert httpx.URL(page).host == "novonesis.wd103.myworkdayjobs.com" - assert workday.allowed("novonesis.wd103/Novonesis_Careers")(httpx.URL(page).host) - - -@pytest.mark.parametrize(("slug", "robots", "allowed"), [ - # As the tenants write them: a site that is disallowed, and one that is not. - ("novonesis.wd103/Novonesis_Careers", - "User-agent: *\nDisallow: /Novonesis_Careers/\nDisallow: /Novonesis_Careers_Private/\n" - "Disallow: /refreshFacet/\n", False), - ("darktrace.wd3/DarktaceExternal", "User-agent: *\nDisallow: /DarktaceExternal/\n", False), - ("lego.wd103/LEGO_External", - "Sitemap: https://lego.wd103.myworkdayjobs.com/LEGO_External/siteMap.xml\n" - "User-agent: *\nAllow: /LEGO_External/\nDisallow: /LEGO_Executive/\n" - "Disallow: /refreshFacet/\n", True), - # Paths are case-sensitive: Red Hat's `Jobs` rule and its site `jobs`. - ("redhat.wd5/jobs", "User-agent: *\nAllow: /Jobs/\nDisallow: /refreshFacet/\n", True), - ("zendesk.wd1/zendesk", "User-agent: *\nAllow: /zendesk/\nDisallow: /refreshFacet/\n", True), -]) -def test_robots_txt_is_read_against_the_site_page(slug: str, robots: str, allowed: bool) -> None: - assert ats._robots_allows(robots.encode(), workday.robots_page(slug)) is allowed - - -def test_the_site_page_without_its_slash_would_have_slipped_past_the_rule() -> None: - """Why `robots_page` ends in a slash.""" - rule = b"User-agent: *\nDisallow: /Novonesis_Careers/\n" - assert ats._robots_allows(rule, "https://novonesis.wd103.myworkdayjobs.com/Novonesis_Careers") - assert not ats._robots_allows( - rule, "https://novonesis.wd103.myworkdayjobs.com/Novonesis_Careers/") +def test_the_runtime_robots_check_has_left_the_module() -> None: + """Decided when the reader was built (`READS.robots`): nothing to ask now.""" + assert not hasattr(workday, "robots_page") and not hasattr(workday, "ROBOTS_ANY_CASE") + assert "robots.txt allows /<Site>/" in workday.READS.robots # -------------------------------------------------------------- discovery diff --git a/tests/test_readers_contract.py b/tests/test_readers_contract.py index da2c8ee..8ae8b6e 100644 --- a/tests/test_readers_contract.py +++ b/tests/test_readers_contract.py @@ -52,8 +52,6 @@ FIXTURE_DIRS = (ROOT / "tests" / "fixtures" / "ats", ROOT / "tests" / "fixtures" UNDECLARED = frozenset({ "ashby", "bamboohr", "deel", "eightfold", "gem", "greenhouse", "hibob", "hrmanager", "jibe", "jobylon", "lever", - "oracle", "personio", "phenom", "pinpoint", "recruitee", "rippling", "smartrecruiters", - "successfactors", "teamtailor", "workable", "workday", })