engine: add stubs

This commit is contained in:
Oliver Gaskell 2025-11-01 12:07:08 +00:00
parent dea24c7453
commit feb6fc1e19
No known key found for this signature in database
GPG key ID: F971A08925FCC0AD

View file

@ -7,8 +7,11 @@ BRANDS: dict[str, str] = {
"greggs": "[\"brand:wikidata\"=\"Q3403981\"]",
}
EncodedLocation = list[float, list[float]]
def fetch_data(brand: str) -> list[tuple[float | None, float | None]]:
"""Fetch a list of locations from OSM."""
api = overpy.Overpass()
filters = BRANDS[brand]
@ -29,7 +32,22 @@ def fetch_data(brand: str) -> list[tuple[float | None, float | None]]:
return result
def encode(location: tuple[float, float]) -> EncodedLocation:
"""Encode a location."""
# Stub
return []
def decode(location: EncodedLocation) -> tuple[float, float]:
"""Decode into a location."""
# Stub
return (0.091659, 52.210796)
def main():
"""Testing."""
print("Running query...")
greggs = fetch_data("greggs")
print(f"Query done - got {len(greggs)} Greggs!")