Skip to content

Instantly share code, notes, and snippets.

@AgustinPelaez
Last active August 27, 2017 05:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AgustinPelaez/5bb98fff0a3165b92de1ab92db56549a to your computer and use it in GitHub Desktop.
Save AgustinPelaez/5bb98fff0a3165b92de1ab92db56549a to your computer and use it in GitHub Desktop.
A Dockerfile compatible Python script to be used with Openwhisk
#!/usr/bin/env python
from geopy.geocoders import Nominatim
import sys
import json
def main():
geolocator = Nominatim()
params = json.loads(sys.argv[1])
location = geolocator.reverse((params['lat'],params['lng']))
print(json.dumps({ 'address' : location.address}))
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment