Model/repositories/geospatial/geospatial_repository.py
Khalim Conn-Kowlessar 3998ef586c feat(geospatial): GeospatialRepo — OS Open-UPRN coordinate lookup (#1131)
Add Coordinates value object + GeospatialRepository port + GeospatialS3Repository
adapter. Resolves a Property's lon/lat from the partitioned Ordnance Survey
Open-UPRN parquet (filename_meta -> partition -> UPRN row). A Repo, not a
Fetcher (ADR-0011): no live OS API call. The parquet reader is injected, so it's
unit-tested against fixture parquets with no S3/network; returns None when the
UPRN is uncovered or absent. pyright strict clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-30 19:55:46 +00:00

17 lines
524 B
Python

from __future__ import annotations
from abc import ABC, abstractmethod
from typing import Optional
from domain.geospatial.coordinates import Coordinates
class GeospatialRepository(ABC):
"""Resolves a Property's coordinates from hosted reference data by UPRN.
A Repo, not a Fetcher (ADR-0011): it reads stored Ordnance Survey Open-UPRN
data, with no live API call. Returns None when the UPRN is not covered.
"""
@abstractmethod
def coordinates_for(self, uprn: int) -> Optional[Coordinates]: ...