Hello community,
here is the log from the commit of package python-python-whois for
openSUSE:Factory checked in at 2019-05-13 14:49:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-python-whois (Old)
and /work/SRC/openSUSE:Factory/.python-python-whois.new.5148 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-python-whois"
Mon May 13 14:49:22 2019 rev:4 rq:701015 version:0.7.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-python-whois/python-python-whois.changes
2018-12-24 11:42:46.613378449 +0100
+++
/work/SRC/openSUSE:Factory/.python-python-whois.new.5148/python-python-whois.changes
2019-05-13 14:49:24.794618428 +0200
@@ -1,0 +2,6 @@
+Fri May 3 18:03:51 UTC 2019 - Sebastian Wagner <[email protected]>
+
+- update to version 0.7.1:
+ * no changelog available
+
+-------------------------------------------------------------------
Old:
----
python-whois-0.7.0.tar.gz
New:
----
python-whois-0.7.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-python-whois.spec ++++++
--- /var/tmp/diff_new_pack.I75lNs/_old 2019-05-13 14:49:25.582620414 +0200
+++ /var/tmp/diff_new_pack.I75lNs/_new 2019-05-13 14:49:25.590620434 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-python-whois
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-python-whois
-Version: 0.7.0
+Version: 0.7.1
Release: 0
Summary: Whois querying and parsing of domain registration information
License: MIT
++++++ python-whois-0.7.0.tar.gz -> python-whois-0.7.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-whois-0.7.0/PKG-INFO
new/python-whois-0.7.1/PKG-INFO
--- old/python-whois-0.7.0/PKG-INFO 2018-04-24 17:32:19.000000000 +0200
+++ new/python-whois-0.7.1/PKG-INFO 2018-12-06 20:20:47.000000000 +0100
@@ -1,12 +1,123 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
Name: python-whois
-Version: 0.7.0
+Version: 0.7.1
Summary: Whois querying and parsing of domain registration information.
Home-page: https://bitbucket.org/richardpenman/pywhois
Author: Richard Penman
Author-email: [email protected]
License: MIT
-Description: UNKNOWN
+Description: Goal
+ ====
+
+ - Create a simple importable Python module which will produce parsed
+ WHOIS data for a given domain.
+ - Able to extract data for all the popular TLDs (com, org, net, ...)
+ - Query a WHOIS server directly instead of going through an
+ intermediate web service like many others do.
+ - Works with Python 2 & 3
+
+
+
+ Example
+ =======
+
+ .. sourcecode:: python
+
+ >>> import whois
+ >>> w = whois.whois('webscraping.com')
+ >>> w.expiration_date # dates converted to datetime object
+ datetime.datetime(2013, 6, 26, 0, 0)
+ >>> w.text # the content downloaded from whois server
+ u'\nWhois Server Version 2.0\n\nDomain names in the .com and .net
+ ...'
+
+ >>> print w # print values of all found attributes
+ creation_date: 2004-06-26 00:00:00
+ domain_name: [u'WEBSCRAPING.COM', u'WEBSCRAPING.COM']
+ emails: [u'[email protected]',
u'[email protected]']
+ expiration_date: 2013-06-26 00:00:00
+ ...
+
+
+
+ Install
+ =======
+
+ Install from pypi:
+
+ .. sourcecode:: bash
+
+ $ pip install python-whois
+
+ Or checkout latest version from repository:
+
+ .. sourcecode:: bash
+
+ $ hg clone https://bitbucket.org/richardpenman/pywhois
+
+ Note that then you will need to manually install the futures module,
which allows supporting both Python 2 & 3:
+
+
+ .. sourcecode:: bash
+
+ $ pip install futures
+
+ Run test cases for python 2 & 3:
+
+ .. sourcecode:: bash
+
+ $ python -m unittest discover test
+ .............
+
----------------------------------------------------------------------
+ Ran 13 tests in 0.812s
+
+ OK
+
+ $ python3 -m unittest discover test
+ .............
+
----------------------------------------------------------------------
+ Ran 13 tests in 1.431s
+
+ OK
+
+ SOCKS Proxy support requirements:
+
+ .. sourcecode:: bash
+
+ $ pip install PySocks
+ ............
+
---------------------------------------------------------------------
+ $ export SOCKS=socksproxy.someplace.com:8080
+
+
+ Problems?
+ =========
+
+ Pull requests are welcome!
+
+ Thanks to the many who have sent patches for additional TLDs. If you
want to add or fix a TLD it's quite straightforward.
+ See example domains in `whois/parser.py
<https://bitbucket.org/richardpenman/pywhois/src/tip/whois/parser.py?at=default&fileviewer=file-view-default>`_
+
+ Basically each TLD has a similar format to the following:
+
+ .. sourcecode:: python
+
+ class WhoisOrg(WhoisEntry):
+ """Whois parser for .org domains
+ """
+ regex = {
+ 'domain_name': 'Domain Name: *(.+)',
+ 'registrar': 'Registrar: *(.+)',
+ 'whois_server': 'Whois Server: *(.+)',
+ ...
+ }
+
+ def __init__(self, domain, text):
+ if text.strip() == 'NOT FOUND':
+ raise PywhoisError(text)
+ else:
+ WhoisEntry.__init__(self, domain, text)
+
Keywords: whois,python
Platform: UNKNOWN
Classifier: Environment :: Web Environment
@@ -17,3 +128,4 @@
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
+Provides-Extra: better date conversion
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-whois-0.7.0/README.rst
new/python-whois-0.7.1/README.rst
--- old/python-whois-0.7.0/README.rst 2017-12-01 22:46:32.000000000 +0100
+++ new/python-whois-0.7.1/README.rst 2018-12-06 19:16:00.000000000 +0100
@@ -72,6 +72,15 @@
OK
+SOCKS Proxy support requirements:
+
+.. sourcecode:: bash
+
+ $ pip install PySocks
+ ............
+ ---------------------------------------------------------------------
+ $ export SOCKS=socksproxy.someplace.com:8080
+
Problems?
=========
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-whois-0.7.0/python_whois.egg-info/PKG-INFO
new/python-whois-0.7.1/python_whois.egg-info/PKG-INFO
--- old/python-whois-0.7.0/python_whois.egg-info/PKG-INFO 2018-04-24
17:32:18.000000000 +0200
+++ new/python-whois-0.7.1/python_whois.egg-info/PKG-INFO 2018-12-06
20:20:47.000000000 +0100
@@ -1,12 +1,123 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
Name: python-whois
-Version: 0.7.0
+Version: 0.7.1
Summary: Whois querying and parsing of domain registration information.
Home-page: https://bitbucket.org/richardpenman/pywhois
Author: Richard Penman
Author-email: [email protected]
License: MIT
-Description: UNKNOWN
+Description: Goal
+ ====
+
+ - Create a simple importable Python module which will produce parsed
+ WHOIS data for a given domain.
+ - Able to extract data for all the popular TLDs (com, org, net, ...)
+ - Query a WHOIS server directly instead of going through an
+ intermediate web service like many others do.
+ - Works with Python 2 & 3
+
+
+
+ Example
+ =======
+
+ .. sourcecode:: python
+
+ >>> import whois
+ >>> w = whois.whois('webscraping.com')
+ >>> w.expiration_date # dates converted to datetime object
+ datetime.datetime(2013, 6, 26, 0, 0)
+ >>> w.text # the content downloaded from whois server
+ u'\nWhois Server Version 2.0\n\nDomain names in the .com and .net
+ ...'
+
+ >>> print w # print values of all found attributes
+ creation_date: 2004-06-26 00:00:00
+ domain_name: [u'WEBSCRAPING.COM', u'WEBSCRAPING.COM']
+ emails: [u'[email protected]',
u'[email protected]']
+ expiration_date: 2013-06-26 00:00:00
+ ...
+
+
+
+ Install
+ =======
+
+ Install from pypi:
+
+ .. sourcecode:: bash
+
+ $ pip install python-whois
+
+ Or checkout latest version from repository:
+
+ .. sourcecode:: bash
+
+ $ hg clone https://bitbucket.org/richardpenman/pywhois
+
+ Note that then you will need to manually install the futures module,
which allows supporting both Python 2 & 3:
+
+
+ .. sourcecode:: bash
+
+ $ pip install futures
+
+ Run test cases for python 2 & 3:
+
+ .. sourcecode:: bash
+
+ $ python -m unittest discover test
+ .............
+
----------------------------------------------------------------------
+ Ran 13 tests in 0.812s
+
+ OK
+
+ $ python3 -m unittest discover test
+ .............
+
----------------------------------------------------------------------
+ Ran 13 tests in 1.431s
+
+ OK
+
+ SOCKS Proxy support requirements:
+
+ .. sourcecode:: bash
+
+ $ pip install PySocks
+ ............
+
---------------------------------------------------------------------
+ $ export SOCKS=socksproxy.someplace.com:8080
+
+
+ Problems?
+ =========
+
+ Pull requests are welcome!
+
+ Thanks to the many who have sent patches for additional TLDs. If you
want to add or fix a TLD it's quite straightforward.
+ See example domains in `whois/parser.py
<https://bitbucket.org/richardpenman/pywhois/src/tip/whois/parser.py?at=default&fileviewer=file-view-default>`_
+
+ Basically each TLD has a similar format to the following:
+
+ .. sourcecode:: python
+
+ class WhoisOrg(WhoisEntry):
+ """Whois parser for .org domains
+ """
+ regex = {
+ 'domain_name': 'Domain Name: *(.+)',
+ 'registrar': 'Registrar: *(.+)',
+ 'whois_server': 'Whois Server: *(.+)',
+ ...
+ }
+
+ def __init__(self, domain, text):
+ if text.strip() == 'NOT FOUND':
+ raise PywhoisError(text)
+ else:
+ WhoisEntry.__init__(self, domain, text)
+
Keywords: whois,python
Platform: UNKNOWN
Classifier: Environment :: Web Environment
@@ -17,3 +128,4 @@
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
+Provides-Extra: better date conversion
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-whois-0.7.0/setup.py
new/python-whois-0.7.1/setup.py
--- old/python-whois-0.7.0/setup.py 2018-04-24 17:31:12.000000000 +0200
+++ new/python-whois-0.7.1/setup.py 2018-12-06 20:20:45.000000000 +0100
@@ -1,13 +1,17 @@
import sys, os
import setuptools
-version = '0.7.0'
+VERSION = '0.7.1'
+
+def read(filename):
+ return open(os.path.join(os.path.dirname(__file__), filename)).read()
+
setuptools.setup(
name='python-whois',
- version=version,
+ version=VERSION,
description="Whois querying and parsing of domain registration
information.",
- long_description='',
+ long_description=read('README.rst'),
install_requires=[
'future',
],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-whois-0.7.0/test/test_parser.py
new/python-whois-0.7.1/test/test_parser.py
--- old/python-whois-0.7.0/test/test_parser.py 2018-03-13 16:48:56.000000000
+0100
+++ new/python-whois-0.7.1/test/test_parser.py 2018-12-06 19:16:00.000000000
+0100
@@ -85,7 +85,10 @@
expected_results = json.load(infil)
# Compare each key
- for key in set(results).union(set(expected_results)):
+ compare_keys = set.union(set(results), set(expected_results))
+ if keys_to_test is not None:
+ compare_keys = compare_keys.intersection(set(keys_to_test))
+ for key in compare_keys:
total += 1
if key not in results:
print("%s \t(%s):\t Missing in results" % (domain, key,))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-whois-0.7.0/whois/__init__.py
new/python-whois-0.7.1/whois/__init__.py
--- old/python-whois-0.7.0/whois/__init__.py 2018-01-23 23:50:40.000000000
+0100
+++ new/python-whois-0.7.1/whois/__init__.py 2018-12-06 20:10:25.000000000
+0100
@@ -27,7 +27,7 @@
except socket.herror as e:
pass
else:
- domain = result[0]
+ domain = extract_domain(result[0])
else:
domain = extract_domain(url)
if command:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-whois-0.7.0/whois/parser.py
new/python-whois-0.7.1/whois/parser.py
--- old/python-whois-0.7.0/whois/parser.py 2018-04-24 17:31:12.000000000
+0200
+++ new/python-whois-0.7.1/whois/parser.py 2018-12-06 19:26:17.000000000
+0100
@@ -207,6 +207,8 @@
return WhoisNl(domain, text)
elif domain.endswith('.fi'):
return WhoisFi(domain, text)
+ elif domain.endswith('.hr'):
+ return WhoisHr(domain, text)
elif domain.endswith('.jp'):
return WhoisJp(domain, text)
elif domain.endswith('.pl'):
@@ -281,6 +283,12 @@
return WhoisLu(domain, text)
elif domain.endswith('.cz'):
return WhoisCz(domain, text)
+ elif domain.endswith('.online'):
+ return WhoisOnline(domain, text)
+ elif domain.endswith('.cn'):
+ return WhoisCn(domain, text)
+ elif domain.endswith('.app'):
+ return WhoisApp(domain, text)
else:
return WhoisEntry(domain, text)
@@ -632,8 +640,6 @@
class WhoisFr(WhoisEntry):
"""Whois parser for .fr domains
"""
- dayfirst = True
-
regex = {
'domain_name': 'domain: *(.+)',
'registrar': 'registrar: *(.+)',
@@ -1048,13 +1054,19 @@
"""Whois parser for .io domains
"""
regex = {
- 'status': 'Status\s*: *(.+)',
- 'name_servers': 'NS \d?\s*: *(.+)',
- #'owner': 'Owner\s*: *(.+)',
- 'owner': 'Owner OrgName\s*: *(.+)',
- 'expiration_date': 'Expiry\s*: *(.+)',
- 'domain_name': 'Domain\s*: *(.+)',
- 'registrar': r'Check for \'[\w\.]*\' --- (.+)',
+ 'domain_name': 'Domain Name: *(.+)',
+ 'domain__id': 'Registry Domain ID: *(.+)',
+ 'registrar': 'Registrar: *(.+)',
+ 'registrar_id': 'Registrar IANA ID: *(.+)',
+ 'registrar_url': 'Registrar URL: *(.+)',
+ 'status': 'Domain Status: *(.+)',
+ 'registrant_name': 'Registrant Organization: *(.+)',
+ 'registrant_state_province': 'Registrant State/Province: *(.+)',
+ 'registrant_country': 'Registrant Country: *(.+)',
+ 'name_servers': 'Name Server: *(.+)',
+ 'creation_date': 'Creation Date: *(.+)',
+ 'expiration_date': 'Registry Expiry Date: *(.+)',
+ 'updated_date': 'Updated Date: *(.+)',
}
def __init__(self, domain, text):
@@ -1263,6 +1275,15 @@
else:
WhoisEntry.__init__(self, domain, text, self.regex)
+ def _preprocess(self, attr, value):
+ if attr == 'name_servers':
+ return [
+ line.split(":")[-1].strip()
+ for line in value.split("\n")
+ if line.startswith("Hostname")
+ ]
+ return super(WhoisDk, self)._preprocess(attr, value)
+
class WhoisAi(WhoisEntry):
"""Whois parser for .ai domains
"""
@@ -1319,9 +1340,9 @@
regex = {
'domain_name': 'Domain Name: *(.+)',
'registrar': 'Registrar: *(.+)',
- 'updated_date': 'Last Updated On: *(.+)',
- 'creation_date': 'Created On: *(.+)',
- 'expiration_date': 'Expiration Date: *(.+)',
+ 'updated_date': 'Updated Date: *(.+)|Last Updated On: *(.+)',
+ 'creation_date': 'Creation Date: *(.+)|Created On: *(.+)',
+ 'expiration_date': 'Expiration Date: *(.+)|Registry Expiry Date:
*(.+)',
'name_servers': 'Name Server: *(.+)',
'status': 'Status: *(.+)',
'emails': EMAIL_REGEX,
@@ -1458,4 +1479,106 @@
raise PywhoisError(text)
else:
WhoisEntry.__init__(self, domain, text, self.regex)
+
+
+class WhoisOnline(WhoisEntry):
+ """Whois parser for .online domains
+ """
+ regex = {
+ 'domain_name': 'Domain Name: *(.+)',
+ 'domain__id': 'Domain ID: *(.+)',
+ 'whois_server': 'Registrar WHOIS Server: *(.+)',
+ 'registrar': 'Registrar: *(.+)',
+ 'registrar_id': 'Registrar IANA ID: *(.+)',
+ 'registrar_url': 'Registrar URL: *(.+)',
+ 'status': 'Domain Status: *(.+)',
+ 'registrant_email': 'Registrant Email: *(.+)',
+ 'admin_email': 'Admin Email: *(.+)',
+ 'billing_email': 'Billing Email: *(.+)',
+ 'tech_email': 'Tech Email: *(.+)',
+ 'name_servers': 'Name Server: *(.+)',
+ 'creation_date': 'Creation Date: *(.+)',
+ 'expiration_date': 'Registry Expiry Date: *(.+)',
+ 'updated_date': 'Updated Date: *(.+)',
+ 'dnssec': 'DNSSEC: *([\S]+)',
+ }
+
+ def __init__(self, domain, text):
+ if 'Not found:' in text:
+ raise PywhoisError(text)
+ else:
+ WhoisEntry.__init__(self, domain, text, self.regex)
+
+
+class WhoisHr(WhoisEntry):
+ """Whois parser for .hr domains
+ """
+ regex = {
+ 'domain_name': 'Domain Name: *(.+)',
+ 'whois_server': 'Registrar WHOIS Server: *(.+)',
+ 'registrar_url': 'Registrar URL: *(.+)',
+ 'updated_date': 'Updated Date: *(.+)',
+ 'creation_date': 'Creation Date: *(.+)',
+ 'expiration_date': 'Registrar Registration Expiration
Date: *(.+)',
+ 'name_servers': 'Name Server: *(.+)'
+ }
+
+ def __init__(self, domain, text):
+ if 'ERROR: No entries found' in text:
+ raise PywhoisError(text)
+ else:
+ WhoisEntry.__init__(self, domain, text, self.regex)
+
+
+class WhoisCn(WhoisEntry):
+ """Whois parser for .cn domains
+ """
+ regex = {
+ 'domain_name': 'Domain Name: *(.+)',
+ 'registrar': 'Registrar: *(.+)',
+ 'creation_date': 'Registration Time: *(.+)',
+ 'expiration_date': 'Expiration Time: *(.+)',
+ 'name_servers': 'Name Server: *(.+)', # list of name servers
+ 'status': 'Status: *(.+)', # list of statuses
+ 'emails': EMAIL_REGEX, # list of email s
+ 'dnssec': 'dnssec: *([\S]+)',
+ }
+
+ def __init__(self, domain, text):
+ if text.strip() == 'No matching record.':
+ raise PywhoisError(text)
+ else:
+ WhoisEntry.__init__(self, domain, text, self.regex)
+
+
+class WhoisApp(WhoisEntry):
+ """Whois parser for .app domains
+ """
+ regex = {
+ 'domain_name': 'Domain Name: *(.+)',
+ 'registrar': 'Registrar: *(.+)',
+ 'whois_server': 'Whois Server: *(.+)',
+ 'updated_date': 'Updated Date: *(.+)',
+ 'creation_date': 'Creation Date: *(.+)',
+ 'expiration_date': 'Expir\w+ Date: *(.+)',
+ 'name_servers': 'Name Server: *(.+)', # list of name servers
+ 'status': 'Status: *(.+)', # list of statuses
+ 'emails': EMAIL_REGEX, # list of email s
+ 'registrant_email': 'Registrant Email: *(.+)', # registrant email
+ 'registrant_phone': 'Registrant Phone: *(.+)', # registrant phone
+ 'dnssec': 'dnssec: *([\S]+)',
+ 'name': 'Registrant Name: *(.+)',
+ 'org': 'Registrant\s*Organization: *(.+)',
+ 'address': 'Registrant Street: *(.+)',
+ 'city': 'Registrant City: *(.+)',
+ 'state': 'Registrant State/Province: *(.+)',
+ 'zipcode': 'Registrant Postal Code: *(.+)',
+ 'country': 'Registrant Country: *(.+)',
+ }
+
+ def __init__(self, domain, text):
+ if text.strip() == 'Domain not found.':
+ raise PywhoisError(text)
+ else:
+ WhoisEntry.__init__(self, domain, text, self.regex)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-whois-0.7.0/whois/whois.py
new/python-whois-0.7.1/whois/whois.py
--- old/python-whois-0.7.0/whois/whois.py 2018-02-14 19:24:39.000000000
+0100
+++ new/python-whois-0.7.1/whois/whois.py 2018-12-06 19:23:00.000000000
+0100
@@ -38,7 +38,7 @@
import sys
import socket
import optparse
-
+import os
class NICClient(object):
@@ -60,6 +60,8 @@
PANDIHOST = "whois.pandi.or.id"
DENICHOST = "de.whois-servers.net"
AI_HOST = "whois.ai"
+ HR_HOST = "whois.dns.hr"
+ APP_HOST = "whois.nic.google"
DEFAULT_PORT = "nicname"
WHOIS_RECURSE = 0x01
@@ -97,7 +99,17 @@
there for contact details
"""
response = b''
- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ if "SOCKS" in os.environ:
+ try:
+ import socks
+ except ImportError as e:
+ print("You need to install the Python socks module. Install
PIP (https://bootstrap.pypa.io/get-pip.py) and then 'pip install PySocks'")
+ raise e
+ socksproxy, port = os.environ["SOCKS"].split(":")
+ s = socks.socksocket()
+ s.set_proxy(socks.SOCKS5, socksproxy, int(port))
+ else:
+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(10)
s.connect((hostname, 43))
@@ -145,6 +157,8 @@
return NICClient.NORIDHOST
if domain.endswith("id"):
return NICClient.PANDIHOST
+ if domain.endswith("hr"):
+ return NICClient.HR_HOST
domain = domain.split('.')
if len(domain) < 2:
@@ -154,6 +168,10 @@
return NICClient.ANICHOST
elif tld == 'ai':
return NICClient.AI_HOST
+ elif tld == 'app':
+ return NICClient.APP_HOST
+ elif tld == 'online':
+ return 'whois.nic.online'
else:
return tld + NICClient.QNICHOST_TAIL