Mapping IP addresses to Geographic Locations in Python
Categories: Tech | Pubby Cash Received:
10
An IP address - a list of four segments of 3 digits numbers between 0 and 255 and connected by dots can contain more information than you think. Underneath this article, you can see where this article is posted from. This gives you an example that an IP address can be transformed to the geographical location.
I'm introducing one way to realize it in Python - use API from ipinfo.io. Their free version can give the geographic location, ISP provider's name, and even GPS coordinates of the location, which should be enough for most website owners. Their API include a token, which is good for querying 50,000 times a month. The following code can be used as an example. Remember to replace the ip and token with your ip and token.
import requests, json
link = f'https://ipinfo.io/{ip}?token={token}'
r = requests.get(link)
content = json.loads(r.content)
print(content)
...
Read more












With regard to the specific methods within the water and wastewater fields, artificial neural network is the most popular method followed by clustering. There are huge potentials for further exploration, as the encapsulation of ML into functional decision support system is not fully investigated. This is because: (1) there is a lack of an association between the fields of water engineering and computer engineering; (2) most ML techniques were adopted by academics with limited practical experience; (3) ML techniques are inherently multi-disciplinary and combined with problems of great complexity facing water and wastewater systems; and (4) there is a lack of user-friendly interfaces and support after product delivery.
With that said, I'm working on an integration of machine learning into my discipline of water and wastewater treatment. Sound promising?...