Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tethik/simplegeoip
Dead simple geoip package
https://github.com/tethik/simplegeoip
geoip ip networking
Last synced: 4 days ago
JSON representation
Dead simple geoip package
- Host: GitHub
- URL: https://github.com/tethik/simplegeoip
- Owner: Tethik
- License: gpl-3.0
- Created: 2017-03-02T00:28:18.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-22T14:45:27.000Z (about 5 years ago)
- Last Synced: 2024-10-11T08:26:48.583Z (27 days ago)
- Topics: geoip, ip, networking
- Language: Python
- Size: 91.8 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
============
simple-geoip
============
.. image:: https://travis-ci.org/Tethik/simplegeoip.png?branch=master
:target: https://travis-ci.org/Tethik/simplegeoip
:alt: Travis-CI.. image:: https://codecov.io/gh/Tethik/simplegeoip/branch/master/graph/badge.svg
:target: https://codecov.io/gh/Tethik/simplegeoip
:alt: codecov.. image:: https://img.shields.io/pypi/v/simplegeoip.svg
:target: https://pypi.python.org/pypi/simplegeoip
:alt: Latest version.. image:: https://img.shields.io/pypi/pyversions/simplegeoip.svg
:target: https://pypi.python.org/pypi/simplegeoip/
:alt: Supported python versions
.. image:: https://img.shields.io/github/license/Tethik/simplegeoip.svg
:target: https://github.com/Tethik/simplegeoip/blob/master/LICENSE
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
-------.. code-block:: bash
pip install simplegeoip
Usage
-----
As a python package... code-block:: python
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
.. code-block:: bash
simplegeoip 8.8.8.8
simplegeoip update
simplegeoip info