- Python Network Programming - Home
- Python Network Introduction
- Python Networking - Environment Setup
- Python Networking - Internet Protocol
- Python Networking - IP Address
- Python Networking - DNS Lookup
- Python Networking - Routing
- Python Networking - HTTP Requests
- Python Networking - HTTP Response
- Python Networking - HTTP Headers
- Python Networking - Custom HTTP Requests
- Python Networking - Request Status Codes
- Python Networking - HTTP Authentication
- Python Networking - HTTP Data Download
- Python Networking - Connection Re-use
- Python Networking - Network Interface
- Python Networking - Sockets Programming
- Python Networking - HTTP Client
- Python Networking - HTTP Server
- Python Networking - Building URLs
- Python Networking - WebForm Submission
- Python Networking - Databases and SQL
- Python Networking - Telnet
- Python Networking - Email Messages
- Python Networking - SMTP
- Python Networking - POP3
- Python Networking - IMAP
- Python Networking - SSH
- Python Networking - FTP
- Python Networking - SFTP
- Python Networking - Web Servers
- Python Networking - Uploading Data
- Python Networking - Proxy Server
- Python Networking - Directory Listing
- Python Networking - Remote Procedure Call
- Python Networking - RPC JSON Server
- Python Networking - Google Maps
- Python Networking - RSS Feed
Python Network Programming Resources
Python Network - Google Maps
Python provides modules which can be used to translate addresses available in google map directly to geographic coordinates. It is helpful in finding business addresses and locating the closeness of different addresses.
We use a module named pygeocoder which provides the functionalities to receive addresses and geocodes. This module is installed through pip using the following command.
Installing pygeocoder
pip3 install pygeocoder
Finding Business Address
We submit a business name as input and the program gives the complete address as the output. The module uses data from google maps in the background to retrieve the result.
main.py
from pygeocoder import Geocoder
api_key = "YOUR API KEY"
geocoder = Geocoder(api_key)
business_name = "Workafella Business Centre - Hitec city"
print("Searching %s" %business_name)
results = geocoder.geocode(business_name)
for result in results:
print(result)
Output
When we run the above program, we get the following output −
Searching Workafella Business Centre - Hitec city Western pearl building 1st floor, Hitech City Rd, Opposite HDFC Bank, Kondapur, Hyderabad, Telangana 500084, India
Advertisements