I have about 2000 Location Point (Lat, long) in CSV format and I want make a local Flask app (a Python Micro-framework) to send each of this point to google map API and find the address corresponding and save theme.
At first I install PostgreSQL and pgAdmin and then import CSV file to a new database. Secondly I install Virtualenv and also psycopg2 Flask-SQLAlchemy in my env folder
Now I have to make connection between my database and my flask app, then send each of database records (my location points!) to google map and store corresponding address to another filed in my database. but I don't know how I can connect PostgreSQL to Flask app and then how to send points and store address.
(Python 3.5 - PostgreSQL 9.6 - Linux Ubuntu 16.0.4)
Um, not enough reputation to comment.
By the way, just use Psycopg2 module sending query to database, and render the the resultSet.
You have to design what data you want to render to the specific route in Flask.
Google-Maps API provides different types of data return, which kind you needed?
If you want to show the map in Flask pages, you should work on Google-Maps' JavaScript.
And If you no need to display the data but only store in database, just send the request to the API entry. Use Request module and no need Flask.
>> from geopy.geocoders import GoogleV3
>> geolocator = GoogleV3()
>> location = geolocator.geocode("175 5th Avenue NYC")
>> print(location.address)
175 5th Ave, New York, NY 10010, USA
>> location = geolocator.reverse("40.7410861, -73.9896297241625")
>> print(location[0])
Flatiron Building, New York, NY 10010, USA