1
Hello I would like to run a CSV that contains more than 100 CEP and return to me, in another CSV, Latitude and Longitude.
I already have the basis to transform the zip code. But I’m not able to read a CSV line by line and return latitude and longitude.
import pycep_correios
from geopy.geocoders import Nominatim
endereco = pycep_correios.get_address_from_cep('01001010')
geolocator = Nominatim(user_agent="test_app")
location = geolocator.geocode(endereco['logradouro'] + ", " + endereco['cidade'] + " - " + endereco['bairro'])
print(location.latitude, location.longitude)
Someone can help me?
thank you
You need to "open" the CSV in your file. Take a look here: CSV File Reading and Writing.
– Arnon