I'm trying to read a log file from a github url, add some geographic info using the IP as a lookup key, and then write some log info and the geographic info to a file. I've got the reading from and writing to file from the log, but I'm not sure what lib to use for looking up coordinates and such from an IP address, nor how to really go about this part. I found the regex module, and by the time I started to understand it, I found out it's deprecated. Here's what I've, got, any help would be great.
import urllib2
apacheLog = 'https://raw.githubusercontent.com/myAccessLog.log'
data = urllib2.urlopen(apacheLog)
for line in data:
with open('C:\LogCopy.txt','a') as f:
f.write(line)