data_updater_v2.data_clients.listings
listings.py — the listing-event shapes every client returns (a ticker starting to trade, or stopping), and the cleanup one source makes on its own lines.
The shapes (the listings / delistings tables’ told columns, tables/changes.py):
listing symbol (OUR spelling) · date (the first day it trades, or is expected to) · name · exchange (FMP's venue code) · status (FMP's: expected, priced, filed, withdrawn; ``listed`` when the exchange told it) · shares · price_low · price_high (the offer range, or the one price twice)delisting symbol (ours) · date (the first day it no longer trades) · name · exchangeThe cleanups take out, named — never silently ({"why": ..., "row": ...}):
a line off the US venues (FMP’s calendars and delisted list are world-wide: NB2.F,
SNR.L);
a line with no day, or one dated before 1971 (FMP’s 1970-01-01: no date at all);
a ticker that is not a US ticker in our spelling (the speller’s own reason);
the same event twice (every field alike).
Functions
sound_delistings
sound_delistings(lines: Iterable[Mapping[str, Any]]) -> tuple[list[dict[str, Any]], list[dict[str, Any]]]FMP’s delisted-companies lines in our delisting shape, the ones that are no US delisting taken out: (kept, dropped).
sound_listings
sound_listings(lines: Iterable[Mapping[str, Any]]) -> tuple[list[dict[str, Any]], list[dict[str, Any]]]FMP’s IPO-calendar lines in our listing shape, the ones that are no US listing taken out: (kept, dropped).