Comments (12)
Hi Phillip,
That address works fine in my GeoLiteCity database, where did you get yours? Any chance I can get your database to try to see if it's an underlying problem in pygeoip? An empty dictionary can be returned when the IP address can not be found in the database, or the lookup method fail for some reason.
from pygeoip.
Hi William,
I downloaded the file from here:
http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
Here you can find mine:
http://bailey.st/files/GeoLiteCity.dat
I've downloaded a new db file and just to be sure I've made a md5sum of the files, it looks fine.
md5sum GeoLiteCity.dat.*
037a996de48e77e8d1d0fb9ceca49e6d GeoLiteCity.dat.NEW
037a996de48e77e8d1d0fb9ceca49e6d GeoLiteCity.dat.OLD
Now I'm puzzled.
Phillip
from pygeoip.
This is the version of pygeoip I'm using.
pip search pygeoip
pygeoip - Pure Python GeoIP API
INSTALLED: 0.2.6 (latest)
from pygeoip.
The database does not contain information for the IP. I did a sanity check with the Ruby library:
>> GeoIP.new('GeoLiteCity.dat').country('91.201.64.20')
=> nil
I will altough make a change to return None
instead of {}
to make it consistant with how the organisation miss work.
from pygeoip.
I don't know why someone else didn't come across to this problem before, looks weird maxmind is missing one ip from the database.
from pygeoip.
I think Maxmind are excluding addresses with status ALLOCATED UNSPECIFIED
, meaning the address is yet to be allocated from RIPE NCC.
from pygeoip.
This ip belong to a botnet command control server.
from pygeoip.
Hardcore, but I don't think this is an pygeoip issue though, Maxmind might help you further.
Thanks for reporting.
from pygeoip.
Anyway thanks for your effort and time.
from pygeoip.
Hi William,
Sorry to comment on a closed issue. Are you going to make the change to return None instead of {} ?
from pygeoip.
Yes, record_by_addr will in >= 0.2.7 return None
instead of {}
from pygeoip.
This fix will really help if you iterate through an ip addresses txt file, as I'm doing.
Thanks very much,
from pygeoip.
Related Issues (20)
- Package documentation is formatted as text on PyPI HOT 6
- Add support for MaxMind DB (.mmdb) files HOT 2
- ValueError: seek out of range HOT 2
- Works with Python 3.4 HOT 1
- ImportError: No module named 'pygeoip' HOT 7
- GeoLite2 City DB returns pygeoip.GeoIPError: Invalid database type, expected City HOT 1
- Correctly using pygeoip inside a Django app HOT 4
- Exception handler cannot make up its mind. HOT 13
- Mo netspeeds, mo problems HOT 1
- Inconsistent / missing results from Region database HOT 6
- Release 0.3.2 HOT 1
- error: illegal IP address string passed to inet_pton HOT 7
- "pygeoip __init__.py _gethostbyname" Error. HOT 1
- pygeoip don't support region_name? HOT 1
- I cant load MindMax database HOT 1
- IPV6 results returned on database not supporting IPV6
- region_name not available HOT 1
- timezones are not IANA standard
- MaxMind GeoIP now has an officiel Python lib
- rare `string index out of range` issue,
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pygeoip.