Commit 55382314 by William Tisäter

Merge pull request #51 from appliedsec/sphinx-docs

Sphinx documentation for readthedocs.org
Fixes #50
parents b8c67327 fb7e8fb2
......@@ -9,4 +9,4 @@ pygeoip-*
cover
.coverage
.coveralls.yml
apidocs/html/.*
docs/_build/*
......@@ -2,6 +2,7 @@
### Release 0.3.1
* New: Documentation now available on readthedocs.org
* New: MaxMind Netspeed database support
* Fix: Release thread lock on exceptions
......
# Bootstrap manual for developers
_Dependencies: tox, nose, epydoc_
_Dependencies: tox, nose_
### Testing
......@@ -16,19 +16,10 @@ https://www.defunct.cc/maxmind-geoip-samples.tar.gz (17 MB)
Extract the tarball in the tests directory and run `tox` from the root directory.
This requires a machine with Python 2.5 - 3.3 installed and all dependencies mention in the header.
### Documentation
The documentation can be re-generated by running epydoc from repository root.
epydoc --config=epydoc.ini --no-private
For converting Markdown to reStructuredText used by PyPi we use pandoc.
[Read pandoc's install instructions](http://johnmacfarlane.net/pandoc/installing.html).
This requires a machine with Python 2.6 - 3.3 installed and all dependencies mention in the header.
### TL;DR
There's a shell script doing all this for you.
There's a Makefile doing all this for you.
./build.sh
make test
recursive-include apidocs *
recursive-include tests *
include README.rst
include LICENSE.md
include DEVELOPER.md
include CHANGELOG.md
include epydoc.ini
include tox.ini
.PHONY: docs
all: test
test:
@echo "Downloading test databases"
rm -rf maxmind-geoip-samples.tar.gz tests/data; mkdir -p tests/data
curl -s https://www.defunct.cc/maxmind-geoip-samples.tar.gz | tar -zx -C tests
@echo "Testing local state"
@tox --version > /dev/null || (echo "Requires tox - install requirements.txt"; exit 1)
tox
docs:
@echo "Building documentation"
make -C docs clean
make -C docs html
clean:
@echo "Cleaning doc, test and cache files"
git clean -fd
find . -name *.pyc -delete
rm -rf pygeoip-* pygeoip.egg-info
# Pure Python GeoIP API
This library is based on [Maxmind's GeoIP C API](https://github.com/maxmind/geoip-api-c).
Tested with Python version 2.6, 2.7, 3.2 and 3.3.
[![Build Status](https://api.travis-ci.org/appliedsec/pygeoip.png?branch=master)](https://travis-ci.org/appliedsec/pygeoip) [![Coverage Status](https://coveralls.io/repos/appliedsec/pygeoip/badge.png)](https://coveralls.io/r/appliedsec/pygeoip) [![Downloads](https://pypip.in/d/pygeoip/badge.png)](https://crate.io/packages/pygeoip)
## Installation
You can easily install pygeoip from PyPi.
```bash
pip install pygeoip
```
## Issues and Contribution
Bug reports are done by [creating an issue on Github](https://github.com/appliedsec/pygeoip/issues). If you want to contribute you can always [create a pull request](https://github.com/appliedsec/pygeoip/pulls) for discussion and code submission.
## Getting Started
Create your GeoIP instance with appropriate access flag. `STANDARD` reads data from disk when needed, `MEMORY_CACHE` loads database into memory on instantiation and `MMAP_CACHE` loads database into memory using mmap.
```python
>>> import pygeoip
>>> gi = pygeoip.GeoIP('/path/to/GeoIP.dat')
>>> gi.country_name_by_addr('64.233.161.99')
'United States'
```
### Country Lookup
```python
>>> gi = pygeoip.GeoIP('/path/to/GeoIP.dat')
>>> gi.country_code_by_name('google.com')
'US'
>>> gi.country_code_by_addr('64.233.161.99')
'US'
>>> gi.country_name_by_addr('64.233.161.99')
'United States'
```
```python
>>> gi = pygeoip.GeoIP('/path/to/GeoIPv6.dat')
>>> gi.country_code_by_name('google.com')
'IE'
>>> gi.country_code_by_addr('2001:7fd::1')
'EU'
>>> gi.country_name_by_addr('2001:7fd::1')
'Europe'
```
### Region Lookup
```python
>>> gi = pygeoip.GeoIP('/path/to/GeoIPRegion.dat')
>>> gi.region_by_name('apple.com')
{'region_code': 'CA', 'country_code': 'US'}
```
### City Lookup ###
```python
>>> gi = pygeoip.GeoIP('/path/to/GeoIPCity.dat')
>>> gi.record_by_addr('64.233.161.99')
{
'city': u'Mountain View',
'region_code': u'CA',
'area_code': 650,
'time_zone': 'America/Los_Angeles',
'dma_code': 807,
'metro_code': 'San Francisco, CA',
'country_code3': 'USA',
'latitude': 37.41919999999999,
'postal_code': u'94043',
'longitude': -122.0574,
'country_code': 'US',
'country_name': 'United States',
'continent': 'NA'
}
>>> gi.time_zone_by_addr('64.233.161.99')
'America/Los_Angeles'
```
### Organization Lookup
```python
>>> gi = pygeoip.GeoIP('/path/to/GeoIPOrg.dat')
>>> gi.org_by_name('dell.com')
'Dell Computer Corporation'
```
### ISP Lookup
```python
>>> gi = pygeoip.GeoIP('/path/to/GeoIPISP.dat')
>>> gi.isp_by_name('cnn.com')
'Turner Broadcasting System'
```
### ASN Lookup
```python
>>> gi = pygeoip.GeoIP('/path/to/GeoIPASNum.dat')
>>> gi.asn_by_name('cnn.com')
'AS5662 Turner Broadcasting'
```
For more information, [check out the full API documentation](http://packages.python.org/pygeoip).
## Supported Databases
| Type | IPv4 | IPv6 | Details |
| -------------- |:----:|:----:| ------- |
| Country | ✓ | ✓ | [MaxMind Country product page](http://www.maxmind.com/en/country) |
| City | ✓ | ✓ | [MaxMind City product page](http://www.maxmind.com/en/city) |
| Organization | ✓ | | [MaxMind Organization product page](http://www.maxmind.com/en/organization) |
| ISP | ✓ | | [MaxMind ISP product page](http://www.maxmind.com/en/isp) |
| Region | ✓ | | [MaxMind Region product page](http://www.maxmind.com/en/geolocation_landing) |
| ASN | ✓ | ✓ | [MaxMind ASN product page](http://dev.maxmind.com/geoip/legacy/geolite) |
| Netspeed | ✓ | | [MaxMind Netspeed product page](http://www.maxmind.com/en/netspeed) |
Pure Python GeoIP API
=====================
This library is based on `Maxmind's GeoIP C
API <https://github.com/maxmind/geoip-api-c>`__.
This library is based on `Maxmind's GeoIP C API <https://github.com/maxmind/geoip-api-c>`__.
Tested with Python version 2.6, 2.7, 3.2 and 3.3.
......@@ -13,7 +12,7 @@ Installation
You can easily install pygeoip from PyPi.
.. code:: bash
.. code:: python
pip install pygeoip
......@@ -26,132 +25,21 @@ contribute you can always `create a pull
request <https://github.com/appliedsec/pygeoip/pulls>`__ for discussion
and code submission.
Getting Started
---------------
Create your GeoIP instance with appropriate access flag. ``STANDARD``
reads data from disk when needed, ``MEMORY_CACHE`` loads database into
memory on instantiation and ``MMAP_CACHE`` loads database into memory
using mmap.
.. code:: python
>>> import pygeoip
>>> gi = pygeoip.GeoIP('/path/to/GeoIP.dat')
>>> gi.country_name_by_addr('64.233.161.99')
'United States'
Country Lookup
~~~~~~~~~~~~~~
.. code:: python
>>> gi = pygeoip.GeoIP('/path/to/GeoIP.dat')
>>> gi.country_code_by_name('google.com')
'US'
>>> gi.country_code_by_addr('64.233.161.99')
'US'
>>> gi.country_name_by_addr('64.233.161.99')
'United States'
.. code:: python
>>> gi = pygeoip.GeoIP('/path/to/GeoIPv6.dat')
>>> gi.country_code_by_name('google.com')
'IE'
>>> gi.country_code_by_addr('2001:7fd::1')
'EU'
>>> gi.country_name_by_addr('2001:7fd::1')
'Europe'
Region Lookup
~~~~~~~~~~~~~
.. code:: python
>>> gi = pygeoip.GeoIP('/path/to/GeoIPRegion.dat')
>>> gi.region_by_name('apple.com')
{'region_code': 'CA', 'country_code': 'US'}
City Lookup
~~~~~~~~~~~
.. code:: python
>>> gi = pygeoip.GeoIP('/path/to/GeoIPCity.dat')
>>> gi.record_by_addr('64.233.161.99')
{
'city': u'Mountain View',
'region_code': u'CA',
'area_code': 650,
'time_zone': 'America/Los_Angeles',
'dma_code': 807,
'metro_code': 'San Francisco, CA',
'country_code3': 'USA',
'latitude': 37.41919999999999,
'postal_code': u'94043',
'longitude': -122.0574,
'country_code': 'US',
'country_name': 'United States',
'continent': 'NA'
}
>>> gi.time_zone_by_addr('64.233.161.99')
'America/Los_Angeles'
Organization Lookup
~~~~~~~~~~~~~~~~~~~
.. code:: python
>>> gi = pygeoip.GeoIP('/path/to/GeoIPOrg.dat')
>>> gi.org_by_name('dell.com')
'Dell Computer Corporation'
ISP Lookup
~~~~~~~~~~
.. code:: python
>>> gi = pygeoip.GeoIP('/path/to/GeoIPISP.dat')
>>> gi.isp_by_name('cnn.com')
'Turner Broadcasting System'
ASN Lookup
~~~~~~~~~~
.. code:: python
>>> gi = pygeoip.GeoIP('/path/to/GeoIPASNum.dat')
>>> gi.asn_by_name('cnn.com')
'AS5662 Turner Broadcasting'
Documentation
-------------
For more information, `check out the full API
documentation <http://packages.python.org/pygeoip>`__.
.. toctree::
:maxdepth: 1
Supported Databases
-------------------
getting-started
supported-databases
api-reference
+----------------+--------+--------+-----------------------------------------------------------------------------------+
| Type | IPv4 | IPv6 | Details |
+================+========+========+===================================================================================+
| Country | ✓ | ✓ | `MaxMind Country product page <http://www.maxmind.com/en/country>`__ |
+----------------+--------+--------+-----------------------------------------------------------------------------------+
| City | ✓ | ✓ | `MaxMind City product page <http://www.maxmind.com/en/city>`__ |
+----------------+--------+--------+-----------------------------------------------------------------------------------+
| Organization | ✓ | | `MaxMind Organization product page <http://www.maxmind.com/en/organization>`__ |
+----------------+--------+--------+-----------------------------------------------------------------------------------+
| ISP | ✓ | | `MaxMind ISP product page <http://www.maxmind.com/en/isp>`__ |
+----------------+--------+--------+-----------------------------------------------------------------------------------+
| Region | ✓ | | `MaxMind Region product page <http://www.maxmind.com/en/geolocation_landing>`__ |
+----------------+--------+--------+-----------------------------------------------------------------------------------+
| ASN | ✓ | ✓ | `MaxMind ASN product page <http://dev.maxmind.com/geoip/legacy/geolite>`__ |
+----------------+--------+--------+-----------------------------------------------------------------------------------+
| Netspeed | ✓ | | `MaxMind Netspeed product page <http://www.maxmind.com/en/netspeed>`__ |
+----------------+--------+--------+-----------------------------------------------------------------------------------+
For more information, `check out the documentation <http://pygeoip.readthedocs.org/>`__ over at Read the Docs.
.. |Build Status| image:: https://api.travis-ci.org/appliedsec/pygeoip.png?branch=master
:target: https://travis-ci.org/appliedsec/pygeoip
:target: https://travis-ci.org/appliedsec/pygeoip
.. |Coverage Status| image:: https://coveralls.io/repos/appliedsec/pygeoip/badge.png
:target: https://coveralls.io/r/appliedsec/pygeoip
:target: https://coveralls.io/r/appliedsec/pygeoip
.. |Downloads| image:: https://pypip.in/d/pygeoip/badge.png
:target: https://crate.io/packages/pygeoip
:target: https://crate.io/packages/pygeoip
pygeoip pygeoip-module.html
pygeoip.ENCODING pygeoip-module.html#ENCODING
pygeoip.time_zone_by_country_and_region pygeoip.timezone-module.html#time_zone_by_country_and_region
pygeoip.__package__ pygeoip-module.html#__package__
pygeoip.STANDARD pygeoip-module.html#STANDARD
pygeoip.MMAP_CACHE pygeoip-module.html#MMAP_CACHE
pygeoip.MEMORY_CACHE pygeoip-module.html#MEMORY_CACHE
pygeoip.const pygeoip.const-module.html
pygeoip.const.GEOIP_STANDARD pygeoip.const-module.html#GEOIP_STANDARD
pygeoip.const.ENCODING pygeoip.const-module.html#ENCODING
pygeoip.const.COUNTRY_CODES3 pygeoip.const-module.html#COUNTRY_CODES3
pygeoip.const.PY3 pygeoip.const-module.html#PY3
pygeoip.const.IPV6_EDITIONS pygeoip.const-module.html#IPV6_EDITIONS
pygeoip.const.ORG_EDITION pygeoip.const-module.html#ORG_EDITION
pygeoip.const.CITY_EDITION_REV1_V6 pygeoip.const-module.html#CITY_EDITION_REV1_V6
pygeoip.const.CONTINENT_NAMES pygeoip.const-module.html#CONTINENT_NAMES
pygeoip.const.STRUCTURE_INFO_MAX_SIZE pygeoip.const-module.html#STRUCTURE_INFO_MAX_SIZE
pygeoip.const.COUNTRY_NAMES pygeoip.const-module.html#COUNTRY_NAMES
pygeoip.const.REGION_EDITION_REV0 pygeoip.const-module.html#REGION_EDITION_REV0
pygeoip.const.REGION_EDITION_REV1 pygeoip.const-module.html#REGION_EDITION_REV1
pygeoip.const.CANADA_OFFSET pygeoip.const-module.html#CANADA_OFFSET
pygeoip.const.MAX_ORG_RECORD_LENGTH pygeoip.const-module.html#MAX_ORG_RECORD_LENGTH
pygeoip.const.CITY_EDITIONS pygeoip.const-module.html#CITY_EDITIONS
pygeoip.const.__package__ pygeoip.const-module.html#__package__
pygeoip.const.ASNUM_EDITION pygeoip.const-module.html#ASNUM_EDITION
pygeoip.const.CITY_EDITION_REV0 pygeoip.const-module.html#CITY_EDITION_REV0
pygeoip.const.STATE_BEGIN_REV1 pygeoip.const-module.html#STATE_BEGIN_REV1
pygeoip.const.STATE_BEGIN_REV0 pygeoip.const-module.html#STATE_BEGIN_REV0
pygeoip.const.FULL_RECORD_LENGTH pygeoip.const-module.html#FULL_RECORD_LENGTH
pygeoip.const.COUNTRY_EDITION_V6 pygeoip.const-module.html#COUNTRY_EDITION_V6
pygeoip.const.ISP_EDITION pygeoip.const-module.html#ISP_EDITION
pygeoip.const.NETSPEED_EDITION pygeoip.const-module.html#NETSPEED_EDITION
pygeoip.const.PY2 pygeoip.const-module.html#PY2
pygeoip.const.WORLD_OFFSET pygeoip.const-module.html#WORLD_OFFSET
pygeoip.const.CITY_EDITION_REV1 pygeoip.const-module.html#CITY_EDITION_REV1
pygeoip.const.DATABASE_INFO_MAX_SIZE pygeoip.const-module.html#DATABASE_INFO_MAX_SIZE
pygeoip.const.ASNUM_EDITION_V6 pygeoip.const-module.html#ASNUM_EDITION_V6
pygeoip.const.ORG_RECORD_LENGTH pygeoip.const-module.html#ORG_RECORD_LENGTH
pygeoip.const.COUNTRY_BEGIN pygeoip.const-module.html#COUNTRY_BEGIN
pygeoip.const.PROXY_EDITION pygeoip.const-module.html#PROXY_EDITION
pygeoip.const.STANDARD pygeoip.const-module.html#STANDARD
pygeoip.const.REGION_EDITIONS pygeoip.const-module.html#REGION_EDITIONS
pygeoip.const.FIPS_RANGE pygeoip.const-module.html#FIPS_RANGE
pygeoip.const.SEGMENT_RECORD_LENGTH pygeoip.const-module.html#SEGMENT_RECORD_LENGTH
pygeoip.const.COUNTRY_EDITION pygeoip.const-module.html#COUNTRY_EDITION
pygeoip.const.US_OFFSET pygeoip.const-module.html#US_OFFSET
pygeoip.const.STANDARD_RECORD_LENGTH pygeoip.const-module.html#STANDARD_RECORD_LENGTH
pygeoip.const.MMAP_CACHE pygeoip.const-module.html#MMAP_CACHE
pygeoip.const.DMA_MAP pygeoip.const-module.html#DMA_MAP
pygeoip.const.COUNTRY_CODES pygeoip.const-module.html#COUNTRY_CODES
pygeoip.const.GEOIP_MEMORY_CACHE pygeoip.const-module.html#GEOIP_MEMORY_CACHE
pygeoip.const.REGION_CITY_EDITIONS pygeoip.const-module.html#REGION_CITY_EDITIONS
pygeoip.const.MEMORY_CACHE pygeoip.const-module.html#MEMORY_CACHE
pygeoip.const.MAX_RECORD_LENGTH pygeoip.const-module.html#MAX_RECORD_LENGTH
pygeoip.timezone pygeoip.timezone-module.html
pygeoip.timezone.country_dict pygeoip.timezone-module.html#country_dict
pygeoip.timezone.time_zone_by_country_and_region pygeoip.timezone-module.html#time_zone_by_country_and_region
pygeoip.timezone.__package__ pygeoip.timezone-module.html#__package__
pygeoip.util pygeoip.util-module.html
pygeoip.util.ip2long pygeoip.util-module.html#ip2long
pygeoip.util.__package__ pygeoip.util-module.html#__package__
pygeoip.GeoIP pygeoip.GeoIP-class.html
pygeoip.GeoIP.country_code_by_addr pygeoip.GeoIP-class.html#country_code_by_addr
pygeoip.GeoIP.__metaclass__ pygeoip._GeoIPMetaclass-class.html
pygeoip.GeoIP.record_by_name pygeoip.GeoIP-class.html#record_by_name
pygeoip.GeoIP._setup_segments pygeoip.GeoIP-class.html#_setup_segments
pygeoip.GeoIP._seek_country pygeoip.GeoIP-class.html#_seek_country
pygeoip.GeoIP.region_by_name pygeoip.GeoIP-class.html#region_by_name
pygeoip.GeoIP.__init__ pygeoip.GeoIP-class.html#__init__
pygeoip.GeoIP.time_zone_by_name pygeoip.GeoIP-class.html#time_zone_by_name
pygeoip.GeoIP._get_region pygeoip.GeoIP-class.html#_get_region
pygeoip.GeoIP.country_code_by_name pygeoip.GeoIP-class.html#country_code_by_name
pygeoip.GeoIP._get_org pygeoip.GeoIP-class.html#_get_org
pygeoip.GeoIP._str_to_fp pygeoip.GeoIP-class.html#_str_to_fp
pygeoip.GeoIP.last_netmask pygeoip.GeoIP-class.html#last_netmask
pygeoip.GeoIP.time_zone_by_addr pygeoip.GeoIP-class.html#time_zone_by_addr
pygeoip.GeoIP._id_by_addr pygeoip.GeoIP-class.html#_id_by_addr
pygeoip.GeoIP._get_record pygeoip.GeoIP-class.html#_get_record
pygeoip.GeoIP.org_by_addr pygeoip.GeoIP-class.html#org_by_addr
pygeoip.GeoIP.region_by_addr pygeoip.GeoIP-class.html#region_by_addr
pygeoip.GeoIP.record_by_addr pygeoip.GeoIP-class.html#record_by_addr
pygeoip.GeoIP._gethostbyname pygeoip.GeoIP-class.html#_gethostbyname
pygeoip.GeoIP.country_name_by_addr pygeoip.GeoIP-class.html#country_name_by_addr
pygeoip.GeoIP.org_by_name pygeoip.GeoIP-class.html#org_by_name
pygeoip.GeoIP.country_name_by_name pygeoip.GeoIP-class.html#country_name_by_name
pygeoip.GeoIPError pygeoip.GeoIPError-class.html
pygeoip._GeoIPMetaclass pygeoip._GeoIPMetaclass-class.html
pygeoip._GeoIPMetaclass._instances pygeoip._GeoIPMetaclass-class.html#_instances
pygeoip._GeoIPMetaclass.__call__ pygeoip._GeoIPMetaclass-class.html#__call__
pygeoip._GeoIPMetaclass._instance_lock pygeoip._GeoIPMetaclass-class.html#_instance_lock
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Class Hierarchy</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="pygeoip-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th bgcolor="#70b0f0" class="navbar-select"
>&nbsp;&nbsp;&nbsp;Trees&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="https://github.com/appliedsec/pygeoip">pygeoip</a></th>
</tr></table></th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="100%">&nbsp;</td>
<td>
<table cellpadding="0" cellspacing="0">
<!-- hide/show private -->
<tr><td align="right"><span class="options"
>[<a href="frames.html" target="_top">frames</a
>]&nbsp;|&nbsp;<a href="class-tree.html"
target="_top">no&nbsp;frames</a>]</span></td></tr>
</table>
</td>
</tr>
</table>
<center><b>
[ <a href="module-tree.html">Module Hierarchy</a>
| <a href="class-tree.html">Class Hierarchy</a> ]
</b></center><br />
<h1 class="epydoc">Class Hierarchy</h1>
<ul class="nomargin-top">
<li> <strong class="uidlink">object</strong>:
<em class="summary">The most base type</em>
<ul>
<li> <strong class="uidlink">exceptions.BaseException</strong>:
<em class="summary">Common base class for all exceptions</em>
<ul>
<li> <strong class="uidlink">exceptions.Exception</strong>:
<em class="summary">Common base class for all non-exit exceptions.</em>
<ul>
<li> <strong class="uidlink"><a href="pygeoip.GeoIPError-class.html">pygeoip.GeoIPError</a></strong>
</li>
</ul>
</li>
</ul>
</li>
<li> <strong class="uidlink"><a href="pygeoip.GeoIP-class.html">pygeoip.GeoIP</a></strong>
</li>
<li> <strong class="uidlink">type</strong>:
<em class="summary">type(object) -&gt; the object's type type(name, bases, dict) -&gt;
a new type</em>
<ul>
<li> <strong class="uidlink"><a href="pygeoip._GeoIPMetaclass-class.html" onclick="show_private();">pygeoip._GeoIPMetaclass</a></strong>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="pygeoip-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th bgcolor="#70b0f0" class="navbar-select"
>&nbsp;&nbsp;&nbsp;Trees&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="https://github.com/appliedsec/pygeoip">pygeoip</a></th>
</tr></table></th>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
>http://epydoc.sourceforge.net</a>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie();
// -->
</script>
</body>
</html>
apidocs/html/crarr.png

340 Bytes

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title> pygeoip </title>
</head>
<frameset cols="20%,80%">
<frameset rows="30%,70%">
<frame src="toc.html" name="moduleListFrame"
id="moduleListFrame" />
<frame src="toc-everything.html" name="moduleFrame"
id="moduleFrame" />
</frameset>
<frame src="pygeoip-module.html" name="mainFrame" id="mainFrame" />
</frameset>
</html>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title> pygeoip </title>
</head>
<frameset cols="20%,80%">
<frameset rows="30%,70%">
<frame src="toc.html" name="moduleListFrame"
id="moduleListFrame" />
<frame src="toc-everything.html" name="moduleFrame"
id="moduleFrame" />
</frameset>
<frame src="pygeoip-module.html" name="mainFrame" id="mainFrame" />
</frameset>
</html>
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Module Hierarchy</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="pygeoip-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th bgcolor="#70b0f0" class="navbar-select"
>&nbsp;&nbsp;&nbsp;Trees&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="https://github.com/appliedsec/pygeoip">pygeoip</a></th>
</tr></table></th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="100%">&nbsp;</td>
<td>
<table cellpadding="0" cellspacing="0">
<!-- hide/show private -->
<tr><td align="right"><span class="options"
>[<a href="frames.html" target="_top">frames</a
>]&nbsp;|&nbsp;<a href="module-tree.html"
target="_top">no&nbsp;frames</a>]</span></td></tr>
</table>
</td>
</tr>
</table>
<center><b>
[ <a href="module-tree.html">Module Hierarchy</a>
| <a href="class-tree.html">Class Hierarchy</a> ]
</b></center><br />
<h1 class="epydoc">Module Hierarchy</h1>
<ul class="nomargin-top">
<li> <strong class="uidlink"><a href="pygeoip-module.html">pygeoip</a></strong>: <em class="summary">Pure Python GeoIP API</em>
<ul>
<li> <strong class="uidlink"><a href="pygeoip.const-module.html">pygeoip.const</a></strong>: <em class="summary">Constants for the database parser</em> </li>
<li> <strong class="uidlink"><a href="pygeoip.timezone-module.html">pygeoip.timezone</a></strong>: <em class="summary">Time zone data and lookup function</em> </li>
<li> <strong class="uidlink"><a href="pygeoip.util-module.html">pygeoip.util</a></strong>: <em class="summary">Utility function for address translation</em> </li>
</ul>
</li>
</ul>
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="pygeoip-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th bgcolor="#70b0f0" class="navbar-select"
>&nbsp;&nbsp;&nbsp;Trees&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="https://github.com/appliedsec/pygeoip">pygeoip</a></th>
</tr></table></th>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
>http://epydoc.sourceforge.net</a>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie();
// -->
</script>
</body>
</html>
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>pygeoip</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th bgcolor="#70b0f0" class="navbar-select"
>&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="https://github.com/appliedsec/pygeoip">pygeoip</a></th>
</tr></table></th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="100%">
<span class="breadcrumbs">
Package&nbsp;pygeoip
</span>
</td>
<td>
<table cellpadding="0" cellspacing="0">
<!-- hide/show private -->
<tr><td align="right"><span class="options"
>[<a href="frames.html" target="_top">frames</a
>]&nbsp;|&nbsp;<a href="pygeoip-module.html"
target="_top">no&nbsp;frames</a>]</span></td></tr>
</table>
</td>
</tr>
</table>
<!-- ==================== PACKAGE DESCRIPTION ==================== -->
<h1 class="epydoc">Package pygeoip</h1><p class="nomargin-top"><span class="codelink"><a href="pygeoip-pysrc.html">source&nbsp;code</a></span></p>
<p>Pure Python GeoIP API</p>
<hr />
<div class="fields"> <dl><dt>Authors:</dt>
<dd>
Jennifer Ennis &lt;zaylea@gmail.com&gt;,
William Tis&#228;ter &lt;william@defunct.cc&gt;
</dd>
</dl>
<p><strong>License:</strong>
Copyright(C) 2004 MaxMind LLC
<p>This program is free software: you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.</p>
<p>This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.</p>
<p>You should have received a copy of the GNU Lesser General Public
License along with this program. If not, see
&lt;http://www.gnu.org/licenses/lgpl.txt&gt;.</p>
</p>
</div><!-- ==================== SUBMODULES ==================== -->
<a name="section-Submodules"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td align="left" colspan="2" class="table-header">
<span class="table-header">Submodules</span></td>
</tr>
<tr><td class="summary">
<ul class="nomargin">
<li> <strong class="uidlink"><a href="pygeoip.const-module.html">pygeoip.const</a></strong>: <em class="summary">Constants for the database parser</em> </li>
<li> <strong class="uidlink"><a href="pygeoip.timezone-module.html">pygeoip.timezone</a></strong>: <em class="summary">Time zone data and lookup function</em> </li>
<li> <strong class="uidlink"><a href="pygeoip.util-module.html">pygeoip.util</a></strong>: <em class="summary">Utility function for address translation</em> </li>
</ul></td></tr>
</table>
<br />
<!-- ==================== CLASSES ==================== -->
<a name="section-Classes"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td align="left" colspan="2" class="table-header">
<span class="table-header">Classes</span></td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<a href="pygeoip.GeoIPError-class.html" class="summary-name">GeoIPError</a>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<a href="pygeoip.GeoIP-class.html" class="summary-name">GeoIP</a>
</td>
</tr>
</table>
<!-- ==================== VARIABLES ==================== -->
<a name="section-Variables"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td align="left" colspan="2" class="table-header">
<span class="table-header">Variables</span></td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<a name="STANDARD"></a><span class="summary-name">STANDARD</span> = <code title="0">0</code>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<a name="MMAP_CACHE"></a><span class="summary-name">MMAP_CACHE</span> = <code title="8">8</code>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<a name="MEMORY_CACHE"></a><span class="summary-name">MEMORY_CACHE</span> = <code title="1">1</code>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<a name="ENCODING"></a><span class="summary-name">ENCODING</span> = <code title="'iso-8859-1'"><code class="variable-quote">'</code><code class="variable-string">iso-8859-1</code><code class="variable-quote">'</code></code>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<a name="__package__"></a><span class="summary-name">__package__</span> = <code title="'pygeoip'"><code class="variable-quote">'</code><code class="variable-string">pygeoip</code><code class="variable-quote">'</code></code>
</td>
</tr>
</table>
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th bgcolor="#70b0f0" class="navbar-select"
>&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="https://github.com/appliedsec/pygeoip">pygeoip</a></th>
</tr></table></th>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
>http://epydoc.sourceforge.net</a>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie();
// -->
</script>
</body>
</html>
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>pygeoip.GeoIPError</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="pygeoip-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="https://github.com/appliedsec/pygeoip">pygeoip</a></th>
</tr></table></th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="100%">
<span class="breadcrumbs">
<a href="pygeoip-module.html">Package&nbsp;pygeoip</a> ::
Class&nbsp;GeoIPError
</span>
</td>
<td>
<table cellpadding="0" cellspacing="0">
<!-- hide/show private -->
<tr><td align="right"><span class="options"
>[<a href="frames.html" target="_top">frames</a
>]&nbsp;|&nbsp;<a href="pygeoip.GeoIPError-class.html"
target="_top">no&nbsp;frames</a>]</span></td></tr>
</table>
</td>
</tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class GeoIPError</h1><p class="nomargin-top"><span class="codelink"><a href="pygeoip-pysrc.html#GeoIPError">source&nbsp;code</a></span></p>
<pre class="base-tree">
object --+
|
exceptions.BaseException --+
|
exceptions.Exception --+
|
<strong class="uidshort">GeoIPError</strong>
</pre>
<hr />
<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td align="left" colspan="2" class="table-header">
<span class="table-header">Instance Methods</span></td>
</tr>
<tr>
<td colspan="2" class="summary">
<p class="indent-wrapped-lines"><b>Inherited from <code>exceptions.Exception</code></b>:
<code>__init__</code>,
<code>__new__</code>
</p>
<p class="indent-wrapped-lines"><b>Inherited from <code>exceptions.BaseException</code></b>:
<code>__delattr__</code>,
<code>__getattribute__</code>,
<code>__getitem__</code>,
<code>__getslice__</code>,
<code>__reduce__</code>,
<code>__repr__</code>,
<code>__setattr__</code>,
<code>__setstate__</code>,
<code>__str__</code>,
<code>__unicode__</code>
</p>
<p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
<code>__format__</code>,
<code>__hash__</code>,
<code>__reduce_ex__</code>,
<code>__sizeof__</code>,
<code>__subclasshook__</code>
</p>
</td>
</tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td align="left" colspan="2" class="table-header">
<span class="table-header">Properties</span></td>
</tr>
<tr>
<td colspan="2" class="summary">
<p class="indent-wrapped-lines"><b>Inherited from <code>exceptions.BaseException</code></b>:
<code>args</code>,
<code>message</code>
</p>
<p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
<code>__class__</code>
</p>
</td>
</tr>
</table>
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="pygeoip-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="https://github.com/appliedsec/pygeoip">pygeoip</a></th>
</tr></table></th>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
>http://epydoc.sourceforge.net</a>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie();
// -->
</script>
</body>
</html>
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>pygeoip._GeoIPMetaclass</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="pygeoip-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="https://github.com/appliedsec/pygeoip">pygeoip</a></th>
</tr></table></th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="100%">
<span class="breadcrumbs">
<a href="pygeoip-module.html">Package&nbsp;pygeoip</a> ::
Class&nbsp;_GeoIPMetaclass
</span>
</td>
<td>
<table cellpadding="0" cellspacing="0">
<!-- hide/show private -->
<tr><td align="right"><span class="options"
>[<a href="frames.html" target="_top">frames</a
>]&nbsp;|&nbsp;<a href="pygeoip._GeoIPMetaclass-class.html"
target="_top">no&nbsp;frames</a>]</span></td></tr>
</table>
</td>
</tr>
</table>
<!-- ==================== TYPE DESCRIPTION ==================== -->
<h1 class="epydoc">Type _GeoIPMetaclass</h1><p class="nomargin-top"><span class="codelink"><a href="pygeoip-pysrc.html#_GeoIPMetaclass">source&nbsp;code</a></span></p>
<pre class="base-tree">
object --+
|
type --+
|
<strong class="uidshort">_GeoIPMetaclass</strong>
</pre>
<hr />
<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td align="left" colspan="2" class="table-header">
<span class="table-header">Instance Methods</span></td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="pygeoip._GeoIPMetaclass-class.html#__call__" class="summary-sig-name">__call__</a>(<span class="summary-sig-arg">cls</span>,
<span class="summary-sig-arg">*args</span>,
<span class="summary-sig-arg">**kwargs</span>)</span><br />
Singleton method to gets an instance without reparsing the database,
the filename is being used as cache key.</td>
<td align="right" valign="top">
<span class="codelink"><a href="pygeoip-pysrc.html#_GeoIPMetaclass.__call__">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2" class="summary">
<p class="indent-wrapped-lines"><b>Inherited from <code>type</code></b>:
<code>__delattr__</code>,
<code>__eq__</code>,
<code>__ge__</code>,
<code>__getattribute__</code>,
<code>__gt__</code>,
<code>__hash__</code>,
<code>__init__</code>,
<code>__instancecheck__</code>,
<code>__le__</code>,
<code>__lt__</code>,
<code>__ne__</code>,
<code>__new__</code>,
<code>__repr__</code>,
<code>__setattr__</code>,
<code>__subclasscheck__</code>,
<code>__subclasses__</code>,
<code>mro</code>
</p>
<p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
<code>__format__</code>,
<code>__reduce__</code>,
<code>__reduce_ex__</code>,
<code>__sizeof__</code>,
<code>__str__</code>,
<code>__subclasshook__</code>
</p>
</td>
</tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td align="left" colspan="2" class="table-header">
<span class="table-header">Properties</span></td>
</tr>
<tr>
<td colspan="2" class="summary">
<p class="indent-wrapped-lines"><b>Inherited from <code>type</code></b>:
<code>__abstractmethods__</code>,
<code>__base__</code>,
<code>__bases__</code>,
<code>__basicsize__</code>,
<code>__dictoffset__</code>,
<code>__flags__</code>,
<code>__itemsize__</code>,
<code>__mro__</code>,
<code>__name__</code>,
<code>__weakrefoffset__</code>
</p>
<p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
<code>__class__</code>
</p>
</td>
</tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td align="left" colspan="2" class="table-header">
<span class="table-header">Method Details</span></td>
</tr>
</table>
<a name="__call__"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">__call__</span>(<span class="sig-arg">cls</span>,
<span class="sig-arg">*args</span>,
<span class="sig-arg">**kwargs</span>)</span>
<br /><em class="fname">(Call operator)</em>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="pygeoip-pysrc.html#_GeoIPMetaclass.__call__">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>Singleton method to gets an instance without reparsing the database,
the filename is being used as cache key.</p>
<dl class="fields">
<dt>Overrides:
type.__call__
</dt>
</dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="pygeoip-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="https://github.com/appliedsec/pygeoip">pygeoip</a></th>
</tr></table></th>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
>http://epydoc.sourceforge.net</a>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie();
// -->
</script>
</body>
</html>
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>pygeoip.util</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="pygeoip-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="https://github.com/appliedsec/pygeoip">pygeoip</a></th>
</tr></table></th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="100%">
<span class="breadcrumbs">
<a href="pygeoip-module.html">Package&nbsp;pygeoip</a> ::
Module&nbsp;util
</span>
</td>
<td>
<table cellpadding="0" cellspacing="0">
<!-- hide/show private -->
<tr><td align="right"><span class="options"
>[<a href="frames.html" target="_top">frames</a
>]&nbsp;|&nbsp;<a href="pygeoip.util-module.html"
target="_top">no&nbsp;frames</a>]</span></td></tr>
</table>
</td>
</tr>
</table>
<!-- ==================== MODULE DESCRIPTION ==================== -->
<h1 class="epydoc">Module util</h1><p class="nomargin-top"><span class="codelink"><a href="pygeoip.util-pysrc.html">source&nbsp;code</a></span></p>
<p>Utility function for address translation</p>
<hr />
<div class="fields"> <dl><dt>Authors:</dt>
<dd>
Jennifer Ennis &lt;zaylea@gmail.com&gt;,
William Tis&#228;ter &lt;william@defunct.cc&gt;
</dd>
</dl>
<p><strong>License:</strong>
Copyright(C) 2004 MaxMind LLC
<p>This program is free software: you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.</p>
<p>This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.</p>
<p>You should have received a copy of the GNU Lesser General Public
License along with this program. If not, see
&lt;http://www.gnu.org/licenses/lgpl.txt&gt;.</p>
</p>
</div><!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td align="left" colspan="2" class="table-header">
<span class="table-header">Functions</span></td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="pygeoip.util-module.html#ip2long" class="summary-sig-name">ip2long</a>(<span class="summary-sig-arg">ip</span>)</span><br />
Wrapper function for IPv4 and IPv6 converters</td>
<td align="right" valign="top">
<span class="codelink"><a href="pygeoip.util-pysrc.html#ip2long">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- ==================== VARIABLES ==================== -->
<a name="section-Variables"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td align="left" colspan="2" class="table-header">
<span class="table-header">Variables</span></td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<a name="__package__"></a><span class="summary-name">__package__</span> = <code title="'pygeoip'"><code class="variable-quote">'</code><code class="variable-string">pygeoip</code><code class="variable-quote">'</code></code>
</td>
</tr>
</table>
<!-- ==================== FUNCTION DETAILS ==================== -->
<a name="section-FunctionDetails"></a>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td align="left" colspan="2" class="table-header">
<span class="table-header">Function Details</span></td>
</tr>
</table>
<a name="ip2long"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">ip2long</span>(<span class="sig-arg">ip</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="pygeoip.util-pysrc.html#ip2long">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>Wrapper function for IPv4 and IPv6 converters</p>
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
<li><strong class="pname"><code>ip</code></strong> (str) - IPv4 or IPv6 address</li>
</ul></dd>
</dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="pygeoip-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="https://github.com/appliedsec/pygeoip">pygeoip</a></th>
</tr></table></th>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
>http://epydoc.sourceforge.net</a>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie();
// -->
</script>
</body>
</html>
<html><head><title>Epydoc Redirect Page</title>
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="pragma" content="no-cache" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body>
<script type="text/javascript">
<!--
var pages = ["pygeoip._GeoIPMetaclass-c", "pygeoip.GeoIPError-c", "pygeoip.timezone-m", "pygeoip.const-m", "pygeoip.GeoIP-c", "pygeoip.util-m", "pygeoip-m"];
var dottedName = get_anchor();
if (dottedName) {
var target = redirect_url(dottedName);
if (target) window.location.replace(target);
}
// -->
</script>
<h3>Epydoc Auto-redirect page</h3>
<p>When javascript is enabled, this page will redirect URLs of
the form <tt>redirect.html#<i>dotted.name</i></tt> to the
documentation for the object with the given fully-qualified
dotted name.</p>
<p><a id="message"> &nbsp; </a></p>
<script type="text/javascript">
<!--
if (dottedName) {
var msg = document.getElementById("message");
msg.innerHTML = "No documentation found for <tt>"+
dottedName+"</tt>";
}
// -->
</script>
</body>
</html>
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Everything</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<h1 class="toc">Everything</h1>
<hr />
<h2 class="toc">All Classes</h2>
<a target="mainFrame" href="pygeoip.GeoIP-class.html"
>pygeoip.GeoIP</a><br /> <a target="mainFrame" href="pygeoip.GeoIPError-class.html"
>pygeoip.GeoIPError</a><br /> <h2 class="toc">All Functions</h2>
<a target="mainFrame" href="pygeoip.timezone-module.html#time_zone_by_country_and_region"
>pygeoip.timezone.time_zone_by_country_and_region</a><br /> <a target="mainFrame" href="pygeoip.util-module.html#ip2long"
>pygeoip.util.ip2long</a><br /> <h2 class="toc">All Variables</h2>
<a target="mainFrame" href="pygeoip-module.html#ENCODING"
>pygeoip.ENCODING</a><br /> <a target="mainFrame" href="pygeoip-module.html#MEMORY_CACHE"
>pygeoip.MEMORY_CACHE</a><br /> <a target="mainFrame" href="pygeoip-module.html#MMAP_CACHE"
>pygeoip.MMAP_CACHE</a><br /> <a target="mainFrame" href="pygeoip-module.html#STANDARD"
>pygeoip.STANDARD</a><br /> <a target="mainFrame" href="pygeoip-module.html#__package__"
>pygeoip.__package__</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#ASNUM_EDITION"
>pygeoip.const.ASNUM_EDITION</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#ASNUM_EDITION_V6"
>pygeoip.const.ASNUM_EDITION_V6</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#CANADA_OFFSET"
>pygeoip.const.CANADA_OFFSET</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#CITY_EDITIONS"
>pygeoip.const.CITY_EDITIONS</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#CITY_EDITION_REV0"
>pygeoip.const.CITY_EDITION_REV0</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#CITY_EDITION_REV1"
>pygeoip.const.CITY_EDITION_REV1</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#CITY_EDITION_REV1_V6"
>pygeoip.const.CITY_EDITION_REV1_V6</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#CONTINENT_NAMES"
>pygeoip.const.CONTINENT_NAMES</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#COUNTRY_BEGIN"
>pygeoip.const.COUNTRY_BEGIN</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#COUNTRY_CODES"
>pygeoip.const.COUNTRY_CODES</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#COUNTRY_CODES3"
>pygeoip.const.COUNTRY_CODES3</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#COUNTRY_EDITION"
>pygeoip.const.COUNTRY_EDITION</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#COUNTRY_EDITION_V6"
>pygeoip.const.COUNTRY_EDITION_V6</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#COUNTRY_NAMES"
>pygeoip.const.COUNTRY_NAMES</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#DATABASE_INFO_MAX_SIZE"
>pygeoip.const.DATABASE_INFO_MAX_SIZE</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#DMA_MAP"
>pygeoip.const.DMA_MAP</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#ENCODING"
>pygeoip.const.ENCODING</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#FIPS_RANGE"
>pygeoip.const.FIPS_RANGE</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#FULL_RECORD_LENGTH"
>pygeoip.const.FULL_RECORD_LENGTH</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#GEOIP_MEMORY_CACHE"
>pygeoip.const.GEOIP_MEMORY_CACHE</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#GEOIP_STANDARD"
>pygeoip.const.GEOIP_STANDARD</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#IPV6_EDITIONS"
>pygeoip.const.IPV6_EDITIONS</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#ISP_EDITION"
>pygeoip.const.ISP_EDITION</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#MAX_ORG_RECORD_LENGTH"
>pygeoip.const.MAX_ORG_RECORD_LENGTH</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#MAX_RECORD_LENGTH"
>pygeoip.const.MAX_RECORD_LENGTH</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#MEMORY_CACHE"
>pygeoip.const.MEMORY_CACHE</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#MMAP_CACHE"
>pygeoip.const.MMAP_CACHE</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#NETSPEED_EDITION"
>pygeoip.const.NETSPEED_EDITION</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#ORG_EDITION"
>pygeoip.const.ORG_EDITION</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#ORG_RECORD_LENGTH"
>pygeoip.const.ORG_RECORD_LENGTH</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#PROXY_EDITION"
>pygeoip.const.PROXY_EDITION</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#PY2"
>pygeoip.const.PY2</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#PY3"
>pygeoip.const.PY3</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#REGION_CITY_EDITIONS"
>pygeoip.const.REGION_CITY_EDITIONS</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#REGION_EDITIONS"
>pygeoip.const.REGION_EDITIONS</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#REGION_EDITION_REV0"
>pygeoip.const.REGION_EDITION_REV0</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#REGION_EDITION_REV1"
>pygeoip.const.REGION_EDITION_REV1</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#SEGMENT_RECORD_LENGTH"
>pygeoip.const.SEGMENT_RECORD_LENGTH</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#STANDARD"
>pygeoip.const.STANDARD</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#STANDARD_RECORD_LENGTH"
>pygeoip.const.STANDARD_RECORD_LENGTH</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#STATE_BEGIN_REV0"
>pygeoip.const.STATE_BEGIN_REV0</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#STATE_BEGIN_REV1"
>pygeoip.const.STATE_BEGIN_REV1</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#STRUCTURE_INFO_MAX_SIZE"
>pygeoip.const.STRUCTURE_INFO_MAX_SIZE</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#US_OFFSET"
>pygeoip.const.US_OFFSET</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#WORLD_OFFSET"
>pygeoip.const.WORLD_OFFSET</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#__package__"
>pygeoip.const.__package__</a><br /> <a target="mainFrame" href="pygeoip.timezone-module.html#__package__"
>pygeoip.timezone.__package__</a><br /> <a target="mainFrame" href="pygeoip.timezone-module.html#country_dict"
>pygeoip.timezone.country_dict</a><br /> <a target="mainFrame" href="pygeoip.util-module.html#__package__"
>pygeoip.util.__package__</a><br /><hr />
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie();
// -->
</script>
</body>
</html>
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>pygeoip</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<h1 class="toc">Module pygeoip</h1>
<hr />
<h2 class="toc">Classes</h2>
<a target="mainFrame" href="pygeoip.GeoIP-class.html"
>GeoIP</a><br /> <a target="mainFrame" href="pygeoip.GeoIPError-class.html"
>GeoIPError</a><br /> <h2 class="toc">Variables</h2>
<a target="mainFrame" href="pygeoip-module.html#ENCODING"
>ENCODING</a><br /> <a target="mainFrame" href="pygeoip-module.html#MEMORY_CACHE"
>MEMORY_CACHE</a><br /> <a target="mainFrame" href="pygeoip-module.html#MMAP_CACHE"
>MMAP_CACHE</a><br /> <a target="mainFrame" href="pygeoip-module.html#STANDARD"
>STANDARD</a><br /> <a target="mainFrame" href="pygeoip-module.html#__package__"
>__package__</a><br /><hr />
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie();
// -->
</script>
</body>
</html>
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>const</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<h1 class="toc">Module const</h1>
<hr />
<h2 class="toc">Variables</h2>
<a target="mainFrame" href="pygeoip.const-module.html#ASNUM_EDITION"
>ASNUM_EDITION</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#ASNUM_EDITION_V6"
>ASNUM_EDITION_V6</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#CANADA_OFFSET"
>CANADA_OFFSET</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#CITY_EDITIONS"
>CITY_EDITIONS</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#CITY_EDITION_REV0"
>CITY_EDITION_REV0</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#CITY_EDITION_REV1"
>CITY_EDITION_REV1</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#CITY_EDITION_REV1_V6"
>CITY_EDITION_REV1_V6</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#CONTINENT_NAMES"
>CONTINENT_NAMES</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#COUNTRY_BEGIN"
>COUNTRY_BEGIN</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#COUNTRY_CODES"
>COUNTRY_CODES</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#COUNTRY_CODES3"
>COUNTRY_CODES3</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#COUNTRY_EDITION"
>COUNTRY_EDITION</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#COUNTRY_EDITION_V6"
>COUNTRY_EDITION_V6</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#COUNTRY_NAMES"
>COUNTRY_NAMES</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#DATABASE_INFO_MAX_SIZE"
>DATABASE_INFO_MAX_SIZE</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#DMA_MAP"
>DMA_MAP</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#ENCODING"
>ENCODING</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#FIPS_RANGE"
>FIPS_RANGE</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#FULL_RECORD_LENGTH"
>FULL_RECORD_LENGTH</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#GEOIP_MEMORY_CACHE"
>GEOIP_MEMORY_CACHE</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#GEOIP_STANDARD"
>GEOIP_STANDARD</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#IPV6_EDITIONS"
>IPV6_EDITIONS</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#ISP_EDITION"
>ISP_EDITION</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#MAX_ORG_RECORD_LENGTH"
>MAX_ORG_RECORD_LENGTH</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#MAX_RECORD_LENGTH"
>MAX_RECORD_LENGTH</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#MEMORY_CACHE"
>MEMORY_CACHE</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#MMAP_CACHE"
>MMAP_CACHE</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#NETSPEED_EDITION"
>NETSPEED_EDITION</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#ORG_EDITION"
>ORG_EDITION</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#ORG_RECORD_LENGTH"
>ORG_RECORD_LENGTH</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#PROXY_EDITION"
>PROXY_EDITION</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#PY2"
>PY2</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#PY3"
>PY3</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#REGION_CITY_EDITIONS"
>REGION_CITY_EDITIONS</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#REGION_EDITIONS"
>REGION_EDITIONS</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#REGION_EDITION_REV0"
>REGION_EDITION_REV0</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#REGION_EDITION_REV1"
>REGION_EDITION_REV1</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#SEGMENT_RECORD_LENGTH"
>SEGMENT_RECORD_LENGTH</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#STANDARD"
>STANDARD</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#STANDARD_RECORD_LENGTH"
>STANDARD_RECORD_LENGTH</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#STATE_BEGIN_REV0"
>STATE_BEGIN_REV0</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#STATE_BEGIN_REV1"
>STATE_BEGIN_REV1</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#STRUCTURE_INFO_MAX_SIZE"
>STRUCTURE_INFO_MAX_SIZE</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#US_OFFSET"
>US_OFFSET</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#WORLD_OFFSET"
>WORLD_OFFSET</a><br /> <a target="mainFrame" href="pygeoip.const-module.html#__package__"
>__package__</a><br /><hr />
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie();
// -->
</script>
</body>
</html>
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>timezone</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<h1 class="toc">Module timezone</h1>
<hr />
<h2 class="toc">Functions</h2>
<a target="mainFrame" href="pygeoip.timezone-module.html#time_zone_by_country_and_region"
>time_zone_by_country_and_region</a><br /> <h2 class="toc">Variables</h2>
<a target="mainFrame" href="pygeoip.timezone-module.html#__package__"
>__package__</a><br /> <a target="mainFrame" href="pygeoip.timezone-module.html#country_dict"
>country_dict</a><br /><hr />
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie();
// -->
</script>
</body>
</html>
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>util</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<h1 class="toc">Module util</h1>
<hr />
<h2 class="toc">Functions</h2>
<a target="mainFrame" href="pygeoip.util-module.html#ip2long"
>ip2long</a><br /> <h2 class="toc">Variables</h2>
<a target="mainFrame" href="pygeoip.util-module.html#__package__"
>__package__</a><br /><hr />
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie();
// -->
</script>
</body>
</html>
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Table of Contents</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<h1 class="toc">Table&nbsp;of&nbsp;Contents</h1>
<hr />
<a target="moduleFrame" href="toc-everything.html">Everything</a>
<br />
<h2 class="toc">Modules</h2>
<a target="moduleFrame" href="toc-pygeoip-module.html"
onclick="setFrame('toc-pygeoip-module.html','pygeoip-module.html');" >pygeoip</a><br /> <a target="moduleFrame" href="toc-pygeoip.const-module.html"
onclick="setFrame('toc-pygeoip.const-module.html','pygeoip.const-module.html');" >pygeoip.const</a><br /> <a target="moduleFrame" href="toc-pygeoip.timezone-module.html"
onclick="setFrame('toc-pygeoip.timezone-module.html','pygeoip.timezone-module.html');" >pygeoip.timezone</a><br /> <a target="moduleFrame" href="toc-pygeoip.util-module.html"
onclick="setFrame('toc-pygeoip.util-module.html','pygeoip.util-module.html');" >pygeoip.util</a><br /><hr />
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie();
// -->
</script>
</body>
</html>
#!/bin/bash
function warning { echo "Warning: $1"; }
function error { echo "Error: $1" 1>&2; exit 1; }
pushd $(dirname $0)
if [ -z "$(virtualenv --version)" ]; then
error "Missing virtualenv binary"
fi
if [ ! -d venv ]; then
virtualenv venv || error "virtualenv failed"
venv/bin/pip install tox nose epydoc || error "pip failed"
fi
if [ ! -d tests/data ]; then
pushd tests
wget https://www.defunct.cc/maxmind-geoip-samples.tar.gz
tar -zxvf maxmind-geoip-samples.tar.gz
unlink maxmind-geoip-samples.tar.gz
popd
fi
venv/bin/tox || error "tox failed"
venv/bin/epydoc --config=epydoc.ini --no-private || error "epydoc failed"
perl -pi -e 's/Generated by Epydoc (\d+\.\d+\.\d+) .*/Generated by Epydoc $1/' apidocs/html/*.html
if [ -z "$(pandoc --version)" ]; then
warning "Skipping Markdown to reStructuredText translation"
else
pandoc -f markdown -t rst -o README.rst README.md || error "pandoc failed"
fi
popd
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
clean:
rm -rf $(BUILDDIR)/*
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/pygeoip.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/pygeoip.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/pygeoip"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/pygeoip"
@echo "# devhelp"
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
latexpdfja:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
xml:
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
@echo
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
API Reference
=============
.. currentmodule:: pygeoip
GeoIP
-----
.. autoclass:: GeoIP
:members: __init__, country_code_by_addr, country_code_by_name, country_name_by_addr, country_name_by_name, org_by_addr, org_by_name, record_by_addr, record_by_name, region_by_addr, region_by_name, time_zone_by_addr, time_zone_by_name, netspeed_by_addr, netspeed_by_name, id_by_addr, last_netmask
GeoIPError
----------
.. autoexception:: GeoIPError
# -*- coding: utf-8 -*-
#
# pygeoip documentation build configuration file, created by
# sphinx-quickstart on Thu Nov 14 10:52:22 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys
import os
from datetime import date
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.join('..'))
import pygeoip
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'pygeoip'
copyright = u'%s, Jennifer Ennis, William Tisäter' % date.today().year
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = pygeoip.__version__
# The full version, including alpha/beta/rc tags.
release = pygeoip.__version__
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']
# The reST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False
# -- Options for HTML output ----------------------------------------------
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if not on_rtd:
import sphinx_rtd_theme
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = "sphinx_rtd_theme"
# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
#html_extra_path = []
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'pygeoipdoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'pygeoip.tex', u'pygeoip Documentation',
u'Jennifer Ennis, William Tisäter', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_domain_indices = True
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'pygeoip', u'pygeoip Documentation',
[u'Jennifer Ennis, William Tisäter'], 1)
]
# If true, show URL addresses after external links.
#man_show_urls = False
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'pygeoip', u'pygeoip Documentation',
u'Jennifer Ennis, William Tisäter', 'pygeoip',
'Pure Python API for Maxmind\'s binary GeoIP databases.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
#texinfo_appendices = []
# If false, no module index is generated.
#texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'
# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False
Getting Started
===============
Create your GeoIP instance with appropriate access flag. ``STANDARD``
reads data from disk when needed, ``MEMORY_CACHE`` loads database into
memory on instantiation and ``MMAP_CACHE`` loads database into memory
using mmap.
.. code:: python
>>> import pygeoip
>>> gi = pygeoip.GeoIP('GeoIP.dat')
>>> gi.country_name_by_addr('64.233.161.99')
'United States'
Country Lookup
--------------
.. code:: python
>>> gi = pygeoip.GeoIP('GeoIP.dat')
>>> gi.country_code_by_name('google.com')
'US'
>>> gi.country_code_by_addr('64.233.161.99')
'US'
>>> gi.country_name_by_addr('64.233.161.99')
'United States'
.. code:: python
>>> gi = pygeoip.GeoIP('GeoIPv6.dat')
>>> gi.country_code_by_addr('2a00:1450:400f:802::1006')
'IE'
Region Lookup
-------------
.. code:: python
>>> gi = pygeoip.GeoIP('GeoIPRegion.dat')
>>> gi.region_by_name('apple.com')
{'region_code': 'CA', 'country_code': 'US'}
City Lookup
-----------
.. code:: python
>>> gi = pygeoip.GeoIP('GeoIPCity.dat')
>>> gi.record_by_addr('64.233.161.99')
{
'city': u'Mountain View',
'region_code': u'CA',
'area_code': 650,
'time_zone': 'America/Los_Angeles',
'dma_code': 807,
'metro_code': 'San Francisco, CA',
'country_code3': 'USA',
'latitude': 37.41919999999999,
'postal_code': u'94043',
'longitude': -122.0574,
'country_code': 'US',
'country_name': 'United States',
'continent': 'NA'
}
>>> gi.time_zone_by_addr('64.233.161.99')
'America/Los_Angeles'
Organization Lookup
-------------------
.. code:: python
>>> gi = pygeoip.GeoIP('GeoIPOrg.dat')
>>> gi.org_by_name('dell.com')
'Dell Computer Corporation'
ISP Lookup
----------
.. code:: python
>>> gi = pygeoip.GeoIP('GeoIPISP.dat')
>>> gi.isp_by_name('cnn.com')
'Turner Broadcasting System'
ASN Lookup
----------
.. code:: python
>>> gi = pygeoip.GeoIP('GeoIPASNum.dat')
>>> gi.asn_by_name('cnn.com')
'AS5662 Turner Broadcasting'
../README.rst
\ No newline at end of file
Supported Databases
===================
+----------------+------+------+-----------------------------------------------------------------------------------+
| Type | IPv4 | IPv6 | Details |
+================+======+======+===================================================================================+
| Country | Yes | Yes | `MaxMind Country product page <http://www.maxmind.com/en/country>`__ |
+----------------+------+------+-----------------------------------------------------------------------------------+
| City | Yes | Yes | `MaxMind City product page <http://www.maxmind.com/en/city>`__ |
+----------------+------+------+-----------------------------------------------------------------------------------+
| Organization | Yes | | `MaxMind Organization product page <http://www.maxmind.com/en/organization>`__ |
+----------------+------+------+-----------------------------------------------------------------------------------+
| ISP | Yes | | `MaxMind ISP product page <http://www.maxmind.com/en/isp>`__ |
+----------------+------+------+-----------------------------------------------------------------------------------+
| Region | Yes | | `MaxMind Region product page <http://www.maxmind.com/en/geolocation_landing>`__ |
+----------------+------+------+-----------------------------------------------------------------------------------+
| ASN | Yes | Yes | `MaxMind ASN product page <http://dev.maxmind.com/geoip/legacy/geolite>`__ |
+----------------+------+------+-----------------------------------------------------------------------------------+
| Netspeed | Yes | | `MaxMind Netspeed product page <http://www.maxmind.com/en/netspeed>`__ |
+----------------+------+------+-----------------------------------------------------------------------------------+
\ No newline at end of file
[epydoc]
name: pygeoip
url: https://github.com/appliedsec/pygeoip
modules: pygeoip
output: html
target: apidocs/html/
# -*- coding: utf-8 -*-
"""
Constants for the database parser
@author: Jennifer Ennis <zaylea@gmail.com>
@author: William Tisäter <william@defunct.cc>
@license: Copyright(C) 2004 MaxMind LLC
Copyright (c) 2010-2014 Jennifer Ennis, William Tisäter.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
......
# -*- coding: utf-8 -*-
"""
Time zone data and lookup function
@author: Jennifer Ennis <zaylea@gmail.com>
@author: William Tisäter <william@defunct.cc>
@license: Copyright(C) 2004 MaxMind LLC
Copyright (c) 2010-2014 Jennifer Ennis, William Tisäter.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
......@@ -21,17 +16,12 @@ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/lgpl.txt>.
"""
def time_zone_by_country_and_region(country_code, region_code=None):
"""
Get time zone from country code and region code.
Returns time zone from country and region code.
@param country_code: Country code
@type country_code: str
@param region_code: Region code
@type region_code: str
@return: Time zone
@rtype: str
:arg country_code: Country code
:arg region_code: Region code
"""
timezone = country_dict.get(country_code)
if not timezone:
......
# -*- coding: utf-8 -*-
"""
Utility function for address translation
@author: Jennifer Ennis <zaylea@gmail.com>
@author: William Tisäter <william@defunct.cc>
@license: Copyright(C) 2004 MaxMind LLC
Copyright (c) 2010-2014 Jennifer Ennis, William Tisäter.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
......@@ -34,9 +29,9 @@ from pygeoip import const
def ip2long(ip):
"""
Wrapper function for IPv4 and IPv6 converters
@param ip: IPv4 or IPv6 address
@type ip: str
Wrapper function for IPv4 and IPv6 converters.
:arg ip: IPv4 or IPv6 address
"""
try:
return int(binascii.hexlify(socket.inet_aton(ip)), 16)
......@@ -46,11 +41,8 @@ def ip2long(ip):
def str2fp(data):
"""
Convert bytes data to file handle object
Convert bytes data to file handle object (StringIO or BytesIO).
@param data: string data
@type data: str
@return: file handle object
@rtype: StringIO or BytesIO
:arg data: String data to transform
"""
return BytesIO(bytearray(data, const.ENCODING)) if const.PY3 else StringIO(data)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Setup file for pygeoip package.
@author: Jennifer Ennis <zaylea at gmail dot com>
@license:
Copyright(C) 2004 MaxMind LLC
Copyright (c) 2010-2014 Jennifer Ennis, William Tisäter.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment