Find roles by search, not only by company: Jobindex and Adzuna searches

The ats boards only read companies someone listed, and the seed list is
US-centred: 31 of 29,000 open roles were in Denmark. A `search` plugin runs
saved queries on boards that span companies, pulled in the same task as the
boards: Jobindex (Denmark, RSS, no key) and Adzuna (UK and most of the EU,
free key, built to its documented API). Jobnet and Jooble were checked and
left out.

`country` is now filled from the board's location line by a lookup, with EU
for Europe-wide roles, so country gates work without extract. `app companies
prune --in` unsubscribes boards with no open role in a region. The starter
agents and searches are Copenhagen and Europe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Opus 5.5 committed 2026-09-23 19:55:50 +02:00
1 parent bfab68c878
commit 047f7cd8ad
17 files changed
+1293 -72

No files matched your search

+129 -1
View File
@@ -34,7 +34,7 @@ _GENDER = re.compile(
#: board and "celonis" on another share a key.
_LEGAL = re.compile(
r"(?:\s+(?:gmbh(?:\s*&\s*co\.?\s*kg)?|ag|se|kg|ug|inc|ltd|llc|plc|corp|"
r"co|bv|b\.v|sa|sas|srl|oy|ab|as|aps))+\.?$",
r"co|bv|b\.v|sa|sas|srl|oy|ab|as|a/s|aps))+\.?$",
re.IGNORECASE,
)
@@ -64,6 +64,134 @@ def company_key(company: str) -> str:
return _fold(name).replace(" ", "-")
# ---------------------------------------------------------------- geography
#: The EU, the EEA, the UK and Switzerland: what "a European role" means to a
#: gate on `country`. `EU` is ISO's reserved code, used here for a role open
#: anywhere in Europe ("Remote - Europe", "EMEA") that names no one country.
EUROPE: tuple[str, ...] = (
"AT", "BE", "BG", "HR", "CY", "CZ", "DK", "EE", "FI", "FR", "DE", "GR", "HU", "IE",
"IT", "LV", "LT", "LU", "MT", "NL", "PL", "PT", "RO", "SK", "SI", "ES", "SE",
"IS", "LI", "NO", "GB", "CH", "EU",
)
#: Folded names a board writes in its location line, to an ISO code: every
#: European country in English and its own language, the cities the boards
#: name most, and the non-European places that fill the seed boards, so those
#: resolve instead of staying unknown. Not a gazetteer; `extract` is the rest.
_PLACES: dict[str, str] = {
**dict.fromkeys(("europe", "emea", "eu", "european union", "eea"), "EU"),
**dict.fromkeys(("austria", "osterreich", "vienna", "wien", "graz", "linz"), "AT"),
**dict.fromkeys(("belgium", "belgie", "belgique", "brussels", "bruxelles", "antwerp",
"ghent"), "BE"),
**dict.fromkeys(("bulgaria", "sofia"), "BG"),
**dict.fromkeys(("croatia", "hrvatska", "zagreb"), "HR"),
**dict.fromkeys(("cyprus", "limassol", "nicosia"), "CY"),
**dict.fromkeys(("czech republic", "czechia", "prague", "praha", "brno"), "CZ"),
# Folding keeps ø and æ, which are letters of their own rather than an o
# or an a with a mark, so København is listed beside Kobenhavn.
**dict.fromkeys(("denmark", "danmark", "copenhagen", "københavn", "kobenhavn", "aarhus",
"århus", "odense", "aalborg", "region hovedstaden", "frederiksberg",
"lyngby", "kgs lyngby", "kongens lyngby", "ballerup", "hellerup",
"bagsværd", "hørsholm", "brøndby", "glostrup", "søborg", "måløv",
"birkerød"), "DK"),
**dict.fromkeys(("estonia", "eesti", "tallinn", "tartu"), "EE"),
**dict.fromkeys(("finland", "suomi", "helsinki", "espoo", "tampere"), "FI"),
**dict.fromkeys(("france", "paris", "lyon", "marseille", "toulouse", "nantes",
"bordeaux", "lille"), "FR"),
**dict.fromkeys(("germany", "deutschland", "berlin", "munich", "munchen", "hamburg",
"frankfurt", "cologne", "koln", "stuttgart", "dusseldorf", "leipzig",
"dresden", "hannover", "nuremberg", "nurnberg", "karlsruhe",
"heidelberg", "bonn", "essen", "dortmund", "mannheim"), "DE"),
**dict.fromkeys(("greece", "athens", "thessaloniki"), "GR"),
**dict.fromkeys(("hungary", "budapest"), "HU"),
**dict.fromkeys(("ireland", "dublin", "cork", "galway", "limerick"), "IE"),
**dict.fromkeys(("italy", "italia", "milan", "milano", "rome", "roma", "turin",
"torino", "bologna", "florence"), "IT"),
**dict.fromkeys(("latvia", "riga"), "LV"),
**dict.fromkeys(("lithuania", "vilnius", "kaunas"), "LT"),
**dict.fromkeys(("luxembourg",), "LU"),
**dict.fromkeys(("malta", "valletta"), "MT"),
**dict.fromkeys(("netherlands", "the netherlands", "nederland", "holland", "amsterdam",
"rotterdam", "utrecht", "the hague", "den haag", "eindhoven",
"delft"), "NL"),
**dict.fromkeys(("poland", "polska", "warsaw", "warszawa", "krakow", "wroclaw",
"gdansk", "poznan", "lodz"), "PL"),
**dict.fromkeys(("portugal", "lisbon", "lisboa", "porto", "braga"), "PT"),
**dict.fromkeys(("romania", "bucharest", "bucuresti", "cluj", "cluj napoca", "iasi"),
"RO"),
**dict.fromkeys(("slovakia", "bratislava"), "SK"),
**dict.fromkeys(("slovenia", "ljubljana"), "SI"),
**dict.fromkeys(("spain", "espana", "madrid", "barcelona", "valencia", "seville",
"malaga", "bilbao"), "ES"),
**dict.fromkeys(("sweden", "sverige", "stockholm", "gothenburg", "goteborg", "malmo",
"uppsala"), "SE"),
**dict.fromkeys(("iceland", "reykjavik"), "IS"),
**dict.fromkeys(("norway", "norge", "oslo", "bergen", "trondheim"), "NO"),
**dict.fromkeys(("united kingdom", "uk", "great britain", "england", "scotland",
"wales", "northern ireland", "london", "manchester", "edinburgh",
"glasgow", "bristol", "cambridge uk", "oxford", "leeds",
"birmingham uk", "belfast"), "GB"),
**dict.fromkeys(("switzerland", "schweiz", "suisse", "zurich", "geneva", "geneve",
"basel", "lausanne", "bern", "zug"), "CH"),
**dict.fromkeys(("united states", "usa", "us", "u s", "new york", "new york city",
"nyc", "san francisco", "seattle", "boston", "chicago", "austin",
"los angeles", "palo alto", "mountain view", "san mateo",
"foster city", "sunnyvale", "san jose", "menlo park", "redwood city",
"costa mesa", "denver", "atlanta", "washington dc", "miami", "dallas",
"houston", "phoenix", "tempe", "portland", "salt lake city",
"pittsburgh", "philadelphia", "detroit", "san diego", "raleigh",
"nashville", "minneapolis"), "US"),
**dict.fromkeys(("canada", "toronto", "vancouver", "montreal", "ottawa", "calgary",
"waterloo"), "CA"),
**dict.fromkeys(("india", "bengaluru", "bangalore", "hyderabad", "pune", "mumbai",
"chennai", "gurgaon", "gurugram", "noida", "new delhi", "delhi"), "IN"),
**dict.fromkeys(("singapore",), "SG"),
**dict.fromkeys(("japan", "tokyo", "osaka"), "JP"),
**dict.fromkeys(("australia", "sydney", "melbourne", "brisbane", "perth"), "AU"),
**dict.fromkeys(("israel", "tel aviv", "tel aviv yafo", "jerusalem", "haifa"), "IL"),
**dict.fromkeys(("brazil", "brasil", "sao paulo"), "BR"),
**dict.fromkeys(("mexico", "mexico city", "ciudad de mexico", "guadalajara"), "MX"),
**dict.fromkeys(("china", "shanghai", "beijing", "shenzhen", "hong kong"), "CN"),
**dict.fromkeys(("south korea", "korea", "seoul"), "KR"),
}
#: Keyed the way a place is folded before it is looked up, so a name can be
#: written as it is spelt.
_PLACES = {_fold(name): code for name, code in _PLACES.items()}
#: The longest name first, so "new york city" wins over "york" and "northern
#: ireland" over "ireland".
_PLACE_NAMES = sorted(_PLACES, key=len, reverse=True)
#: US state codes after a comma, the way US boards write a city: "Boston, MA".
#: Read only when no name matched, since "DE" and "IN" are countries too.
_US_STATE = re.compile(
r",\s*(?:AL|AK|AZ|AR|CA|CO|CT|DE|DC|FL|GA|HI|ID|IL|IN|IA|KS|KY|LA|ME|MD|MA|MI|MN|"
r"MS|MO|MT|NE|NV|NH|NJ|NM|NY|NC|ND|OH|OK|OR|PA|RI|SC|SD|TN|TX|UT|VT|VA|WA|WV|WI|WY)"
r"\b")
def country_of(place: str) -> str:
"""The one country a board's location line names, as an ISO code, or ''
when it names none or several: "Berlin, Germany" is DE, "Boston, MA" is
US, "London | Remote" is GB, "London or New York" is ''. "Remote - Europe"
is EU, and "London, EMEA" is GB: a country beats the region it is in."""
folded = f" {_fold(place or '')} "
found: set[str] = set()
for name in _PLACE_NAMES:
needle = f" {name} "
if needle in folded:
found.add(_PLACES[name])
folded = folded.replace(needle, " ")
if not found and _US_STATE.search(place or ""):
# Only when nothing else named a country: "Berlin, DE" is Germany.
found.add("US")
if len(found) > 1:
found.discard("EU")
return found.pop() if len(found) == 1 else ""
# --------------------------------------------------------------- vocabulary
Remote = Literal["", "remote", "hybrid", "onsite"]