[Python-modules-commits] [python-geoip2] 01/07: Import python-geoip2_2.6.0+dfsg1.orig.tar.gz

Ondrej Koblizek kobla-guest at moszumanska.debian.org
Thu Nov 2 09:17:26 UTC 2017


This is an automated email from the git hooks/post-receive script.

kobla-guest pushed a commit to branch master
in repository python-geoip2.

commit abedbf6e35fecad5ab1deaed7417ecb8863063bc
Author: Ondřej Kobližek <ondrej.koblizek at firma.seznam.cz>
Date:   Thu Nov 2 08:24:11 2017 +0100

    Import python-geoip2_2.6.0+dfsg1.orig.tar.gz
---
 HISTORY.rst              |  8 ++++++++
 PKG-INFO                 |  2 +-
 geoip2.egg-info/PKG-INFO |  2 +-
 geoip2/__init__.py       |  2 +-
 geoip2/records.py        | 53 +++++++++++++++++++++++++++++++++++++++++++-----
 setup.cfg                |  1 +
 tests/models_test.py     | 17 ++++++++++++++--
 7 files changed, 75 insertions(+), 10 deletions(-)

diff --git a/HISTORY.rst b/HISTORY.rst
index c45ea6d..1a211f0 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -3,6 +3,14 @@
 History
 -------
 
+2.6.0 (2017-10-27)
+++++++++++++++++++
+
+* The following new anonymizer attributes were added to ``geoip2.record.Traits``
+  for use with GeoIP2 Precision Insights: ``is_anonymous``,
+  ``is_anonymous_vpn``, ``is_hosting_provider``, ``is_public_proxy``, and
+  ``is_tor_exit_node``.
+
 2.5.0 (2017-05-08)
 ++++++++++++++++++
 
diff --git a/PKG-INFO b/PKG-INFO
index af452b3..e9fb23e 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: geoip2
-Version: 2.5.0
+Version: 2.6.0
 Summary: MaxMind GeoIP2 API
 Home-page: http://www.maxmind.com/
 Author: Gregory Oschwald
diff --git a/geoip2.egg-info/PKG-INFO b/geoip2.egg-info/PKG-INFO
index af452b3..e9fb23e 100644
--- a/geoip2.egg-info/PKG-INFO
+++ b/geoip2.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: geoip2
-Version: 2.5.0
+Version: 2.6.0
 Summary: MaxMind GeoIP2 API
 Home-page: http://www.maxmind.com/
 Author: Gregory Oschwald
diff --git a/geoip2/__init__.py b/geoip2/__init__.py
index 3609acd..f7f9854 100644
--- a/geoip2/__init__.py
+++ b/geoip2/__init__.py
@@ -1,7 +1,7 @@
 # pylint:disable=C0111
 
 __title__ = 'geoip2'
-__version__ = '2.5.0'
+__version__ = '2.6.0'
 __author__ = 'Gregory Oschwald'
 __license__ = 'Apache License, Version 2.0'
 __copyright__ = 'Copyright (c) 2013-2017 Maxmind, Inc.'
diff --git a/geoip2/records.py b/geoip2/records.py
index 09a03f3..50b82dc 100644
--- a/geoip2/records.py
+++ b/geoip2/records.py
@@ -517,6 +517,13 @@ class Traits(Record):
 
       :type: unicode
 
+    .. attribute:: is_anonymous
+
+      This is true if the IP address belongs to any sort of anonymous network.
+      This attribute is only available from GeoIP2 Precision Insights.
+
+      :type: bool
+
     .. attribute:: is_anonymous_proxy
 
       This is true if the IP is an anonymous
@@ -530,6 +537,20 @@ class Traits(Record):
         <https://www.maxmind.com/en/geoip2-anonymous-ip-database GeoIP2>`_
         instead.
 
+    .. attribute:: is_anonymous_vpn
+
+      This is true if the IP address belongs to an anonymous VPN system.
+      This attribute is only available from GeoIP2 Precision Insights.
+
+      :type: bool
+
+    .. attribute:: is_hosting_provider
+
+      This is true if the IP address belongs to a hosting provider.
+      This attribute is only available from GeoIP2 Precision Insights.
+
+      :type: bool
+
     .. attribute:: is_legitimate_proxy
 
       This attribute is true if MaxMind believes this IP address to be a
@@ -538,6 +559,13 @@ class Traits(Record):
 
       :type: bool
 
+    .. attribute:: is_public_proxy
+
+      This is true if the IP address belongs to a public proxy. This attribute
+      is only available from GeoIP2 Precision Insights.
+
+      :type: bool
+
     .. attribute:: is_satellite_provider
 
       This is true if the IP address is from a satellite provider that
@@ -551,6 +579,13 @@ class Traits(Record):
         output does not provide sufficiently relevant data for us to maintain
         it.
 
+    .. attribute:: is_tor_exit_node
+
+      This is true if the IP address is a Tor exit node.  This attribute is
+      only available from GeoIP2 Precision Insights.
+
+      :type: bool
+
     .. attribute:: isp
 
       The name of the ISP associated with the IP address. This attribute is
@@ -597,15 +632,23 @@ class Traits(Record):
 
     _valid_attributes = set([
         'autonomous_system_number', 'autonomous_system_organization',
-        'connection_type', 'domain', 'is_anonymous_proxy',
-        'is_legitimate_proxy', 'is_satellite_provider', 'isp', 'ip_address',
-        'organization', 'user_type'
+        'connection_type', 'domain', 'is_anonymous', 'is_anonymous_proxy',
+        'is_anonymous_vpn', 'is_hosting_provider', 'is_legitimate_proxy',
+        'is_public_proxy', 'is_satellite_provider', 'is_tor_exit_node',
+        'is_satellite_provider', 'isp', 'ip_address', 'organization',
+        'user_type'
     ])
 
     def __init__(self, **kwargs):
         for k in [
-                'is_anonymous_proxy', 'is_legitimate_proxy',
-                'is_satellite_provider'
+                'is_anonymous',
+                'is_anonymous_proxy',
+                'is_anonymous_vpn',
+                'is_hosting_provider',
+                'is_legitimate_proxy',
+                'is_public_proxy',
+                'is_satellite_provider',
+                'is_tor_exit_node',
         ]:
             kwargs[k] = bool(kwargs.get(k, False))
         super(Traits, self).__init__(**kwargs)
diff --git a/setup.cfg b/setup.cfg
index 7f2f5e5..0d92335 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -9,4 +9,5 @@ universal = 1
 [egg_info]
 tag_build = 
 tag_date = 0
+tag_svn_revision = 0
 
diff --git a/tests/models_test.py b/tests/models_test.py
index 63843e6..5a84c4b 100644
--- a/tests/models_test.py
+++ b/tests/models_test.py
@@ -90,8 +90,13 @@ class TestModels(unittest.TestCase):
                 'autonomous_system_organization': 'AS Organization',
                 'domain': 'example.com',
                 'ip_address': '1.2.3.4',
-                'is_anonymous_proxy': 0,
-                'is_us_military': 1,
+                'is_anonymous': True,
+                'is_anonymous_proxy': True,
+                'is_anonymous_vpn': True,
+                'is_hosting_provider': True,
+                'is_public_proxy': True,
+                'is_satellite_provider': True,
+                'is_tor_exit_node': True,
                 'isp': 'Comcast',
                 'network_speed': 'cable/DSL',
                 'organization': 'Blorg',
@@ -169,6 +174,14 @@ class TestModels(unittest.TestCase):
                          eval(repr(model.location)),
                          "Location repr can be eval'd")
 
+        self.assertTrue(model.traits.is_anonymous)
+        self.assertTrue(model.traits.is_anonymous_proxy)
+        self.assertTrue(model.traits.is_anonymous_vpn)
+        self.assertTrue(model.traits.is_hosting_provider)
+        self.assertTrue(model.traits.is_public_proxy)
+        self.assertTrue(model.traits.is_satellite_provider)
+        self.assertTrue(model.traits.is_tor_exit_node)
+
     def test_insights_min(self):
         model = geoip2.models.Insights({'traits': {'ip_address': '5.6.7.8'}})
         self.assertEqual(

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-geoip2.git



More information about the Python-modules-commits mailing list