Share the readers' place, table-lookup and country helpers, unify the employment vocabulary, and list the enrich switch with the stages

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Opus 5.5 committed 2026-09-30 10:13:24 +02:00
1 parent ca80219bbb
commit 903b69b6d3
34 files changed
+290 -207

No files matched your search

+23
View File
@@ -178,6 +178,29 @@ posting per place, each with its own id, declares `places="copies"`: each
copy is a row with its one place, and `dupes.py` folds them into one role
that keeps each copy's link.
**Helpers.** `._shared` holds what more than one host needs; a module keeps
only its own word tables and uses these:
- `place(text, remote=None)` makes a `Place`: remote when the text has the
word `remote`, otherwise as `remote` says. `add_place(found, entry)`
appends a place unless its text is empty or already in `found`, in the
host's order. A host that states remote itself passes it to `place`, or
builds the dict and passes that to `add_place`.
- `table_word(table, value, log, what)` maps a host's word (stated seniority
or employment) through the module's table, without case. The table's keys
are lowercase. Empty gives None; a known word mapped to `""` (`experienced`,
`permanent`) names no level and gives None; an unknown word gives None and
a debug line naming the host, so the table can grow.
- `EMPLOYMENTS`, the one employment vocabulary: `full_time`, `part_time`,
`contract`, `temporary`, `internship`, `freelance`. Every value of a
module's `_EMPLOYMENT` table is one of these or `""`; the test in
`tests/test_readers_shared.py` holds every module to it. Seniority values
are `app.models.SENIORITIES`.
- `country_if_single(codes)` is the code when the role's places share exactly
one, else None, for a host that states a country per place.
- `remote_word(text)` reads `remote` or `hybrid` from a search provider's
headline or town line (Danish, Swedish, English).
**Teaser.** A short text the list carries (an excerpt, a summary) is handed
over as `teaser`, plain text, whether or not the full text comes later. It
is shown and embedded until `description` arrives. A reader that sees one