{"library":"geopy","code":"import os\nfrom geopy.geocoders import Nominatim\n\n# For Nominatim, a 'user_agent' is required.\n# In a production environment, use a unique, descriptive string for your application.\ngeolocator = Nominatim(user_agent=os.environ.get('GEOPY_USER_AGENT', 'my_geocoding_app'))\n\n# Geocode an address\naddress = \"175 5th Avenue NYC\"\nlocation = geolocator.geocode(address)\n\nif location:\n    print(f\"Address: {location.address}\")\n    print(f\"Latitude: {location.latitude}, Longitude: {location.longitude}\")\nelse:\n    print(f\"Could not find location for: {address}\")\n\n# Reverse geocode coordinates\ncoordinates = \"52.509669, 13.376294\" # Berlin\nreversed_location = geolocator.reverse(coordinates)\n\nif reversed_location:\n    print(f\"\\nCoordinates: {coordinates}\")\n    print(f\"Address: {reversed_location.address}\")\nelse:\n    print(f\"Could not find address for: {coordinates}\")","lang":"python","description":"This quickstart demonstrates how to use the Nominatim geocoder to convert an address string into geographical coordinates (latitude and longitude) and vice-versa. It highlights the necessity of providing a `user_agent` for Nominatim, as recommended by its usage policy, and safely retrieves it from an environment variable.","tag":null,"tag_description":null,"last_tested":"2026-04-24","results":[{"runtime":"python:3.10-alpine","exit_code":0},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":0},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":0},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":0},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":0},{"runtime":"python:3.9-slim","exit_code":1}]}