Shell script and module for easy geoip lookups.
Project description
[![Build Status](https://travis-ci.org/Tethik/simplegeoip.svg?branch=master)](https://travis-ci.org/Tethik/simplegeoip) [![codecov](https://codecov.io/gh/Tethik/simplegeoip/branch/master/graph/badge.svg)](https://codecov.io/gh/Tethik/simplegeoip) [![PyPI version](https://badge.fury.io/py/simplegeoip.svg)](https://badge.fury.io/py/simplegeoip)
# simple-geoip
Dead simple geoip package. Pretty much just a wrapper around [maxminddb](https://github.com/maxmind/MaxMind-DB-Reader-python/)
that automatically downloads the geolite database for you. You can either do this manually using the 'download_latest_database_from_maxmind' 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
```bash
pip install simplegeoip
```
# Usage
As a python package.
```python
import simplegeoip
# Gets a dict with country/city information
simplegeoip.lookup('127.0.0.1')
# Downloads an updated database into simplegeoip's package directory
simplegeoip.download_latest_database_from_maxmind()
# Tells you when the database was last updated by maxmind
simplegeoip.last_updated()
# Returns a maxminddb reader object with the database automatically downloaded.
simplegeoip.reader()
```
The same as above but as a standalone script
```bash
simplegeoip 8.8.8.8
simplegeoip update
simplegeoip info
```
# simple-geoip
Dead simple geoip package. Pretty much just a wrapper around [maxminddb](https://github.com/maxmind/MaxMind-DB-Reader-python/)
that automatically downloads the geolite database for you. You can either do this manually using the 'download_latest_database_from_maxmind' 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
```bash
pip install simplegeoip
```
# Usage
As a python package.
```python
import simplegeoip
# Gets a dict with country/city information
simplegeoip.lookup('127.0.0.1')
# Downloads an updated database into simplegeoip's package directory
simplegeoip.download_latest_database_from_maxmind()
# Tells you when the database was last updated by maxmind
simplegeoip.last_updated()
# Returns a maxminddb reader object with the database automatically downloaded.
simplegeoip.reader()
```
The same as above but as a standalone script
```bash
simplegeoip 8.8.8.8
simplegeoip update
simplegeoip info
```
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
simplegeoip-0.1.3.tar.gz
(27.9 kB
view hashes)
Built Distribution
Close
Hashes for simplegeoip-0.1.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc083dc6540b49c9473e7b5159c6123f147589d41894be06fda9237343371dd3 |
|
MD5 | 39296dec4cde4a1419a6b65a1913d698 |
|
BLAKE2b-256 | a6417ae2f1ad415ec57028313157cb94e6392e567ff36c9bc2cdbf9202645d83 |