openworld_radio_twin.providers.registry#

Trusted, installed data sources shared by library, batch and HTTP APIs.

One registry type serves every kind of source (buildings, antennas). A source is an adapter with an identifier, a version, a coverage predicate and attribution. Requests select a source explicitly or by location; installed packages add sources through the entry-point group of their kind.

Functions

region(name)

Coverage test for the packaged boundary providers/data/<name>.geojson.

resolve_source(registry, requested, ...)

Resolve a source before acquisition; explicit selections never fall back silently.

worldwide(latitude, longitude)

Classes

AntennaSourceRegistry([sources])

BuildingProvider(*args, **kwargs)

BuildingSource

alias of DataSource

BuildingSourceRegistry([sources])

DataSource(identifier, title, version, factory)

Provider identity and factory; auto-selection is explicitly opt-in.

SourceRegistry([sources])

Installed sources of one kind; subclasses name the kind and its entry-point group.

class openworld_radio_twin.providers.registry.BuildingProvider(*args, **kwargs)[source]#

Bases: Protocol

async buildings(latitude, longitude, radius_m, limit)[source]#
Return type:

BuildingQueryResult

openworld_radio_twin.providers.registry.worldwide(latitude, longitude)[source]#
Return type:

bool

openworld_radio_twin.providers.registry.region(name)[source]#

Coverage test for the packaged boundary providers/data/<name>.geojson.

The file’s provenance is recorded in providers/data/README.md.

Return type:

Callable[[float, float], bool]

class openworld_radio_twin.providers.registry.DataSource(identifier, title, version, factory, covers=<function worldwide>, auto_priority=None, attribution='', license_url='', configuration_identity=None, auto_covers=None, configured=None, configuration_hint='', license='')[source]#

Bases: object

Provider identity and factory; auto-selection is explicitly opt-in.

covers(latitude, longitude) restricts explicit and automatic selection; auto_covers restricts only automatic selection. Use covers when the provider cannot tell that a query lies outside its data, such as a live query or a snapshot, and auto_covers when the provider checks its own tile index and can serve explicit requests beyond the routing boundary. Higher auto_priority wins; None leaves a source available only by explicit selection. Version changes must accompany changes in source interpretation or geometry reconstruction. configured reports whether the settings supply what the source needs, such as a token or a local file; automatic routing skips a source that is not configured, and configuration_hint tells the user how to configure it.

identifier: str#
title: str#
version: str#
factory: Callable[[Settings, AsyncClient], object]#
covers(longitude)#
Return type:

bool

auto_priority: int | None = None#
attribution: str = ''#
license_url: str = ''#
configuration_identity: Callable[[Settings], dict[str, str]] | None = None#
auto_covers: Callable[[float, float], bool] | None = None#
configured: Callable[[Settings], bool] | None = None#
configuration_hint: str = ''#
license: str = ''#
is_configured(settings)[source]#
Return type:

bool

openworld_radio_twin.providers.registry.BuildingSource#

alias of DataSource

class openworld_radio_twin.providers.registry.SourceRegistry(sources=())[source]#

Bases: object

Installed sources of one kind; subclasses name the kind and its entry-point group.

kind: ClassVar[str] = 'data'#
entry_point_group: ClassVar[str | None] = None#
register(source)[source]#
Return type:

None

load_installed()[source]#

Load explicitly installed entry points, never a request-supplied import path.

Return type:

None

get(identifier)[source]#
Return type:

DataSource

automatic(latitude, longitude, *, allowed, settings=None)[source]#
Return type:

DataSource | None

describe(settings=None)[source]#
Return type:

list[dict[str, object]]

class openworld_radio_twin.providers.registry.BuildingSourceRegistry(sources=())[source]#

Bases: SourceRegistry

kind: ClassVar[str] = 'building'#
entry_point_group: ClassVar[str | None] = 'openworld_radio_twin.building_sources'#
class openworld_radio_twin.providers.registry.AntennaSourceRegistry(sources=())[source]#

Bases: SourceRegistry

kind: ClassVar[str] = 'antenna'#
entry_point_group: ClassVar[str | None] = 'openworld_radio_twin.antenna_sources'#
openworld_radio_twin.providers.registry.resolve_source(registry, requested, latitude, longitude, settings, *, allowed, fallback, reserved)[source]#

Resolve a source before acquisition; explicit selections never fall back silently.

reserved maps the identifiers the caller implements itself (global, none) to their versions; fallback is what auto becomes when no source applies.

Return type:

dict[str, object]