Skip to content

mostlyright.weather.earnings.calendar_poller

mostlyright.weather.earnings.calendar_poller

Section titled “mostlyright.weather.earnings.calendar_poller”

Venue-derived earnings-capture trigger (Phase 27, 27-03; D-27.7).

EarningsCalendarPoller reads the codegen earnings-calendar.json seed (emitted in 27-02 from markets.earnings.registries.EARNINGS_CALENDAR_SEED) and, given a now, returns the capture jobs whose call is inside the 1-2-day pre-call window. This is the calendar-driven capture trigger — the capture fleet only fires on the handful of calls live in a given window, NOT a continuous poll of the ~149-series roster (RESEARCH-MARKETS §1.3, a hard EARN-27-03 constraint).

The seed is a small committed snapshot (a deterministic look-ahead fixture, NOT a live feed): the satellite refreshes the authoritative calendar; this is the SDK look-ahead seed. It is BUNDLED as package data (mostlyright/weather/earnings/data/earnings-calendar.json) and loaded via importlib.resources so the poller works from an installed wheel — the repo-root schemas/ tree is a codegen artifact that is NOT shipped in the wheel. The poller is heavy-dep-free — it needs no [earnings] extra (json + datetime only), so the cheap trigger path runs everywhere.

CaptureJob(ticker, provider, call_scheduled_at)A single due capture — one upcoming call inside the pre-call window.
EarningsCalendarPoller([calendar_path])Reads the codegen calendar seed; emits due capture jobs (D-27.7).

class mostlyright.weather.earnings.calendar_poller.CaptureJob(ticker, provider, call_scheduled_at)

Section titled “class mostlyright.weather.earnings.calendar_poller.CaptureJob(ticker, provider, call_scheduled_at)”

Bases: object

A single due capture — one upcoming call inside the pre-call window.

  • Parameters:

class mostlyright.weather.earnings.calendar_poller.EarningsCalendarPoller(calendar_path=None)

Section titled “class mostlyright.weather.earnings.calendar_poller.EarningsCalendarPoller(calendar_path=None)”

Bases: object

Reads the codegen calendar seed; emits due capture jobs (D-27.7).

  • Parameters: calendar_path (Path | None)

The raw calendar rows (ticker / provider / call_scheduled_at / hq_timezone) from the codegen seed.

Return capture jobs for calls inside the 1-2-day pre-call window.

A row is DUE when now <= call_scheduled_at <= now + 2 days — i.e. the call is upcoming (not past) and within the look-ahead window. Calls further out (a week early) or already elapsed are excluded, so the capture fleet opens jobs only for the imminent cohort (RESEARCH-MARKETS §1.3). now MUST be tz-aware (the SDK’s tz-aware discipline — a naive instant would mis-order against the UTC call times and silently skip or over-fire).