Dead simple geoip package
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
simplegeoip
tests
.coveragerc
.gitignore
.pylintrc
.travis.yml
DEVELOPMENT.md
LICENSE
MANIFEST.in
Pipfile
Pipfile.lock
README.rst
setup.cfg
setup.py

README.rst

simple-geoip

Travis-CI codecov Latest version Supported python versions

Dead simple geoip package. Pretty much just a wrapper around maxminddb that automatically downloads the geolite database for you. You can either do this manually using the 'download_latest_database' function or let the script do it automatically when it detects no database is installed.

Can be used as a package or standalone script.

Install

pip install simplegeoip

Usage

As a python package.

import simplegeoip

# Gets a dict with country/city information, if there is no database it will be downloaded automatically
simplegeoip.lookup('127.0.0.1')
# Downloads an updated database into simplegeoip's application directory
simplegeoip.download_latest_database()
# Tells you when the database was last updated by maxmind
simplegeoip.last_updated()
# Returns a maxminddb reader object, if there is no database it will be downloaded automatically
simplegeoip.reader()

The same as above but as a standalone script

simplegeoip 8.8.8.8
simplegeoip update
simplegeoip info