Rank jobs¶
The ranker reads a job file from the collector, removes the jobs that break your profile's rules, scores the rest, and shows the best 10. It uses fixed rules and no AI (ADR 0005).
Before you start¶
The ranker reads the profile with PyYAML. Install it once, from the root of the repository:
python3 -m pip install -r requirements.txt
To keep it separate from your other Python projects, install it in the same virtual environment you use for the docs (see the README).
Run it¶
You need a job file first. Running the collector reads Himalayas, which allows one read a day, so use a file you already have when you can.
From the root of the repository, run:
python3 ranker/rank_jobs.py data/jobs-2026-12-04.json
The ranker prints how many jobs each rule removed, the picks, up to three jobs worth checking, up to three AI-training gigs, and up to five near misses. For example, with a small file of example jobs:
Read 20 jobs. Excluded 19:
9 excluded company
4 senior title
3 no target title
2 location not open to you
1 location unclear
Top 1:
1. Knowledge Base Specialist at Example Co (score 20)
Matched titles: knowledge base (10); skills: confluence (4), kcs (4); levels: junior (+2)
Experience: asks 2-4 years; mentions junior
Salary: about USD 55,000 a year
Location: worldwide
Watch out: You'll need at least 4 hours overlap with CET business hours.
Apply: https://himalayas.app/companies/example/jobs/kb-specialist
Source: Himalayas (https://himalayas.app)
Worth checking: these would be picks, but their location is unclear.
- Documentation Specialist at Example Co (score 13)
Location unclear: The description names a place WFHeaven doesn't know: "You must reside in Ruritania."
Apply: https://himalayas.app/companies/example/jobs/documentation-specialist
Source: Himalayas (https://himalayas.app)
Near misses: no target title, but matched skills or languages.
Add a title to target_titles if it's a job you want.
- Support Content Specialist at Example Co (score 8)
Matched skills: kcs (4), confluence (4)
Apply: https://himalayas.app/companies/example/jobs/support-content
Source: Himalayas (https://himalayas.app)
| Option | Default | What it does |
|---|---|---|
--profile |
profiles/gergely.yaml |
Profile file to rank against |
--limit |
10 |
How many picks to keep |
--worth-checking |
3 |
How many jobs with an unclear location to show |
--ai-training-gigs |
3 |
With ai_training: separate, how many AI-training gigs to show |
--near-misses |
5 |
How many near misses to show |
--out |
none | Also save the picks, worth checking, near misses, reasons, and counts to a JSON file |
--seen |
none | Memory file of earlier picks to skip. The ranker only reads it. See Remember picked jobs. |
--quiet |
off | Print counts only, never job details. The daily workflow uses it because its logs are public. |
--today |
today in UTC | Date of the run, as YYYY-MM-DD. It's saved in the --out file and used to drop old hashes. Useful for tests. |
Save picks inside data/, which isn't committed. Job details must never be
published (see Job sources).
How a job is checked¶
The ranker checks each job against these rules, in this order. The first rule a job fails removes it, and that rule's name is the reason the ranker counts.
already picked: with--seen, the job's hash is in the memory of earlier picks.location not open to you: the job isrestrictedto places that don't cover every country incan_work_from. See Location.AI-training gig (hidden): the job is tagged as an AI-training gig andai_trainingishide. See AI-training gigs.excluded company: the company name contains a word fromexclude_companies.senior title: the title contains a word fromexclude_seniority. There are no exceptions, even if the description asks for few years.excluded title: the title contains a word fromexclude_titles.asks too many years: the description asks for more years of experience thanexperience_yearsplusexperience_leeway.salary too low: the yearly salary is belowmin_salary_usd_per_year.no target title: the title contains none of thetarget_titles.location unclear: the job's location isunclear. This is checked last, so these jobs keep their score for Worth checking.AI-training gig: the job is tagged as an AI-training gig andai_trainingisseparate. It passed every other rule, so it goes to AI-training gigs.
Rule 9 means a job is never picked for its description alone. Without it, any job that mentions Jira would fill the list. To catch good jobs with titles you didn't think of, the ranker lists near misses.
Seniority words¶
exclude_seniority lists words that mark a senior role in a job title. It
doesn't include staff. In engineering, "Staff Engineer" is a senior role, but
those jobs are already removed by engineer in exclude_titles. In writing
and editorial work, "Staff Writer" is a regular role at any level, so staff
would remove jobs you want. The list keeps lead: a "Team Lead" or "Content
Lead" role manages other people.
Location¶
The collector labels every job worldwide, restricted, or unclear, with
the places it's open to, any timezone requirement, and the sentence the label
is based on (ADR 0003). See
Run the collector.
The ranker compares the label with can_work_from:
worldwidejobs pass.restrictedjobs pass only if their places cover every country incan_work_from, directly or through a region. Regions and the countries they cover are listed incollector/places.py. For example,EMEAcovers Hungary, andAPACcovers Japan and Taiwan. A city never covers its country: a job open only in Budapest doesn't pass for Hungary.unclearjobs never pass. See Worth checking.
With an empty can_work_from, only worldwide jobs pass.
A timezone requirement never removes a job. Each pick shows it as
Watch out:, along with a Location: line.
Worth checking¶
A job is worth checking when it passed every rule except the location: it has
a target title, but its location is unclear. The ranker shows up to three,
highest score first, with the evidence that made the location unclear. They
aren't remembered as picks, so they can appear again the next day.
AI-training gigs¶
The collector tags AI-training gigs (is_ai_training) by company and title
words, listed in collector/ai_training.py
(ADR 0009). The profile's
ai_training setting decides what happens to them:
| Value | Picks | Shown where |
|---|---|---|
hide |
Never | Nowhere. The daily run also asks Himalayas to leave them out. |
separate (default) |
Never | Up to three that would be picks, in their own list, highest score first. Not in Worth checking or Near misses. |
mixed |
Ranked with every other job | Everywhere a job can appear, tagged [AI-training gig] |
With separate, the gigs aren't remembered as picks, so they can appear again
the next day.
Near misses¶
A near miss is a job that passed every rule except the last one: it matched
skills or languages, but its title contains no target_titles phrase. Jobs
removed by any other rule are never near misses. That includes jobs whose
location is unclear: they aren't known to be open to you, so they're
excluded as location unclear. They aren't in Worth checking either,
which only lists jobs that match a target title.
The ranker shows up to five, highest score first. Their score is the skills
plus the languages they matched. If a near miss looks like a job you want, add
its title, or the key words in it, to target_titles.
How a job is scored¶
A job that passes every rule gets points:
| Part | Points |
|---|---|
| Title | The weight of the best matching target_titles phrase. Only the best one counts. |
| Skills | The weights of all skills found in the description, added up |
| Languages | The weights of all languages found in the title or description, added up |
| Level | 2 points for each boost_levels word in the title or description |
| No salary | 3 points off if the job shows no usable salary |
Only the best title phrase counts. A title stuffed with keywords, such as
Technical Writer, Documentation, Knowledge Base, doesn't beat a plain
Technical Writer on the title alone.
The highest scores come first. When two jobs have the same score, the one with a known salary comes first, and then the newest.
How words are matched¶
- Case doesn't matter.
- Only whole words and phrases match:
mediadoesn't matchmultimedia, andengineerdoesn't matchEngineering. - A plural
sis allowed:engineermatchesEngineers. - A space and a hyphen count as the same:
entry-levelmatchesentry level.
How experience is read¶
The ranker looks for sentences that mention experience and a number of years, such as:
5+ years of experience3-5 yearsortwo to four years, where the lowest number countsat least two years,a minimum of 4 years, orminimum 6+ yearsthree years of professional experienceortwo (2) or more years
Numbers can be digits or words from zero to twelve, fifteen, and twenty. A
number of years in a sentence that doesn't mention experience, such as
founded 10 years ago, is ignored.
When the signals disagree, the strictest wins. A Junior title that asks
for 6+ years is removed. If the description asks for years in two places, the
higher number counts. A job that gives no number of years isn't penalized.
Each pick shows what the ranker found, such as asks 2-4 years; mentions
junior, or no years mentioned.
How salary is read¶
- The ranker uses the top of the salary range, because a range that reaches your minimum may still be negotiated into it.
- Hourly pay is multiplied by 2,080 (40 hours for 52 weeks), monthly pay by 12, weekly by 52, and daily by 260. A salary with no period is read as yearly.
- Salaries in other currencies count as unknown, because the ranker has no exchange rates. These jobs are kept, but they lose the 3 points for a missing salary.
Edit the profile¶
The profile is profiles/gergely.yaml. The repository is public, so put only
preferences you're happy for anyone to read in it.
- Add a job title you want. Add a line under
target_titleswith the phrase and a weight. Use 10 for titles you want most. - Add a skill or tool. Add a line under
skills. Skills are only looked for in descriptions, so keep their weights lower than titles. - Stop seeing a kind of job. Add a word to
exclude_titles, or a company toexclude_companies. - Choose what happens to AI-training gigs. Set
ai_trainingtohide,separate, ormixed. See AI-training gigs. To tag another company, add it tocollector/ai_training.py, with a test. - Change the experience limit. The ranker removes jobs that ask for more
than
experience_yearsplusexperience_leewayyears. - Change the salary limit. Set
min_salary_usd_per_yearto a yearly amount in USD. - Change where you can work from. Set
can_work_fromto a list of countries, such as[Hungary, Japan, Taiwan]. The names must be incollector/places.py, or the ranker stops with an error. On your computer, run the collector with--include-restricted, or it keeps only worldwide jobs.
The file is YAML. Keep the same layout as the existing file: weighted
phrases as indented phrase: number lines, lists in square brackets, and
comments after #.
YAML reads some bare words as true or false, such as no, yes, on, and
off. To use one of them as a phrase, put it in quotes: ['no', sales].
If the file has a mistake, the ranker stops and says what's wrong. Any field it doesn't know is an error, so a misspelled field can't be silently ignored.
Use it from code¶
Profiles are data and ranking is a function, so more profiles need no change to the ranker:
import sys
from pathlib import Path
sys.path.insert(0, "ranker")
from rank_jobs import load_profile, rank_jobs
profile = load_profile(Path("profiles/gergely.yaml"))
picks, assessments = rank_jobs(jobs, profile, limit=10)
picks holds the best jobs with their scores and reasons. assessments holds
the decision for every job, including why each removed job was removed. To
get the near misses, call near_misses(jobs, assessments). To skip earlier
picks, pass a memory loaded with seen_jobs.load_seen() as seen=.
Run the tests¶
The tests need PyYAML too (see Before you start):
python3 -m unittest discover tests
The tests use sample jobs, including edge cases for reading experience, so they run without internet access.
Known limits¶
- Rules only find the words they're given. A relevant job described in other words is missed until you add those words to the profile.
- Words in other languages aren't matched.
- A description that says
5+ years preferredis treated the same as a requirement. - Exchange rates aren't used, so non-USD salaries aren't checked.