Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (testpypi.python.org).
Help us improve Python packaging - Donate today!

This script scans given text to find urls and IP addresses. The output is the same text but every url and IP address is going to have its geolocation appended.

Project Description

This program accepts any text and searchs inside every IP address. With each of those IP addresses, geolocate queries Maxmind GeoIP database to look for the city and country where IP or URL is located.

Geolocate is designed to be used in console with pipes and redirections along with applications like traceroute, etc. Geolocate’s output is the same text than input but IP is going to have appended its country and city and long-lat coordinates (depending on verbosity level).

It has two main running modes:

  • Stream mode: used to parse piped output from other programs.
$ traceroute -n www.google.com | ./geolocate.py -v 3 -s
traceroute to www.google.com (216.58.210.164 [North America | United States | Mountain View | 37.419200000000004, -122.0574]), 30 hops max, 60 byte packets
1  * * *
2  * * *
3  * * *
4  * * *
5  * * *
6  5.53.1.82 [Europe | Spain | Unknown city | 40.0, -4.0]  12.277 ms  9.252 ms  8.790 ms
7  209.85.252.150 [North America | United States | Mountain View | 37.419200000000004, -122.0574]  19.491 ms  16.614 ms  16.687 ms
8  216.239.50.27 [Europe | United Kingdom | Unknown city | 51.5, -0.13]  16.614 ms  16.010 ms  16.025 ms
9  216.58.210.164 [North America | United States | Mountain View | 37.419200000000004, -122.0574]  15.988 ms  14.372 ms  14.321 ms
  • Text mode: used to parse a given string of text.
$ ./geolocate.py "216.58.210.132" -v 3
216.58.210.132 [North America | United States | Mountain View | 37.419200000000004, -122.0574]

For further information about how to use geolocate, please refer to it Geolocate Homepage.

Author:Dante Signal31
e-mail:dante.signal31@gmail.com
Release History

Release History

This version
History Node

1.0.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
geolocate-1.0.0-py3-none-any.whl (19.9 kB) Copy SHA256 Checksum SHA256 py3 Wheel Mar 2, 2015
geolocate-1.0.0.tar.gz (14.6 kB) Copy SHA256 Checksum SHA256 Source Mar 2, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting