Metadata-Version: 1.1
Name: ipwhois
Version: 0.1.7
Summary: IP Whois Resolution and Parsing
Home-page: https://github.com/secynic/ipwhois
Author: Philip Hane
Author-email: secynic AT gmail DOT com
License: Copyright (c) 2013, Philip Hane
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: 

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer. 
2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution. 

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Download-URL: https://github.com/secynic/ipwhois/tarball/master
Description: =======
        ipwhois
        =======
        
        ipwhois is a simple package for retrieving and parsing whois data for IPv4 and IPv6 addresses. This code was quickly thrown together to demonstrate functionality, and is by no means optimized or fully featured. 
        
        This version requires Python 3.3+ (for the ipaddress library) and dnspython3. Other Python version support is planned.
        
        Usage Examples
        ==============
        
        Typical usage::
        
        	>>>> import ipwhois
        	>>>> from pprint import pprint
        	
        	>>>> obj = ipwhois.IPWhois('74.125.225.229')
        	>>>> results = obj.lookup()
        	>>>> pprint(results)
        	
        	{
        	'asn': '15169',
        	'asn_cidr': '74.125.225.0/24',
        	'asn_country_code': 'US',
        	'asn_date': '2007-03-13',
        	'asn_registry': 'arin',
        	'nets': [{'address': '1600 Amphitheatre Parkway',
        	          'cidr': '74.125.0.0/16',
        	          'city': 'Mountain View',
        	          'country': 'US',
        	          'description': 'Google Inc.',
        	          'name': 'GOOGLE',
        	          'postal_code': '94043',
        	          'state': 'CA'}],
        	'query': '74.125.225.229',
        	'raw': None
        	}
        	
        REST (HTTP)::
        
        	>>>> import ipwhois
        	>>>> from pprint import pprint
        	
        	>>>> obj = ipwhois.IPWhois('74.125.225.229')
        	>>>> results = obj.lookup_rws()
        	>>>> pprint(results)
        	
        	{
        	'asn': '15169',
        	'asn_cidr': '74.125.225.0/24',
        	'asn_country_code': 'US',
        	'asn_date': '2007-03-13',
        	'asn_registry': 'arin',
        	'nets': [{'address': '1600 Amphitheatre Parkway',
        	          'cidr': '74.125.0.0/16',
        	          'city': 'Mountain View',
        	          'country': 'US',
        	          'description': 'Google Inc.',
        	          'name': 'GOOGLE',
        	          'postal_code': '94043',
        	          'state': 'CA'}],
        	'query': '74.125.225.229',
        	'raw': None
        	}
        
        Proxy (Optional before ipwhois.IPWhois.lookup_rws())::
        
        	>>>> import ipwhois
        	>>>> ipwhois.set_proxy('192.168.0.1', '80', 'some_username', 'some_password')
        
        Hostname::
        
        	>>>> import ipwhois
        	>>>> from pprint import pprint
        	
        	>>>> obj = ipwhois.IPWhois('74.125.225.229')
        	>>>> results = obj.get_host()
        	>>>> pprint(results)
        	
        	('dfw06s26-in-f5.1e100.net', [], ['74.125.225.229'])
        		
        Countries::
        
        	>>>> import ipwhois
        	
        	>>>> countries = ipwhois.get_countries()
        	>>>> obj = ipwhois.IPWhois('74.125.225.229')
        	>>>> results = obj.lookup(False)
        	>>>> print(countries[results['nets'][0]['country']])
        
        	United States
        
        Installing
        ==========
        
        Latest version from PyPi::
        
        	pip install ipwhois
        
        Latest version from GitHub::
        
        	pip install -e git+https://github.com/secynic/ipwhois@master#egg=ipwhois
        	
        Parsing
        =======
        
        Parsing is currently limited to CIDR, country, name, description, state, city, address, and postal_code fields. This is assuming that those fields are present.
        
        Some IPs have parent networks listed. The parser attempts to recognize this, and break the networks into individual dictionaries. If a single network has multiple CIDRs, they will be separated by ', '.
        
        Sometimes, you will see whois information with multiple consecutive same name fields, e.g., Description: some text\\nDescription: more text. The parser will recognize this and the returned result will have these separated by '\\n'.
        
        REST (HTTP)
        ===========
        
        IPWhois.lookup_rws() should be faster than IPWhois.lookup(), but may not be as reliable. APNIC, LACNIC, and AFRINIC do not have a Whois-RWS service yet. We have to rely on the Ripe RWS service, which does not contain all of the data we need.
        
        Changelog
        =========
        
        0.1.7 (2013-09-16)
        ------------------
        
        - Fixed bug in set_proxy().
        - Removed ARIN top level network entries from return dictionary of IPWhois.lookup_rws().
        - Fixed bug in ARIN RWS parsing when only one network.
        
        0.1.6 (2013-09-16)
        ------------------
        
        - Added IPWhois.get_host() to resolve hostname information.
        - Added address and postal_code fields to parsed results.
        - Normalized single/double quote use.
        
        0.1.5 (2013-09-13)
        ------------------
        
        - Added set_proxy() function for proxy support in Whois-RWS queries.
        - Added IPWhois.lookup_rws() function for Whois-RWS queries.
        
        0.1.4 (2013-09-12)
        ------------------
        
        - Added validity checks for the asn_registry value due to a bug in the Team Cymru ASN lookup over night.
        - Added timeout argument to IPWhois(). This is the default timeout in seconds for socket connections.
        - Fixed decoding issue in IPWhois.get_whois().
        
        0.1.3 (2013-09-11)
        ------------------
        
        - Added exception handling with query retry support for socket errors, timeouts, connection resets.
        - Moved ASN queries to their own functions (IPWhois.get_asn_dns() and IPWhois.get_asn_whois())
        - Moved whois query to its own function (IPWhois.get_whois())
        - Country codes are now forced as upper case in the return dictionary.
        
        0.1.2 (2013-09-10)
        ------------------
        
        - Fixed file path for get_countries().
        - Fixed variable names that conflicted with builtins.
        - Added content to README.
        - Moved CHANGES.txt to CHANGES.rst and added to setup.py.
        - Download URL now points to GitHub master tarball.
        
        0.1.1 (2013-09-09)
        ------------------
        
        - Fixed README issue.
        
        0.1.0 (2013-09-06)
        ------------------
        
        - Initial release.
Keywords: Python,WHOIS,ASN,IP Address,IP,IPv4,IPv6,IETF,REST,Arin,Ripe,Apnic,Lacnic,Afrinic,NIC
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.3
Classifier: Topic :: Internet
Classifier: Topic :: Software Development
