mostlyright.discover
mostlyright.discover(query=None, , domain=None, kind=None, availability=None, license=None, point_in_time_fidelity=None, live=False, **_extra)
Section titled “mostlyright.discover(query=None, , domain=None, kind=None, availability=None, license=None, point_in_time_fidelity=None, live=False, **_extra)”Search the registration-metadata catalog across domains.
Example
Section titled “Example”>>> import mostlyright as mr>>> hits = mr.discover(query="nyc")>>> hits["kind"].iloc[0]'station'- Parameters:
- query (
str|None) – Optional free-text query. Known station aliases in the query (e.g."nyc") resolve to the settlement stations (kind"station"rows, carrying the cross-venuenote); the remaining tokens score the registered data sources (kind"source"rows). City lookups go here:discover(query="nyc"). - domain (
str|None) – Structured filter — the domain slug ("weather"…). - kind (
Literal['station','source','market'] |None) – Structured filter —"station","source", or"market"(the row discriminant)."market"rows needlive=True. - availability (
Literal['python','typescript'] |list[Literal['python','typescript']] |None) – Structured filter —"python"/"typescript"(or a list). - license (
str|None) – Structured filter — the source license string. - point_in_time_fidelity (
str|None) – Structured filter — the PIT fidelity value. - live (
bool) – Also search the prediction-market venues and return their matches askind="market"rows. Off by default: the default path makes no network call, and this is the explicit opt-in that does. Needs aquery— a live search with nothing to search for would sweep both venues’ full universes, so it raises instead. The venues are called directly (no venue account; their addresses resolve through the keyed manifest catalog), narrowed, and nothing is cached. The read is bounded per venue (page and row ceilings), and the frame says so:df.attrs["live_search_bounded"]isTrue,df.attrs["venues_truncated"]names any venue whose ceiling bound, anddf.attrs["degraded_venues"]names any venue that could not be read at all. - _extra (Any)
- query (
- Return type:
DataFrame - Returns:
One
pd.DataFrame. Every row carries akinddiscriminant ("station"|"source"|"market") as the first column, then the sharedid/name/domainidentity, then the kind-specific nullable columns — station geo (country/latitude/longitude/timezonefrom the bundled catalog) and source metadata (point_in_time_fidelity/availability) — plusnote/usage/score. No option changes the return type. Deterministically ordered (score desc, then id asc). Zero-argdiscover()lists the registered sources. A guaranteed-miss free-text query returns an empty-but-shaped frame whosedf.attrs["message"]guides back. - Raises:
- ContractError – an invalid
kind/availabilityselector (carries a difflib did-you-mean). - EntityNotFoundError – an alias in
querycould not be resolved (carries a deterministic nearest-match suggestion). - SourceUnavailableError – pandas is not installed, or
live=Truewas passed without the markets distribution installed (the message names thepip install). - TypeError – the removed
city=selector (or another unknown filter) was passed — usequery=instead.
- ContractError – an invalid