pip install zipcode-to-map
Provide a Country code and postal code. It will generate a map in a html file based on these details. Used pgeocode and folium packages.
pip install folium
pip install pgeocode
from zipcode_to_map.zipcode_to_map import ZipcodeToMap
result_map = ZipcodeToMap()
result_map.zipcode_to_map('in','515411')
from zipcode_to_map.zipcode_to_map import ZipcodeToMap
result_map = ZipcodeToMap()
try:
result_map.zipcode_to_map('in','515411')
except Exception as e:
print("Not a valid pincode. Try with a valid one.")
from zipcode_to_map.zipcode_to_map import ZipcodeToMap
result_map = ZipcodeToMap()
zipcodes = ['515411', '560034', '560048', '515422']
try:
for zipcode in zipcodes:
result_map.zipcode_to_map('in',zipcode)
except Exception as e:
print("Not a valid pincode. Try with a valid one.")