Giter Site home page Giter Site logo

pygeoipmap's People

Contributors

alexhaydock avatar c0r3dump3d avatar jay avatar joelmon avatar lgg avatar newky avatar pieqq avatar pwcazenave avatar rascalking avatar trustmega avatar veox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pygeoipmap's Issues

Problems With the script...

I put the script in/usr/local/bin with +chmod and it's happening again and again and I've Maxmind GeoLite2.csv , results.csv are IPs and I m a n00b , sorry for my errors :-)
$ pygeoipmap.py -i /root/results3.csv -o /tmp/output.png -f csv -s m --db /home/jhk/GeoLite2-City-Locations.csv
Traceback (most recent call last):
File "/usr/local/bin/pygeoipmap.py", line 124, in
main()
File "/usr/local/bin/pygeoipmap.py", line 118, in main
lats, lons = get_lat_lon_from_csv(args.input)
File "/usr/local/bin/pygeoipmap.py", line 77, in get_lat_lon_from_csv
lats.append(row[-2])
IndexError: list index out of range

I also did $ python pygeoipmap.py -i /root/results3.csv -o /tmp/output.png -f csv -s m --db /home/jhk/GeoLite2-City-Locations.csv
python: can't open file 'pygeoipmap.py': [Errno 2] No such file or directory

No module named 'numpy'

➜ PyGeoIpMap git:(master) ✗ sudo pip3 install -r requirements.txt
Collecting https://github.com/matplotlib/basemap/archive/v1.0.7rel.tar.gz (from -r requirements.txt (line 3))
Downloading https://github.com/matplotlib/basemap/archive/v1.0.7rel.tar.gz
| 164.3MB 16.0MB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-req-build-gni68bkb/setup.py", line 1, in
import sys, glob, os, numpy, subprocess
ImportError: No module named 'numpy'

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-req-build-gni68bkb/

I think this will be sorted by moving numpy to one of the first packages to be installed.

freegeoip.net is down

Hi @Pierrrrrrre ,
very nice script thanks! It is very useful for reports! Unfortunately freegeoip is down now so the script does not work anymore. For this I have just hacked the script to include:

diff --git a/pygeoipmap.py b/pygeoipmap.py
index 2fddb0f..0b1816a 100644
--- a/pygeoipmap.py
+++ b/pygeoipmap.py
@@ -31,9 +31,10 @@ def get_lat_lon(ip_list=[], lats=[], lons=[]):
     """
     print("Processing {} IPs...".format(len(ip_list)))
     for ip in ip_list:
-        r = requests.get("https://freegeoip.net/json/" + ip)
+        #r = requests.get("https://freegeoip.net/json/" + ip)
+        r = requests.get("https://www.telize.com/geoip/" + ip)
         json_response = r.json()
-        print("{ip}, {region_name}, {country_name}, {latitude}, {longitude}".format(**json_response))
+        print("{ip}, {continent_code}, {country}, {latitude}, {longitude}".format(**json_response))
         if json_response['latitude'] and json_response['longitude']:
             lats.append(json_response['latitude'])
             lons.append(json_response['longitude'])

and use telize.com. I did not do a merge request because telize will shut down soon too .
Thanks again,
Denis

No display

I am trying to run this on a linux server that doesn't have a real display. I get the following error when trying to build the map.

_tkinter.TclError: no display name and no $DISPLAY environment variable

Is there any way to run this without a display?

Use geoip2 instead of GeoIP

Thanks for a very useful script :)

I was wondering if its possible to add support for geoip2 or use it as a replacement for GeoIP?
Using geoip2.database one would be able to use the GeoLite2-City.mmdb database which has better accuracy.

basemap install does not work through pip

you can either do it through conda by
conda install -c https://conda.anaconda.org/anaconda basemap
or if in ubuntu through
sudo apt-get install python-mpltoolkits.basemap

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.