apple_maps_api.helpers#

Helper functions for common geocoding operations.

Attributes#

log

Functions#

geocode_postal_code(...)

Geocode a postal code and extract coordinates and address information.

geocode_coordinates(...)

Reverse geocode coordinates and extract address information.

Module Contents#

apple_maps_api.helpers.log[source]#
apple_maps_api.helpers.geocode_postal_code(client: apple_maps_api.client.AppleMapsClient, *, postal_code: str, country: str = 'US') → apple_maps_api.models.GeocodeResult | None[source]#

Geocode a postal code and extract coordinates and address information.

Args:

client: AppleMapsClient instance to use for geocoding postal_code: The postal code to geocode country: Country code (default: “US”)

Returns:

GeocodeResult with lat, lon, city, and state information. Returns None if geocoding fails.

apple_maps_api.helpers.geocode_coordinates(client: apple_maps_api.client.AppleMapsClient, *, lat: float, lon: float) → apple_maps_api.models.GeocodeResult | None[source]#

Reverse geocode coordinates and extract address information.

Args:

client: AppleMapsClient instance to use for geocoding lat: Latitude lon: Longitude

Returns:

GeocodeResult with lat, lon, zip_code, city, and state information. Returns None if geocoding fails.