Read a seniority level from the title
from_title folds the title and matches whole words in English, Danish, Swedish, German, French, Dutch and Spanish, highest level first, with intern tried before the rest. Individual-contributor managers (Account, Product, Project ...) stay unknown; a manager is a level only where the word means a team, a site or a shop. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
64f367cc18
commit
d7fa9527b4
2 files changed
+486
No files matched your search
@@ -0,0 +1,236 @@
|
||||
"""`from_title`: the level a job title names, as one of `SENIORITIES`, or `''`.
|
||||
|
||||
What fills `roles.seniority` at ingest, before `extract` has read the posting
|
||||
(which overwrites it). `''` and not `"mid"` when the title does not say:
|
||||
most titles name no level, and a filter that treats "does not say" as a level
|
||||
loses every role it could not read. So every rule here is written for
|
||||
precision, and a title that matches nothing stays unknown.
|
||||
|
||||
The approach is `plugins/ats.classify`'s, after its substring matches went
|
||||
wrong (" it" inside "Italy"): the title is folded with `title_key` (case,
|
||||
accents and the `(m/w/d)` marker gone, punctuation to spaces) and every
|
||||
pattern is a word-bounded regex against that. Patterns are therefore written
|
||||
folded: `direktör` is `direktor`, `chef d'équipe` is `chef d equipe`; `ø` and
|
||||
`æ` stay as they are, since NFKD does not decompose them.
|
||||
|
||||
The highest level named wins, checked from `exec` down: "Senior Director" is
|
||||
a director, "Managing Director" an exec, "Lead Project Manager" a lead. The
|
||||
one exception is `intern`, tried first: a title that says internship or
|
||||
thesis is one whatever it names after ("Praktikum ... Assistenz des Senior
|
||||
Vice Presidents"). A C-level or head named as the boss of the person hired
|
||||
("Executive Assistant to the CEO", "Office of the Head of ...") is cut out
|
||||
before matching (`_NOISE`). Rules that decide the doubtful cases:
|
||||
|
||||
- **manager** is a level only where the word means someone who runs a team:
|
||||
a bare "Manager", "Senior Manager", "Manager, Data Science" (the word
|
||||
first, as a level), an "Assistant Store Manager" as a lead, and the compounds whose department or place is what is
|
||||
managed (`_PEOPLE_MANAGER`: engineering, team, store, general ...). Every
|
||||
other "X Manager" is an individual contributor by function (Account,
|
||||
Product, Project, Customer Success, Office, Marketing, Sales ...) and says
|
||||
nothing, so "Senior Product Manager" is senior. An unlisted compound stays
|
||||
unknown, which costs a recall the filter's "and no level" makes up.
|
||||
- **director** is the word in English, Danish, Swedish, German, French, Spanish
|
||||
and Italian, "Head of" and a title's own first word "Head", and the German
|
||||
"Leiter" alone or of a whole department (Bereichsleiter, Abteilungsleiter).
|
||||
"Associate Director" and "Executive Director" are directors. **manager** is
|
||||
also the Danish, Swedish, German and Dutch head of a shop, site or office
|
||||
(-chef, -leder, Filialleiter, Kontorchef), French "responsable" and "gérant",
|
||||
Spanish "jefe" and "gerente". **exec** is C-level ("Chief ... Officer", CTO), "VP" and above
|
||||
(a bank's VP is mid-level, but a tech company's is not, and the filter is
|
||||
the reader's: exec), "Managing Director", Geschäftsführer, Vorstand and VD.
|
||||
A bank's "Assistant Vice President" is a director.
|
||||
- **lead** is "Lead" as a noun at either end ("Tech Lead", "Lead Engineer";
|
||||
not "Lead Generation"), "Leader", "Supervisor", and the team-sized German,
|
||||
Danish, Dutch and French forms (Teamleiter, Teamleider, chef d'équipe).
|
||||
- **staff** is "Staff" and "Principal". "Staff Nurse", "Staff Accountant"
|
||||
and their kind are left out; "Principal Investigator" and a
|
||||
"Staff Scientist" at a lab are taken as staff and are not.
|
||||
- **project managers stay unknown** in every language (Projektleiter,
|
||||
Bauleiter, chef de projet, projektleder, prosjektleder): they are Project
|
||||
Managers. Halbleiter and the other -leiter words for things are cut out too.
|
||||
- **intern** is anything that says the person is still studying or training:
|
||||
intern, Werkstudent, Praktikant, stagiaire, Ausbildung, apprentice,
|
||||
elev, studentermedhjælper, a thesis. **junior** is "Junior", "Graduate",
|
||||
"Trainee" and "entry level". **mid** only when the title says so:
|
||||
"Mid-level", "Intermediate", "II", "Medior".
|
||||
|
||||
Known wrong, and left so: "Senior Care Assistant" and other "senior" that
|
||||
means elderly; "Level II" outside a role level; "Principal Investigator";
|
||||
"Staff" on a title with an unlisted staff noun; "Field CTO" taken as unknown;
|
||||
"Chief of Staff" as unknown; "Assistant Manager" as unknown; French "responsable" is
|
||||
taken as a manager wherever it stands, and "Directeur" of a small firm as a
|
||||
director; "VP" as exec at a bank.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
|
||||
from app.models import title_key
|
||||
|
||||
#: A C-level title or abbreviation, for `_NOISE`.
|
||||
_C_LEVEL = (r"(?:ceo|cto|cfo|coo|cio|ciso|cpo|cdo|chro|caio"
|
||||
r"|chief(?: \w+){0,3} officer|managing director|(?<!vice )president"
|
||||
r"|geschaftsfuhr\w*|geschaftsfuhrung|vorstand)")
|
||||
|
||||
#: A vice president, which the phrases below take as a boss only after "to the",
|
||||
#: not after "assistant" ("Assistant Vice President" is a director).
|
||||
_VP = r"(?:vice president|[se]?vp)"
|
||||
|
||||
#: Phrases that carry a level word without naming a level, cut out of the
|
||||
#: folded title before anything is matched: "Chief of Staff" is not "Staff",
|
||||
#: "Executive Assistant to the CEO" is not a CEO, "Lead Generation" is not a
|
||||
#: Lead. What a title says after "reporting to" is about someone else.
|
||||
_NOISE = re.compile(
|
||||
r"\b(?:chief of staff|member of technical staff|technical staff"
|
||||
r"|(?:support|kitchen|wait|nursing|field|floor|retail|store|clinical|medical"
|
||||
r"|teaching|academic|administrative|hospital|bar|service|office|warehouse"
|
||||
r"|hotel|catering|cabin|restaurant|casual|agency|temporary|volunteer|library"
|
||||
r"|hourly|seasonal|healthcare|sales|customer) staff"
|
||||
r"|staff (?:accountant|nurse|attorney|pharmacist|auditor|writer|reporter"
|
||||
r"|assistant|augmentation|admin|augment|nurses)"
|
||||
r"|lead (?:gen(?:eration)?|development rep\w*|qualification|nurturing"
|
||||
r"|scoring|capture|to (?:cash|revenue))"
|
||||
rf"|(?:to|for|of|des|der) (?:the |dem |den )?(?:{_C_LEVEL}|{_VP})"
|
||||
rf"|(?:assistant|assistenz|assistent|secretary|sekretar\w*|business partner|coordinator"
|
||||
rf"|office|support|referent\w*|advisor|adviser) (?:\w+ ){{0,3}}?{_C_LEVEL}"
|
||||
rf"|{_C_LEVEL} (?:assistant|assistenz|office|team|support|founder associate)"
|
||||
r"|field (?:cto|cio|ciso)"
|
||||
r"|\w*(?:halb|nicht|supra|strom|blitzab)leiter"
|
||||
r"|\w*(?:projekt|prosjekt|project|bau|bygge|produkt)(?:leiter|leitung|leder|ledare|leider)(?:in)?"
|
||||
r"|zugchef\w*)\b"
|
||||
r"|\breport(?:s|ing)? to\b.*",
|
||||
)
|
||||
|
||||
#: "X Manager" where the manager runs a team, a site or a shop; see the
|
||||
#: docstring. Only the word directly before "manager" counts.
|
||||
_PEOPLE_MANAGER = (
|
||||
r"(?:engineering|software development|science|research|hardware|team|department"
|
||||
r"|group|store|branch|restaurant|shift|warehouse|site|plant|area|district"
|
||||
r"|regional|country|general)")
|
||||
|
||||
#: The stems of the -leiter/-leder words that are a team lead, not a manager.
|
||||
_TEAM_SIZED = r"(?:team|gruppen?|grupp|schicht|hold|vagt)"
|
||||
|
||||
#: Words after a title-initial "Head" that make it a job of its own (Head
|
||||
#: Chef), not the head of a function.
|
||||
_HEAD_JOBS = (r"(?:chef|cook|barista|nurse|coach|waiter|bartender|mechanic|gardener"
|
||||
r"|teacher|cashier|housekeeper|receptionist|technician|butcher|baker"
|
||||
r"|stylist|of)")
|
||||
|
||||
#: `(level, patterns)`, in the order they are tried: `intern` first, since a
|
||||
#: title that says internship is one whatever it names after ("Internship, Office
|
||||
#: of the Head of Product"); then the rest from `exec` down. A title takes the
|
||||
#: first level with a match, so a rule need not exclude what a later rule claims.
|
||||
_RULES: tuple[tuple[str, tuple[str, ...]], ...] = (
|
||||
("intern", (
|
||||
r"\binterns?\b", r"\binternship\w*", r"\bwerkstudent\w*", r"\bworking students?\b",
|
||||
r"\bstudent (?:assistant|worker|helper|aide|job|position|trainee|employee)s?\b",
|
||||
r"\bstudentische\w*", r"\bstudent(?:er)?med(?:hj|arb)\w*",
|
||||
r"\bstudent\w*job\w*", r"\bjobstudent\b",
|
||||
r"\w*praktik(?:um|ant\w*|a|ophold|plads)?\b", r"\bpraxissemester\b", r"\bduales? studium\b",
|
||||
r"\bstagiaires?\b", r"\bstagiair\w*", r"\bstagista\b", r"\btirocin\w*",
|
||||
r"\bestagiari[oa]s?\b", r"\bbecari[oa]s?\b", r"\bpracticas\b", r"\bpracticante\b",
|
||||
r"\baprendiz\b", r"\balternan\w*", r"\bapprenti(?:e|es|s)?\b", r"\bapprentice\w*",
|
||||
r"\bazubi\b", r"\bauszubildende\w*", r"\bausbildung\b", r"\blehr(?:ling|ausbildung|stelle)\b",
|
||||
r"\w*lærling\w*", r"\b\w*elev\b",
|
||||
r"\b\w+student\b", r"(?<!phd )(?<!doctoral )(?<!graduate )(?<!masters )\bstudent$",
|
||||
r"\bvolontar\w*",
|
||||
r"\b(?:master|bachelor|abschluss)arbeit\b", r"\bthesis\b",
|
||||
r"\bmasterproef\b", r"\beindwerk\b", r"\bafstudeer\w*",
|
||||
# French and Dutch "stage": a title that starts or ends with it, or
|
||||
# says how many months, and not the English stage (Stage Manager, early stage).
|
||||
r"^stage\b(?! (?:manager|management|hand|crew|technician|director|lighting|door))",
|
||||
r"(?<!early )(?<!late )(?<!growth )(?<!seed )(?<!mid )(?<!next )(?<!final )"
|
||||
r"(?<!pre )(?<!first )(?<!phase )\bstage$",
|
||||
r"\bstage (?:\d+ )?(?:mois|mesi|maanden|months)\b",
|
||||
)),
|
||||
("exec", (
|
||||
r"\b(?:ceo|cto|cfo|coo|cio|ciso|cpo|cdo|chro|caio)\b",
|
||||
r"\bchief(?: \w+){0,4}? officer\b", r"\bchief executive\b",
|
||||
r"(?<!assistant )(?<!associate )(?<!assoc )\b(?:vice president|[se]?vp)\b",
|
||||
r"(?<!vice )\bpresident\b",
|
||||
r"\bmanaging director\b", r"\b(?:administrerende|verkstallande) direktor\b",
|
||||
r"\badministrerende direktør\b", r"\bvd\b", r"\bpdg\b",
|
||||
r"\bdirecteur general\b", r"\bdirector general\b",
|
||||
r"\bgeschaftsfuhr\w*", r"\bgeschaftsleit\w*", r"\bvorstand\b",
|
||||
)),
|
||||
("director", (
|
||||
r"\b(?:director(?:a|s|es|in)?|directeur|directrice|direktor(?:in|er)?"
|
||||
r"|direktør(?:er)?|direttore|direttrice)\b",
|
||||
r"\bavp\b", r"\b(?:assistant|associate|assoc) (?:vice president|vp)\b",
|
||||
r"\bhead of\b", r"\b(?:department|division|unit|practice|group|team|country|regional) head\b",
|
||||
rf"^head (?!{_HEAD_JOBS}\b)", r"\bhead$",
|
||||
# Leiter(in) alone or of a whole unit (Bereichsleiter), and a title that
|
||||
# starts with Leitung; "mit technischer Leitung" is a job with a duty.
|
||||
r"\bleiter(?:in)?\b", r"^leitung\b",
|
||||
r"\b(?:bereichs|abteilungs|hauptabteilungs|geschaftsbereichs|vertriebs"
|
||||
r"|entwicklungs|werks)leit(?:er|erin|ung)\b",
|
||||
r"\bhoofd\b",
|
||||
)),
|
||||
("manager", (
|
||||
r"^(?:(?:senior|sr|global|regional|group|executive) )*manager\b",
|
||||
r"\b(?:senior|sr) manager\b",
|
||||
rf"(?<!assistant )(?<!deputy )(?<!asst )\b{_PEOPLE_MANAGER} manager\b",
|
||||
# -leiter / -leder / -leider of a shop, site or department: Filialleiter,
|
||||
# Afdelingsleder. The team-sized ones are lead (below), and project ones
|
||||
# are cut out by _NOISE. A -leitung is only these, since "Rohrleitung"
|
||||
# is a pipe.
|
||||
rf"\b(?!{_TEAM_SIZED}\w*leit)\w+leit(?:er|erin)\b",
|
||||
r"\b(?:filial|standort|betriebs|service|niederlassungs|markt|geschafts)leitung\b",
|
||||
rf"\b(?!{_TEAM_SIZED}\w*led)\w+leder\b", r"\bleder\b",
|
||||
rf"\b(?!{_TEAM_SIZED}\w*leid)\w+leider\b", r"\bleidinggevende\b",
|
||||
# Danish and Swedish compounds (kontorchef, avdelningschef); a bare
|
||||
# "chef" is a cook or French and says nothing.
|
||||
r"\b\w{3,}chef(?:er|en)?\b",
|
||||
r"\b(?:drift|avdelnings|enhets|verksamhets|butiks|lager|produktions)ledare\b",
|
||||
r"\bchef (?:for|fur|i|til|inom|over|pa|av)\b",
|
||||
r"\bchef d(?:e|u)? (?:service|departement|secteur|magasin|rayon|agence|site"
|
||||
r"|pole|atelier|production)\b",
|
||||
r"\bresponsable\b(?! adjoint| d(?:e|u|es)? projets?\b)", r"(?<!assistant )\bgerant\w*", r"\bgerente\b",
|
||||
r"\bjef[ea]\b(?! d(?:e|el) (?:equipo|proyecto|obra)\b)",
|
||||
r"\bresponsabile\b",
|
||||
)),
|
||||
("lead", (
|
||||
r"\b(?:team|tech|squad)?lead\b", r"\b(?:team|shift)?leader\b",
|
||||
r"\bsupervisor\b", r"\bsuperviseur\b",
|
||||
rf"\b(?:assistant|deputy|asst) {_PEOPLE_MANAGER} manager\b",
|
||||
r"\b(?:team|gruppen?|schicht|hold|vagt)(?:leit(?:er|erin|ung)|leder|leider)\b",
|
||||
r"\b(?:team|grupp)?ledare\b", r"\bchef(?: fe)? d equipe\b", r"\blider\b",
|
||||
r"\bjef[ea] de equipo\b",
|
||||
)),
|
||||
("staff", (
|
||||
r"\bstaff\b", r"\bprincipal\b", r"\bdistinguished\b",
|
||||
# SAP's top individual-contributor grade.
|
||||
r"\bchief expert\b",
|
||||
)),
|
||||
("senior", (
|
||||
r"\b(?:senior|sr|snr|iii)\b",
|
||||
)),
|
||||
("mid", (
|
||||
r"\bmid ?level\b", r"\bintermediate\b", r"\bii\b", r"\bmedior\b",
|
||||
r"\bconfirme\b",
|
||||
)),
|
||||
("junior", (
|
||||
r"\b(?:junior|jr|entry level|graduates?|grad|new grad|early careers?"
|
||||
r"|young professional|absolvent\w*|berufseinsteiger\w*|debutant\w*)\b",
|
||||
r"\btrainee\w*",
|
||||
)),
|
||||
)
|
||||
|
||||
#: `_RULES`, compiled once, in the same order.
|
||||
_COMPILED: tuple[tuple[str, tuple[re.Pattern[str], ...]], ...] = tuple(
|
||||
(level, tuple(re.compile(pattern) for pattern in patterns))
|
||||
for level, patterns in _RULES)
|
||||
|
||||
|
||||
def from_title(title: str) -> str:
|
||||
"""The highest level `title` names, one of `SENIORITIES`, or `''` when it
|
||||
names none. See the module docstring for what counts."""
|
||||
folded = " ".join(_NOISE.sub(" ", title_key(title)).split())
|
||||
if not folded:
|
||||
return ""
|
||||
for level, patterns in _COMPILED:
|
||||
if any(pattern.search(folded) for pattern in patterns):
|
||||
return level
|
||||
return ""
|
||||
@@ -0,0 +1,250 @@
|
||||
"""`app.seniority.from_title` against real titles from the 2026-09-29 snapshot,
|
||||
one table, grouped by level, language and trap. No network, no database."""
|
||||
|
||||
# The titles are posted with en dashes and typographic apostrophes; the table keeps them.
|
||||
# ruff: noqa: RUF001
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
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 app.seniority import from_title # noqa: E402
|
||||
|
||||
#: `(title, level)`. A title stays in the table as it was posted, gender
|
||||
#: marker and all, since `from_title` folds it itself.
|
||||
TITLES: list[tuple[str, str]] = [
|
||||
# ---- exec
|
||||
("Chief Financial Officer - Satispay Bank", "exec"),
|
||||
("Chief Information Security Officer - Klarna Bank USA", "exec"),
|
||||
("Chief Operating Officer (COO) - (Relocation to Luxembourg)", "exec"),
|
||||
("COO TILL NORDISK CLEAN SOLUTIONS", "exec"),
|
||||
("CFO med blik for digitale løsninger", "exec"),
|
||||
("VP of Engineering - Foundational Platform", "exec"),
|
||||
("SVP of Sales - EMEA (m/f/x)", "exec"),
|
||||
("Regional Vice President - Enterprise East", "exec"),
|
||||
("Managing Director, Canada (m/f/d)", "exec"),
|
||||
("Managing Director Damstahl AB", "exec"),
|
||||
# A C-level named as the boss of the person hired is not the level.
|
||||
("Executive Assistant to the President", ""),
|
||||
("Chief of Staff to CHRO", ""),
|
||||
("Praktikant:in Business Development (m/w/d) - CEO Office", "intern"),
|
||||
("Senior Executive Business Partner, CFO", "senior"),
|
||||
# ---- director
|
||||
("Senior Director, Global Partnerships", "director"),
|
||||
("Sr. Director, Enterprise Data", "director"),
|
||||
("Director of Engineering (Data Infrastructure)", "director"),
|
||||
("Director, Pricing", "director"),
|
||||
("Associate Director, AI Strategy", "director"),
|
||||
("Assoc Director, Oral Sema", "director"),
|
||||
("Associate VP, Drug Product Manufacturing US Quality", "director"),
|
||||
("Head of Data & AI Platforms", "director"),
|
||||
("Head, Logistics Performance", "director"),
|
||||
("Head ASP Management", "director"),
|
||||
("Global Head of AV Driver Training", "director"),
|
||||
("Senior Manager, Head of Transaction Monitoring", "director"),
|
||||
("Directeur Financier - Afrique de l'Ouest", "director"),
|
||||
("Directeur·trice technique associé·e", "director"),
|
||||
("Direktør til Industriens Uddannelser", "director"),
|
||||
("Director/a de Logística", "director"),
|
||||
("[DACH MAG] Abteilungsleiter Produktion (all genders)", "director"),
|
||||
("[DACH MAG] Bereichsleiter Schicht (all genders)", "director"),
|
||||
("Regionaler Vertriebsleiter im Außendienst (m/w/d) Region nördliches NRW/ Niedersachsen/ Bremen", "director"),
|
||||
# "Head Chef"-like titles and a duty that is only mentioned are not heads.
|
||||
("Augenoptikermeister mit technischer Leitung (m/w/d) in Berlin WILMA", ""),
|
||||
("Sous Chef", ""),
|
||||
# ---- manager
|
||||
("Engineering Manager - Security Engineering", "manager"),
|
||||
("Sr. Engineering Manager - Notebook Dataplane", "manager"),
|
||||
("Senior Manager, Strategic Planning", "manager"),
|
||||
("Sr. Manager, Technical Delivery", "manager"),
|
||||
("Business Development Sr. Manager", "manager"),
|
||||
("Data Science Manager, Finance Analytics", "manager"),
|
||||
("Manager, Bid Management", "manager"),
|
||||
("Manager Sales Enablement", "manager"),
|
||||
("Country Manager", "manager"),
|
||||
("Store Manager (pandamart)", "manager"),
|
||||
("Team Manager Technischer Kundendienst (x/f/m)", "manager"),
|
||||
("Data Science Manager, Risk", "manager"),
|
||||
("Director/Sr Manager, Business Planning & GTM", "director"),
|
||||
("Filialleiter (m/w/d), LEGO Store Hannover", "manager"),
|
||||
("Kontorchef til Styrelsen for International Rekruttering og Integration (SIRI)", "manager"),
|
||||
("Försäljningschef till Nordic Polytech Group (NPG)", "manager"),
|
||||
("Driftsleder Sjåførorganisasjon", "manager"),
|
||||
("Enhedschef til borgernær akutsygepleje og tildelingsenhed, Afdeling for Borgernær Sundhed", "manager"),
|
||||
("Chef for Kommunikation", "manager"),
|
||||
("Gérant(e) - Responsable de magasin", "manager"),
|
||||
("Responsable Partenariats Terrain B2B H/F", "manager"),
|
||||
("Gerente de tienda", "manager"),
|
||||
("Jefe de Posventa", "manager"),
|
||||
# Individual-contributor managers say nothing, or the level beside them.
|
||||
("Account Manager", ""),
|
||||
("Key Account Manager Ultrasound (all genders)", ""),
|
||||
("Product Manager (Agents)", ""),
|
||||
("Senior Product Manager", "senior"),
|
||||
("Project Manager", ""),
|
||||
("Customer Success Manager (DACH)", ""),
|
||||
("Office Manager - 9 month fixed term contract", ""),
|
||||
("Sales Manager (m/w/d) – Photovoltaik, Wärmepumpe & intelligente Energiesysteme - 1KOMMA5° Kiel", ""),
|
||||
("Technical Program Manager, Data Centers", ""),
|
||||
("Lead Project Manager (German speaker)", "lead"),
|
||||
("Assistant Store Manager (efood market) - Θεσσαλονίκη", "lead"),
|
||||
("Responsable de projets - Expériences Fever Originals", ""),
|
||||
("Chef de projet SEO et Marketing Digital H/F", ""),
|
||||
("Bauleiter AC (m/w/d) für Photovoltaik - 1KOMMA5° Handwerk - Region Bayern", ""),
|
||||
("Projektleder til produktion af færdigretter", ""),
|
||||
("Prosjektleder DTO", ""),
|
||||
("Technologie-Forschungsingenieur für Leistungshalbleiter (w/m/div.)", ""),
|
||||
# ---- lead
|
||||
("Tech Lead, Deployment & Operations — Custom Infrastructure", "lead"),
|
||||
("Lead Data Engineer", "lead"),
|
||||
("Lead Engineer", "lead"),
|
||||
("Technical Lead- AI Cockpit", "lead"),
|
||||
("Engineering Team Lead - GateManager Platform", "lead"),
|
||||
("Teamlead Winkel Schoten (36u)", "lead"),
|
||||
("Complaints Team Leader - Claims", "lead"),
|
||||
("Supervisor, Wind Site - Sunzia, NM", "lead"),
|
||||
("Teamleiter im Bereich HR IT Support (w/m/div.)", "lead"),
|
||||
("Schichtleiter Warehouse Operations (all genders)", "lead"),
|
||||
("Gruppenleiter Softwareentwicklung (m/w/x)", "lead"),
|
||||
("Teamleider Winkel Eindhoven (32-40 uur)", "lead"),
|
||||
("Chef d'équipe Entrepôt Magasin", "lead"),
|
||||
("Chef·fe d’équipe - Modélisation (Unreal)", "lead"),
|
||||
("Superviseur magasin", "lead"),
|
||||
# "Lead" the noun is a level, "lead" the sales lead is not.
|
||||
("B2B Demand Generation Specialist", ""),
|
||||
# ---- staff
|
||||
("Staff Software Engineer - Money Movement", "staff"),
|
||||
("Senior Staff Software Engineer- Search Quality", "staff"),
|
||||
("Staff+ Software Engineer, Safeguards", "staff"),
|
||||
("Principal Software Engineer - Platform Engineering", "staff"),
|
||||
("Principal/Senior Principal Investment Accounting Solution Consultant – IAS Value Team", "staff"),
|
||||
("Business Process Chief Expert CIS", "staff"),
|
||||
("Member of Technical Staff - Research Infrastructure Engineer", ""),
|
||||
("Chief of Staff (m/w/d)", ""),
|
||||
("Staff Accountant", ""),
|
||||
# ---- senior
|
||||
("Senior Site Reliability Engineer", "senior"),
|
||||
("Sr.Account Development Representative", "senior"),
|
||||
("Sr Software Engineer -Public Sector", "senior"),
|
||||
("(Senior) Product Manager - Energy (m/f/d)", "senior"),
|
||||
("Senior konsult till Knowit FLX", "senior"),
|
||||
("Chef.fe technique senior du développement - Rainbow Six Siege", "senior"),
|
||||
("Backend Engineer III", "senior"),
|
||||
# ---- mid
|
||||
("Backend Engineer - Mid Level - Autopilot Team", "mid"),
|
||||
("Intermediate Backend Engineer - Database Change Management", "mid"),
|
||||
("Site Reliability Engineer II, China Tech", "mid"),
|
||||
("Medior Cloud Developer (AI Integrations)", "mid"),
|
||||
("Chef de produit trachéotomie confirmé F/H", "mid"),
|
||||
# The "mid" of a market is not a level.
|
||||
("Account Director, Mid-Market", "director"),
|
||||
("Account Executive - Mid-Market", ""),
|
||||
# ---- junior
|
||||
("Junior Data Analyst", "junior"),
|
||||
("Jr. Metrology Engineer", "junior"),
|
||||
("(Junior) Key Account Manager (m/w/d)", "junior"),
|
||||
("Junior Sales Manager (m/w/d) für intelligente Energiesysteme - 1KOMMA5° Göttingen", "junior"),
|
||||
("Entry Level: Baseband Developer", "junior"),
|
||||
("Entry-level Sales and Marketing Representative - Tampa, FL - Diablo Tools - DAT", "junior"),
|
||||
("Graduate Software Engineer", "junior"),
|
||||
("Software Engineer, New Grad - Frontend", "junior"),
|
||||
("Sales Trainee", "junior"),
|
||||
("Junior Managers Program (Trainee) - Start your Leadership Journey in Controlling", "junior"),
|
||||
("Asistente de marketing Jr. - Sector Automotriz - Lima", "junior"),
|
||||
# ---- intern
|
||||
("Internship - Business Intelligence", "intern"),
|
||||
("Financial Planning & Analysis Intern", "intern"),
|
||||
("Software Engineer, Intern (Summer or Winter)", "intern"),
|
||||
("Working Student (f/m/d) - HR Learning & Development", "intern"),
|
||||
("Werkstudent:in Data Analytics (Controlling Focus) (m/w/d)", "intern"),
|
||||
("Werkstudent*in im Innovationsmanagement (m/w/d) (w/m/div.)", "intern"),
|
||||
("Praktikum in der Technologieentwicklung", "intern"),
|
||||
("Pflichtpraktikum Simultaneous Engineering", "intern"),
|
||||
("Betriebspraktikum für Schüler:innen 2026/2027 (m/w/d) Standort Dresden (STAR)", "intern"),
|
||||
("Praktikant:in (m/w/d) Technische Planung Photovoltaik - 1KOMMA5° Handwerk - Remote", "intern"),
|
||||
("Ausbildung Mechatroniker 2027 (m/w/d) für Kassel/Lohfelden", "intern"),
|
||||
("Lehrausbildung Mechatronik (w/m/div.) ab Herbst 2027", "intern"),
|
||||
("Master Thesis: Network Digital Twin Fidelity and Synthetic Data Generation for Radio Networks", "intern"),
|
||||
("Stagiaire Développeur de Logiciels", "intern"),
|
||||
("Stage - Data Scientist", "intern"),
|
||||
("Finance Operations - Stage", "intern"),
|
||||
("Event Coordinator Assistant – Stage (6 mois) Janvier 2027 (F/H/NB)", "intern"),
|
||||
("Alternant Technicien Maintenance (F/H)", "intern"),
|
||||
("Apprenti(e) chef(fe) de projet H/F/N", "intern"),
|
||||
("Studentermedhjælper søges til grøn drift", "intern"),
|
||||
("Juridisk studentermedarbejder til investeringsafdelingen", "intern"),
|
||||
("Bliv økonomielev hos Lomax", "intern"),
|
||||
("Værktøjsmager-/Industriteknikerlærling", "intern"),
|
||||
("Stage Inkoper", "intern"),
|
||||
("Jobstudent Klantenservice Franstalig", "intern"),
|
||||
("Duaal- of deeltijdstudent – Logistiek", "intern"),
|
||||
("Prácticas Ingeniería i4.0 y BA fábrica componentes automoción", "intern"),
|
||||
("Jovem Aprendiz ( Apprentice)", "intern"),
|
||||
("Junior Supply Chain Officer (Apprenticeship)", "intern"),
|
||||
# An internship stays one whoever it reports to.
|
||||
("SAP iXp Intern (f/m/d) - Office of the Head of Product & Engineering of Consumer Industries", "intern"),
|
||||
("Praktikum Assistenz im Management des Senior Vice Presidents der Business Unit Building Solutions", "intern"),
|
||||
# English "stage" and machine learning are not French.
|
||||
("Développeur·euse logiciel en exploitation de modèles d’apprentissage automatique", ""),
|
||||
# ---- nothing said
|
||||
("Software Engineer - Data Infrastructure", ""),
|
||||
("Account Executive, Platforms (Hunter)", ""),
|
||||
("Cloud Engineer", ""),
|
||||
("Legal Counsel", ""),
|
||||
("Data Engineer (f/m/div.)", ""),
|
||||
("Kundenservice Mitarbeiter (w/m/d) - Hybrid", ""),
|
||||
("Elektroniker in der Leiterkartenfertigung (w/m/div.)", ""),
|
||||
("", ""),
|
||||
]
|
||||
|
||||
#: Titles the snapshot has no example of, written for the traps they test.
|
||||
SYNTHETIC: list[tuple[str, str]] = [
|
||||
("Lead Generation Specialist", ""),
|
||||
("Stage Manager, Touring Production", ""),
|
||||
("Product Owner - Early Stage", ""),
|
||||
("Projectleider Logistiek", ""),
|
||||
("Software Engineer III, Platform", "senior"),
|
||||
("Manager, Data Science", "manager"),
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.parametrize(("title", "level"), TITLES + SYNTHETIC)
|
||||
def test_title(title: str, level: str) -> None:
|
||||
assert from_title(title) == level
|
||||
|
||||
|
||||
def test_table_covers_every_level_and_at_least_eighty_titles() -> None:
|
||||
assert len(TITLES) >= 80
|
||||
assert {level for _, level in TITLES} == set(SENIORITIES)
|
||||
|
||||
|
||||
def test_answers_are_seniorities() -> None:
|
||||
assert {from_title(title) for title, _ in TITLES} <= set(SENIORITIES)
|
||||
|
||||
|
||||
def test_gender_marker_and_case_do_not_matter() -> None:
|
||||
assert from_title("SENIOR SOFTWARE ENGINEER (m/w/d)") == "senior"
|
||||
assert from_title("senior software engineer (all genders)") == "senior"
|
||||
|
||||
|
||||
def test_highest_level_named_wins() -> None:
|
||||
assert from_title("Senior Director of Engineering") == "director"
|
||||
assert from_title("Senior Lead Engineer") == "lead"
|
||||
assert from_title("Junior Principal Engineer") == "staff"
|
||||
assert from_title("Vice President and Managing Director") == "exec"
|
||||
|
||||
|
||||
def test_words_are_matched_whole() -> None:
|
||||
# "lead" in "Leadership", "intern" in "International", "vp" nowhere.
|
||||
assert from_title("Leadership Development Programme Coordinator") == ""
|
||||
assert from_title("International Sales Coordinator") == ""
|
||||
assert from_title("Internal Audit Analyst") == ""
|
||||
assert from_title("Directory Services Administrator") == ""
|
||||
Reference in new issue
Block a user