feat: Add Routes API (v2), Places API (New / v1), Solar, Air Quality, and Pollen APIs#546
Draft
dkhawk wants to merge 1 commit into
Draft
feat: Add Routes API (v2), Places API (New / v1), Solar, Air Quality, and Pollen APIs#546dkhawk wants to merge 1 commit into
dkhawk wants to merge 1 commit into
Conversation
fc0981f to
1fa3aba
Compare
902b204 to
550eba7
Compare
…ollen APIs with CUJ samples, integration tests, and GitHub Actions CI secret support - Added Isochrones API (generate_isochrones) for computing reachability polygons. - Added Routes API (v2) (compute_routes, compute_route_matrix) for modern directions and travel matrices. - Added Places API (New / v1) (places_search_text, places_search_nearby, place_v1, places_autocomplete_v1, place_photo_v1). - Added Solar API (find_closest_building_insights, get_solar_data_layers). - Added Air Quality API (air_quality_current_conditions). - Added Pollen API (pollen_forecast). - Updated Client request handling in googlemaps/client.py to merge custom HTTP headers (such as X-Goog-FieldMask). - Added executable CUJ sample scripts suite in samples/ (real estate, logistics, travel discovery, pandas pipeline, fleet solver matrix, telemetry snapping, 15-minute city isochrones). - Added live API integration test suite in tests/test_integration.py (verifying Devils Tower places search, Googleplex geocoding, Routes v2, Mount Everest elevation, and Address Validation). - Configured GitHub Actions workflow (.github/workflows/test.yml) to ingest secrets.GOOGLE_MAPS_API_KEY for automated live integration runs across Python 3.9 - 3.13. - Updated README.md with comprehensive modern API Key setup, security restrictions, local execution, and GitHub Actions secret configuration. - Achieved 90% statement coverage across python library code (147 passing unit and live integration tests).
550eba7 to
cf5d3ff
Compare
| record = {"original_input": addr, "error": str(e)} | ||
|
|
||
| dataset.append(record) | ||
| print(f"Processed: {addr} -> Lat/Lng: ({record.get('latitude')}, {record.get('longitude')})") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR brings the
google-maps-services-pythonlibrary up to date with modern Google Maps Platform APIs.It introduces native support for Isochrones API, Routes API (v2), Places API (New / v1), Solar API, Air Quality API, and Pollen API, along with core
Clientupdates for response field masking (X-Goog-FieldMask), executable CUJ samples, automated GitHub Actions CI secrets integration, and a live server integration test suite.🆕 New APIs and API Calls
1. Isochrones API — [
googlemaps/isochrones.py](file:///googlemaps/isochrones.py)Client.generate_isochrones(location, travel_mode="DRIVE", travel_direction="FROM", duration_seconds=900, ...): Calculates reachable boundaries (isochrone polygons) within a time or distance threshold (POST https://isochrones.googleapis.com/v1/isochrones:generate).2. Routes API (v2) — [
googlemaps/routes.py](file:///googlemaps/routes.py)Client.compute_routes(origin, destination, fields=None, travel_mode=None): Modern directions API (POST https://routes.googleapis.com/directions/v2:computeRoutes).Client.compute_route_matrix(origins, destinations, fields=None, travel_mode=None, routing_preference=None): Modern distance matrix API (POST https://routes.googleapis.com/distanceMatrix/v2:computeRouteMatrix).3. Places API (New / v1) — [
googlemaps/places_v1.py](file:///googlemaps/places_v1.py)Client.places_search_text(text_query, fields=None, ...): Modern text search (POST https://places.googleapis.com/v1/places:searchText).Client.places_search_nearby(location, radius, fields=None, ...): Modern nearby search (POST https://places.googleapis.com/v1/places:searchNearby).Client.place_v1(place_id, fields=None, ...): Modern place details (GET https://places.googleapis.com/v1/places/{place_id}).Client.places_autocomplete_v1(input_text, ...): Modern place autocomplete (POST https://places.googleapis.com/v1/places:autocomplete).Client.place_photo_v1(name, max_height_px=None, max_width_px=None, ...): Modern photo media endpoint (GET https://places.googleapis.com/v1/{name}/media).4. Solar API — [
googlemaps/solar.py](file:///googlemaps/solar.py)Client.find_closest_building_insights(location, required_quality=None, ...): Finds closest building insights (GET https://solar.googleapis.com/v1/buildingInsights:findClosest).Client.get_solar_data_layers(location, radius_meters, view=None, ...): Retrieves solar imagery/data layers (GET https://solar.googleapis.com/v1/dataLayers:get).5. Air Quality API — [
googlemaps/airquality.py](file:///googlemaps/airquality.py)Client.air_quality_current_conditions(location, ...): Air quality current conditions (POST https://airquality.googleapis.com/v1/currentConditions:lookup).6. Pollen API — [
googlemaps/pollen.py](file:///googlemaps/pollen.py)Client.pollen_forecast(location, days=1, ...): Pollen forecast search (GET https://pollen.googleapis.com/v1/forecast:lookup).🌐 Live Server Integration Test Suite (
tests/test_integration.py).github/workflows/test.yml) to automatically run live tests whensecrets.GOOGLE_MAPS_API_KEYis present.MultiPolygongeometry resolution.💻 Executable CUJ Sample Suite (
samples/)samples/isochrone_reachability_cuj.py: 15-Minute City & Emergency Coverage Analysis.samples/data_science_pandas_geocoding.py: Address processing & Pandas DataFrame pipeline export.samples/fleet_optimization_matrix.py: Vehicle Routing Matrix generation for OR-Tools/SciPy solvers.samples/infrastructure_elevation_snapping.py: Roads API GPS snapping & Elevation profile analysis.samples/real_estate_insights.py: Real Estate Property Evaluation & Environmental Analysis.samples/delivery_route_planner.py: Warehouse-to-delivery route planning.samples/travel_discovery_assistant.py: Places API (New) discovery & rich photo media experience.None. All legacy methods remain 100% backward compatible.
🧪 Testing