From c3d0e163b6ee74db50635e13739a64bb8da1ccdb Mon Sep 17 00:00:00 2001 From: Mark Colley <39366189+M-Colley@users.noreply.github.com> Date: Wed, 2 Dec 2026 15:42:25 +0000 Subject: [PATCH] docs: add Google API names and doc links to Client method docstrings --- googlemaps/directions.py | 3 +++ googlemaps/distance_matrix.py | 6 +++++- googlemaps/elevation.py | 8 +++++++- googlemaps/geocoding.py | 7 +++++++ googlemaps/places.py | 28 ++++++++++++++++++++++++++++ googlemaps/roads.py | 15 +++++++++++++++ googlemaps/timezone.py | 3 +++ 7 files changed, 68 insertions(+), 2 deletions(-) diff --git a/googlemaps/directions.py b/googlemaps/directions.py index 353145cc..0b3139b8 100644 --- a/googlemaps/directions.py +++ b/googlemaps/directions.py @@ -27,6 +27,9 @@ def directions(client, origin, destination, transit_routing_preference=None, traffic_model=None): """Get directions between an origin point and a destination point. + Calls the Directions API. See + https://developers.google.com/maps/documentation/directions for more info. + :param origin: The address or latitude/longitude value from which you wish to calculate directions. :type origin: string, dict, list, or tuple diff --git a/googlemaps/distance_matrix.py b/googlemaps/distance_matrix.py index a30cbe09..fdce7fde 100755 --- a/googlemaps/distance_matrix.py +++ b/googlemaps/distance_matrix.py @@ -24,7 +24,11 @@ def distance_matrix(client, origins, destinations, mode=None, language=None, avoid=None, units=None, departure_time=None, arrival_time=None, transit_mode=None, transit_routing_preference=None, traffic_model=None, region=None): - """ Gets travel distance and time for a matrix of origins and destinations. + """Gets travel distance and time for a matrix of origins and destinations. + + Calls the Distance Matrix API. See + https://developers.google.com/maps/documentation/distance-matrix for more + info. :param origins: One or more addresses, Place IDs, and/or latitude/longitude values, from which to calculate distance and time. Each Place ID string diff --git a/googlemaps/elevation.py b/googlemaps/elevation.py index 8eb6b14a..886efc61 100644 --- a/googlemaps/elevation.py +++ b/googlemaps/elevation.py @@ -24,7 +24,10 @@ def elevation(client, locations): """ Provides elevation data for locations provided on the surface of the earth, including depth locations on the ocean floor (which return negative - values) + values). + + Calls the Elevation API. See + https://developers.google.com/maps/documentation/elevation for more info. :param locations: List of latitude/longitude values from which you wish to calculate elevation data. @@ -41,6 +44,9 @@ def elevation_along_path(client, path, samples): """ Provides elevation data sampled along a path on the surface of the earth. + Calls the Elevation API. See + https://developers.google.com/maps/documentation/elevation for more info. + :param path: An encoded polyline string, or a list of latitude/longitude values from which you wish to calculate elevation data. :type path: string, dict, list, or tuple diff --git a/googlemaps/geocoding.py b/googlemaps/geocoding.py index 590bb627..8cd63f24 100644 --- a/googlemaps/geocoding.py +++ b/googlemaps/geocoding.py @@ -27,6 +27,9 @@ def geocode(client, address=None, place_id=None, components=None, bounds=None, r coordinates (like latitude 37.423021 and longitude -122.083739), which you can use to place markers or position the map. + Calls the Geocoding API. See + https://developers.google.com/maps/documentation/geocoding for more info. + :param address: The address to geocode. :type address: string @@ -83,6 +86,10 @@ def reverse_geocode(client, latlng, result_type=None, location_type=None, Reverse geocoding is the process of converting geographic coordinates into a human-readable address. + Calls the Geocoding API (Reverse Geocoding). See + https://developers.google.com/maps/documentation/geocoding/requests-reverse-geocoding + for more info. + :param latlng: The latitude/longitude value or place_id for which you wish to obtain the closest, human-readable address. :type latlng: string, dict, list, or tuple diff --git a/googlemaps/places.py b/googlemaps/places.py index 269a17fa..3e852f60 100644 --- a/googlemaps/places.py +++ b/googlemaps/places.py @@ -132,6 +132,10 @@ def find_place( The text input can be any kind of Places data, for example, a name, address, or phone number. + Calls the Places API Find Place (``findplacefromtext``). See + https://developers.google.com/maps/documentation/places/web-service/search-find-place + for more info. + :param input: The text input specifying which place to search for (for example, a name, address, or phone number). :type input: string @@ -211,6 +215,10 @@ def places( """ Places search. + Calls the Places API Text Search (``textsearch``). See + https://developers.google.com/maps/documentation/places/web-service/search-text + for more info. + :param query: The text string on which to search, for example: "restaurant". :type query: string @@ -289,6 +297,10 @@ def places_nearby( """ Performs nearby search for places. + Calls the Places API Nearby Search (``nearbysearch``). See + https://developers.google.com/maps/documentation/places/web-service/search-nearby + for more info. + :param location: The latitude/longitude value for which you wish to obtain the closest, human-readable address. :type location: string, dict, list, or tuple @@ -437,6 +449,10 @@ def place( """ Comprehensive details for an individual place. + Calls the Places API Place Details (``details``). See + https://developers.google.com/maps/documentation/places/web-service/details + for more info. + :param place_id: A textual identifier that uniquely identifies a place, returned from a Places search. :type place_id: string @@ -500,6 +516,10 @@ def places_photo(client, photo_reference, max_width=None, max_height=None): """ Downloads a photo from the Places API. + Calls the Places API Place Photos (``photo``). See + https://developers.google.com/maps/documentation/places/web-service/photos + for more info. + :param photo_reference: A string identifier that uniquely identifies a photo, as provided by either a Places search or Places detail request. :type photo_reference: string @@ -561,6 +581,10 @@ def places_autocomplete( Returns Place predictions given a textual search string and optional geographic bounds. + Calls the Places API Place Autocomplete (``autocomplete``). See + https://developers.google.com/maps/documentation/places/web-service/autocomplete + for more info. + :param input_text: The text string on which to search. :type input_text: string @@ -630,6 +654,10 @@ def places_autocomplete_query( Returns Place predictions given a textual search query, such as "pizza near New York", and optional geographic bounds. + Calls the Places API Query Autocomplete (``queryautocomplete``). See + https://developers.google.com/maps/documentation/places/web-service/query + for more info. + :param input_text: The text query on which to search. :type input_text: string diff --git a/googlemaps/roads.py b/googlemaps/roads.py index edfb8ecb..ad4cb8d1 100644 --- a/googlemaps/roads.py +++ b/googlemaps/roads.py @@ -31,6 +31,9 @@ def snap_to_roads(client, path, interpolate=False): set of data with the points snapped to the most likely roads the vehicle was traveling along. + Calls the Roads API Snap to Roads (``snapToRoads``). See + https://developers.google.com/maps/documentation/roads/snap for more info. + :param path: The path to be snapped. :type path: a single location, or a list of locations, where a location is a string, dict, list, or tuple @@ -62,6 +65,10 @@ def nearest_roads(client, points): segment for each point. The points passed do not need to be part of a continuous path. + Calls the Roads API Nearest Roads (``nearestRoads``). See + https://developers.google.com/maps/documentation/roads/nearest for more + info. + :param points: The points for which the nearest road segments are to be located. :type points: a single location, or a list of locations, where a @@ -80,6 +87,10 @@ def nearest_roads(client, points): def speed_limits(client, place_ids): """Returns the posted speed limit (in km/h) for given road segments. + Calls the Roads API Speed Limits (``speedLimits``). See + https://developers.google.com/maps/documentation/roads/speed-limits for + more info. + :param place_ids: The Place ID of the road segment. Place IDs are returned by the snap_to_roads function. You can pass up to 100 Place IDs. :type place_ids: str or list @@ -101,6 +112,10 @@ def snapped_speed_limits(client, path): The provided points will first be snapped to the most likely roads the vehicle was traveling along. + Calls the Roads API Speed Limits (``speedLimits``). See + https://developers.google.com/maps/documentation/roads/speed-limits for + more info. + :param path: The path of points to be snapped. :type path: a single location, or a list of locations, where a location is a string, dict, list, or tuple diff --git a/googlemaps/timezone.py b/googlemaps/timezone.py index 0b6370dc..952dfc1f 100644 --- a/googlemaps/timezone.py +++ b/googlemaps/timezone.py @@ -26,6 +26,9 @@ def timezone(client, location, timestamp=None, language=None): """Get time zone for a location on the earth, as well as that location's time offset from UTC. + Calls the Time Zone API. See + https://developers.google.com/maps/documentation/timezone for more info. + :param location: The latitude/longitude value representing the location to look up. :type location: string, dict, list, or tuple