58 lines
1.6 KiB
Python
58 lines
1.6 KiB
Python
"""Shared location-resolution pipeline.
|
|
|
|
A reusable abstraction for "given a record, decide its lat/lon" — used by
|
|
compute centers, BGP collectors, BGP events, and any future entity that needs
|
|
location estimation.
|
|
|
|
Each domain wires its own :class:`LocationPipeline` from a sequence of
|
|
:class:`LocationResolver` instances. Future algorithms (peeringdb, IXP tables,
|
|
user-confirmed coordinates, …) plug in by implementing the protocol — no
|
|
changes needed to consumers.
|
|
"""
|
|
|
|
from .models import (
|
|
LocationCandidate,
|
|
LocationQuery,
|
|
ResolutionDiagnostic,
|
|
ResolutionResult,
|
|
ResolverOutput,
|
|
)
|
|
from .pipeline import LocationPipeline, LocationResolver
|
|
from .resolvers.inherit import InheritFromAnotherEntityResolver
|
|
from .resolvers.nominatim import (
|
|
NominatimResolver,
|
|
build_default_nominatim_geocoder,
|
|
interpret_geocode_result,
|
|
)
|
|
from .resolvers.registry import RegistryResolver, default_score_alias_match
|
|
from .resolvers.source_coordinates import SourceCoordinatesResolver
|
|
from .text import (
|
|
city_key,
|
|
coerce_str,
|
|
normalize_country_text,
|
|
normalize_text,
|
|
parse_float,
|
|
)
|
|
|
|
__all__ = [
|
|
"LocationCandidate",
|
|
"LocationPipeline",
|
|
"LocationQuery",
|
|
"LocationResolver",
|
|
"ResolutionDiagnostic",
|
|
"ResolutionResult",
|
|
"ResolverOutput",
|
|
"InheritFromAnotherEntityResolver",
|
|
"NominatimResolver",
|
|
"RegistryResolver",
|
|
"SourceCoordinatesResolver",
|
|
"build_default_nominatim_geocoder",
|
|
"city_key",
|
|
"coerce_str",
|
|
"default_score_alias_match",
|
|
"interpret_geocode_result",
|
|
"normalize_country_text",
|
|
"normalize_text",
|
|
"parse_float",
|
|
]
|