jobstreaming 0.0.3__tar.gz → 0.0.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/CHANGELOG.md +14 -0
  2. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/PKG-INFO +8 -2
  3. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/README.md +7 -1
  4. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/context.py +6 -1
  5. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/linkedin/__init__.py +26 -14
  6. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/pyproject.toml +4 -4
  7. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/CONTRIBUTING.md +0 -0
  8. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/LICENSE +0 -0
  9. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/SECURITY.md +0 -0
  10. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/__init__.py +0 -0
  11. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/api.py +0 -0
  12. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/batch.py +0 -0
  13. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/bayt/__init__.py +0 -0
  14. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/bdjobs/__init__.py +0 -0
  15. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/bdjobs/constant.py +0 -0
  16. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/bdjobs/util.py +0 -0
  17. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/checkpoint.py +0 -0
  18. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/collector.py +0 -0
  19. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/events.py +0 -0
  20. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/exception.py +0 -0
  21. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/glassdoor/__init__.py +0 -0
  22. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/glassdoor/constant.py +0 -0
  23. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/glassdoor/util.py +0 -0
  24. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/google/__init__.py +0 -0
  25. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/google/constant.py +0 -0
  26. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/google/util.py +0 -0
  27. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/indeed/__init__.py +0 -0
  28. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/indeed/constant.py +0 -0
  29. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/indeed/util.py +0 -0
  30. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/linkedin/constant.py +0 -0
  31. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/linkedin/util.py +0 -0
  32. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/model.py +0 -0
  33. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/naukri/__init__.py +0 -0
  34. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/naukri/constant.py +0 -0
  35. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/naukri/util.py +0 -0
  36. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/outcome.py +0 -0
  37. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/protocols.py +0 -0
  38. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/py.typed +0 -0
  39. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/registry.py +0 -0
  40. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/result.py +0 -0
  41. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/runtime.py +0 -0
  42. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/salary.py +0 -0
  43. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/testing.py +0 -0
  44. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/util.py +0 -0
  45. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/ziprecruiter/__init__.py +0 -0
  46. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/ziprecruiter/constant.py +0 -0
  47. {jobstreaming-0.0.3 → jobstreaming-0.0.4}/jobstreaming/ziprecruiter/util.py +0 -0
@@ -4,6 +4,19 @@ All notable changes to JobStreaming are documented here. The project follows sem
4
4
  versioning where practical during its `0.0.x` alpha series; adapter compatibility can
5
5
  still change when upstream boards drift.
6
6
 
7
+ ## [0.0.4] - 2026-08-28
8
+
9
+ ### Changed
10
+
11
+ - LinkedIn continuation requests use a measured randomized one-to-two-second delay
12
+ and the provider's observed ten-card page size for offset calculations.
13
+
14
+ ### Fixed
15
+
16
+ - LinkedIn stops after a partial terminal page instead of waiting and issuing an
17
+ empty follow-up request, and skips detail enrichment for stable identities already
18
+ seen during the current or resumed search.
19
+
7
20
  ## [0.0.3] - 2026-08-09
8
21
 
9
22
  ### Added
@@ -93,5 +106,6 @@ still change when upstream boards drift.
93
106
  contracts.
94
107
  - Added Python 3.10 through 3.14 CI coverage and pinned release automation.
95
108
 
109
+ [0.0.4]: https://github.com/ebarti/jobstreaming/compare/v0.0.3...v0.0.4
96
110
  [0.0.3]: https://github.com/ebarti/jobstreaming/compare/v0.0.2...v0.0.3
97
111
  [0.0.2]: https://github.com/ebarti/jobstreaming/releases/tag/v0.0.2
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jobstreaming
3
- Version: 0.0.3
3
+ Version: 0.0.4
4
4
  Summary: Stream normalized jobs from multiple boards with typed events and durable checkpoints
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE
@@ -496,7 +496,7 @@ except StreamCancelledError:
496
496
  | Site | Restart boundary | Notes |
497
497
  |---|---|---|
498
498
  | Indeed | cursor/page | Requires `JOBSTREAMING_INDEED_API_KEY`. `hours_old`, `easy_apply`, and `job_type`/`is_remote` are mutually exclusive in the upstream API. |
499
- | LinkedIn | result offset/page | Full descriptions require `linkedin_fetch_description=True` and add one request per job. Aggressive rate limiting is common. |
499
+ | LinkedIn | result offset/page | Continuation pages use a randomized 1–2 second gap. Full descriptions require `linkedin_fetch_description=True` and add one request per job. Aggressive rate limiting is common. |
500
500
  | ZipRecruiter | continuation token | Requires `JOBSTREAMING_ZIPRECRUITER_AUTHORIZATION`. US and Canada are the primary supported markets. |
501
501
  | Glassdoor | page/cursor | Uses live CSRF discovery or explicitly configured fallback. A location is required unless `is_remote=True`. Availability depends on `country_indeed`. |
502
502
  | Google Jobs | cursor | `google_search_term` can override the generated query. The upstream response format is opaque and fragile. |
@@ -610,6 +610,12 @@ with stream_search(
610
610
  ...
611
611
  ```
612
612
 
613
+ When an adapter must make an expensive detail request after discovering a stable
614
+ provider identity, call `context.already_seen_identity(identity)` first. The identity
615
+ must match the value the resulting `JobPost` will use as `id` (or `job_url` when no ID
616
+ is available). This avoids repeating enrichment for acknowledged jobs when a page is
617
+ replayed while preserving at-least-once delivery for unacknowledged jobs.
618
+
613
619
  Increment `cursor_schema_version` whenever a deployed adapter can no longer interpret
614
620
  cursor state written by its previous implementation. Custom identifiers are validated,
615
621
  serialized as strings in requests/events/checkpoints, and must not collide with a
@@ -465,7 +465,7 @@ except StreamCancelledError:
465
465
  | Site | Restart boundary | Notes |
466
466
  |---|---|---|
467
467
  | Indeed | cursor/page | Requires `JOBSTREAMING_INDEED_API_KEY`. `hours_old`, `easy_apply`, and `job_type`/`is_remote` are mutually exclusive in the upstream API. |
468
- | LinkedIn | result offset/page | Full descriptions require `linkedin_fetch_description=True` and add one request per job. Aggressive rate limiting is common. |
468
+ | LinkedIn | result offset/page | Continuation pages use a randomized 1–2 second gap. Full descriptions require `linkedin_fetch_description=True` and add one request per job. Aggressive rate limiting is common. |
469
469
  | ZipRecruiter | continuation token | Requires `JOBSTREAMING_ZIPRECRUITER_AUTHORIZATION`. US and Canada are the primary supported markets. |
470
470
  | Glassdoor | page/cursor | Uses live CSRF discovery or explicitly configured fallback. A location is required unless `is_remote=True`. Availability depends on `country_indeed`. |
471
471
  | Google Jobs | cursor | `google_search_term` can override the generated query. The upstream response format is opaque and fragile. |
@@ -579,6 +579,12 @@ with stream_search(
579
579
  ...
580
580
  ```
581
581
 
582
+ When an adapter must make an expensive detail request after discovering a stable
583
+ provider identity, call `context.already_seen_identity(identity)` first. The identity
584
+ must match the value the resulting `JobPost` will use as `id` (or `job_url` when no ID
585
+ is available). This avoids repeating enrichment for acknowledged jobs when a page is
586
+ replayed while preserving at-least-once delivery for unacknowledged jobs.
587
+
582
588
  Increment `cursor_schema_version` whenever a deployed adapter can no longer interpret
583
589
  cursor state written by its previous implementation. Custom identifiers are validated,
584
590
  serialized as strings in requests/events/checkpoints, and must not collide with a
@@ -265,7 +265,12 @@ class ScrapeContext:
265
265
  raise StreamCancelledError("Search stream was cancelled")
266
266
 
267
267
  def already_seen(self, job: JobPost) -> bool:
268
- key = stable_job_key(self.site.value, job.id or job.job_url)
268
+ return self.already_seen_identity(job.id or job.job_url)
269
+
270
+ def already_seen_identity(self, identity: str) -> bool:
271
+ """Check a provider identity before constructing or enriching a job."""
272
+
273
+ key = stable_job_key(self.site.value, identity)
269
274
  with self._lock:
270
275
  return key in self._seen
271
276
 
@@ -52,9 +52,11 @@ log = create_logger("LinkedIn")
52
52
 
53
53
  class LinkedIn(Scraper):
54
54
  base_url = "https://www.linkedin.com"
55
- delay = 3
56
- band_delay = 4
57
- jobs_per_page = 25
55
+ # Keep continuation requests jittered while avoiding a fixed five-second
56
+ # average gap between otherwise sub-second result-page requests.
57
+ delay = 1
58
+ band_delay = 1
59
+ jobs_per_page = 10
58
60
  capabilities = AdapterCapabilities(
59
61
  filters=frozenset(
60
62
  {
@@ -124,7 +126,12 @@ class LinkedIn(Scraper):
124
126
  resume_state = context.resume_state
125
127
  start = int(
126
128
  resume_state.get(
127
- "start", scraper_input.offset // 10 * 10 if scraper_input.offset else 0
129
+ "start",
130
+ (
131
+ scraper_input.offset // self.jobs_per_page * self.jobs_per_page
132
+ if scraper_input.offset
133
+ else 0
134
+ ),
128
135
  )
129
136
  )
130
137
  pages_completed = int(
@@ -144,10 +151,14 @@ class LinkedIn(Scraper):
144
151
  and start < 1000
145
152
  and pages_completed < scraper_input.max_pages
146
153
  ):
147
- log.info(
148
- f"search page: {pages_completed + 1} / "
149
- f"{min(scraper_input.max_pages, math.ceil((scraper_input.results_wanted + scraper_input.offset) / 10))}"
154
+ total_pages = min(
155
+ scraper_input.max_pages,
156
+ math.ceil(
157
+ (scraper_input.results_wanted + scraper_input.offset)
158
+ / self.jobs_per_page
159
+ ),
150
160
  )
161
+ log.info(f"search page: {pages_completed + 1} / {total_pages}")
151
162
  params = {
152
163
  "keywords": scraper_input.search_term,
153
164
  "location": scraper_input.location,
@@ -208,6 +219,8 @@ class LinkedIn(Scraper):
208
219
  job_id = href.split("-")[-1]
209
220
  if not job_id:
210
221
  continue
222
+ if context.already_seen_identity(f"li-{job_id}"):
223
+ continue
211
224
 
212
225
  try:
213
226
  fetch_desc = scraper_input.linkedin_fetch_description
@@ -224,6 +237,7 @@ class LinkedIn(Scraper):
224
237
 
225
238
  next_start = start + len(job_cards)
226
239
  raw_seen = raw_seen + len(job_cards) if raw_seen is not None else None
240
+ has_more = None if len(job_cards) >= self.jobs_per_page else False
227
241
  context.emit_progress(
228
242
  {
229
243
  "start": next_start,
@@ -232,17 +246,15 @@ class LinkedIn(Scraper):
232
246
  },
233
247
  completed_units=pages_completed + 1,
234
248
  raw_items_seen=raw_seen,
235
- has_more=None,
249
+ has_more=has_more,
236
250
  message=f"completed LinkedIn page at offset {start}",
237
251
  )
238
252
  pages_completed += 1
239
253
  start = next_start
240
- if (
241
- context.should_continue
242
- and pages_completed < scraper_input.max_pages
243
- and not context.wait(
244
- random.uniform(self.delay, self.delay + self.band_delay)
245
- )
254
+ if not context.should_continue or has_more is False:
255
+ break
256
+ if pages_completed < scraper_input.max_pages and not context.wait(
257
+ random.uniform(self.delay, self.delay + self.band_delay)
246
258
  ):
247
259
  break
248
260
 
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [project]
6
6
  name = "jobstreaming"
7
- version = "0.0.3"
7
+ version = "0.0.4"
8
8
  description = "Stream normalized jobs from multiple boards with typed events and durable checkpoints"
9
9
  authors = [{ name = "JobStreaming contributors" }]
10
10
  license = "MIT"
@@ -108,8 +108,8 @@ infer-return-types = "never"
108
108
 
109
109
  [tool.poetry.group.dev.dependencies]
110
110
  black = ">=24.0"
111
- pre-commit = ">=4.6.1"
112
- pyrefly = "1.1.1"
111
+ pre-commit = ">=4.6.2"
112
+ pyrefly = "1.2.0"
113
113
  pytest = ">=8.0"
114
114
  pytest-cov = ">=6.0"
115
- ruff = ">=0.16.0"
115
+ ruff = ">=0.16.3"
File without changes
File without changes