Package: wizard-whois
wizard_whoisThis is a fork of powerfulSven Slootweg's pythonwhoislibrary which unfortunately seems abandoned..Install it with:pip install wizard_whoisOriginal description goes under.wizard_whoisA WHOIS retrieval and parsing library for Python.DependenciesNone! All you need is the Python standard library. Optional RDAP WHOIS based lookups require requests and json libraries.InstructionsThe manual (including install instructions) can be found in the doc/ directory. A HTML version is also viewablehere.Goals100% coverage of WHOIS formats.Accurate and complete data.Consistently functional parsing; constant tests to ensure the parser isn't accidentally broken.FeaturesWHOIS data retrievalAble to follow WHOIS server redirectsWon't get stuck on multiple-result responses from verisign-grsWHOIS data parsingBase information (registrar, etc.)Dates/times (registration, expiry, ...)Full registrant information (!)NameserversOptional WHOIS data normalizationAttempts to intelligently reformat WHOIS data for better (human) readabilityConverts various abbreviation types to full locality namesAirport codesCountry names (2- and 3-letter ISO codes)US states and territoriesCanadian states and territoriesAustralian statespwhois, a simple WHOIS tool using pythonwhoisEasily readable output formatCan also output raw WHOIS data... and JSON.Automated testing suiteWill detect and warn about any changes in parsed data compared to previous runsGuarantees that previously working WHOIS parsing doesn't unintentionally break when changing codeIP range WHOISpythonwhoisdoes not yet support WHOIS lookups on IP ranges (including single IPs), although this will be added at some point in the future. In the meantime, consider usingipwhois- it offers functionality and an API similar topythonwhois, but for IPs. It also supports delegated RWhois.Do note thatipwhoisdoes not offer a normalization feature, and does not (yet) come with a command-line tool. Additionally,ipwhoisis maintained by Philip Hane and not by me; please make sure to file bugs relating to it in theipwhoisrepository, not in that ofpythonwhois.Important update notes2.4.0 and up: A lot of changes were made to the normalization, and the performance under Python 2.x was significantly improved. The average parsing time under Python 2.7 has dropped by 94% (!), and on my system averages out at 18ms. Performance under Python 3.x isunchanged.pythonwhoiswill now expand a lot of abbreviations in normalized mode, such as airport codes, ISO country codes, and US/CA/AU state abbreviations. The consequence of this is that the library is now bigger (as it ships a list of these abbreviations). Also note that theremaybe licensing consequences, in particular regarding the airport code database. More information about that can be found below.2.3.0 and up: Python 3 support was fixed. Creation date parsing for contacts was fixed; correct timestamps will now be returned, rather than unformatted ones - if your application relies on the broken variant, you'll need to change your code. Some additional parameters were added to thenetandparsemethods to facilitate NIC handle lookups; the defaults are backwards-compatible, and these changes should not have any consequences for your code. Thai WHOIS parsing was implemented, but is a little spotty - data may occasionally be incorrectly split up. Please submit a bug report if you run across any issues.2.2.0 and up: The internal workings ofget_whois_rawhave been changed, to better facilitate parsing of WHOIS data from registries that may return multiple partial matches for a query, such aswhois.verisign-grs.com. This change means that, by default,get_whois_rawwill now strip out the part of such a response that does not pertain directly to the requested domain. If your application requires an unmodified raw WHOIS response and is callingget_whois_rawdirectly, you should use the newnever_cutparameter to keep pythonwhois from doing this post-processing. As this is a potentially breaking behaviour change, the minor version has been bumped.It doesn't work!It doesn't work at all?It doesn't parse the data for a particular domain?There's an inaccuracy in parsing the data for a domain, even just a small one?If any of those apply, don't hesitate to file an issue! The goal is 100% coverage, and we need your feedback to reach that goal.LicenseThis library may be used under the WTFPL - or, if you take issue with that, consider it to be under the CC0.Data sourcesThis library uses a number of third-party datasets for normalization:airports.dat:OpenFlights Airports Database(Open Database License 1.0,Database Contents License 1.0)countries.dat:Country List(MIT license)countries3.dat:ISO countries list(license unspecified)states_au.dat: Part ofpythonwhois(WTFPL/CC0)states_us.dat:State Table(license unspecified, free reuse encouraged)states_ca.dat:State Table(license unspecified, free reuse encouraged)Be aware that the OpenFlights database in particular has potential licensing consequences; if you do not wish to be bound by these potential consequences, you may simply delete theairports.datfile from your distribution.pythonwhoiswill assume there is no database available, and will not perform airport code conversion (but still function correctly otherwise). This also applies to other included datasets.ContributingFeel free to fork and submit pull requests (to thedevelopbranch)! If you change any parsing or normalization logic, ensure to run the full test suite before opening a pull request. Instructions for that are below.Please note that this project uses tabs for indentation.All commands are relative to the root directory of the repository.Pull requests that donotinclude output from test.py will be rejected!Adding new WHOIS data to the testing setpwhois --raw thedomain.com > test/data/thedomain.comChecking the currently parsed data (while editing the parser)./pwhois -f test/data/thedomain.com/ .(don't forget the dot at the end!)Marking the current parsed data as correct for a domainMake sure to verify (usingpwhoisor otherwise) that the WHOIS data for the domain is being parsed correctly, before marking it as correct!./test.py update thedomain.comRunning all tests./test.py run allTesting a specific domain./test.py run thedomain.comRunning the full test suite including support for multiple python versionstoxGenerating documentationYou needZippyDoc(which can be installed throughpip install zippydoc).zpy2html doc/*.zpy