mostlyright.discover
mostlyright.discover(query=None, , domain=None, kind=None, availability=None, license=None, point_in_time_fidelity=None, **_extra)
Section titled “mostlyright.discover(query=None, , domain=None, kind=None, availability=None, license=None, point_in_time_fidelity=None, **_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 (
Optional[Literal['station','source']]) – Structured filter —"station"or"source"(the row discriminant). - availability (
Union[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. - _extra (Any)
- query (
- Return type:
DataFrame - Returns:
ONE discriminated
pd.DataFrame. Every row carries akinddiscriminant ("station"|"source") as the LEADING 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.
- TypeError – the removed
city=selector (or another unknown filter) was passed — usequery=instead.
- ContractError – an invalid