Parses the specified raw WHOIS data. It's useful to call this methid manually if you receive your WHOIS data from elsewhere, and don't need the retrieval capabilities of pythonwhois.
Parses the specified raw WHOIS data. It's useful to call this method manually if you receive your WHOIS data from elsewhere, and don't need the retrieval capabilities of pythonwhois. Returns an object like `pythonwhois.get_whois` does.
raw_data::
raw_data::
A list of raw WHOIS responses to parse. This is the kind of list that `pythonwhois.net.get_whois_raw` outputs.
A list of raw WHOIS responses to parse. This is the kind of list that `pythonwhois.net.get_whois_raw` outputs.
"Registrant Contact Information :[ ]*\n[ ]+(?P<firstname>.*)\n[ ]+(?P<lastname>.*)\n[ ]+(?P<organization>.*)\n[ ]+(?P<email>.*)\n[ ]+(?P<street>.*)\n[ ]+(?P<city>.*)\n[ ]+(?P<postalcode>.*)\n[ ]+(?P<phone>.*)\n[ ]+(?P<fax>.*)\n\n",# GAL Communication
"Contact Information : For Customer # [0-9]+[ ]*\n[ ]+(?P<firstname>.*)\n[ ]+(?P<lastname>.*)\n[ ]+(?P<organization>.*)\n[ ]+(?P<email>.*)\n[ ]+(?P<street>.*)\n[ ]+(?P<city>.*)\n[ ]+(?P<postalcode>.*)\n[ ]+(?P<phone>.*)\n[ ]+(?P<fax>.*)\n\n",# GAL Communication alternative (private WHOIS) format?
"nic-hdl:\s*(?P<handle>.+)\ntype:\s*(?P<type>.+)\ncontact:\s*(?P<name>.+)\n(?:.+\n)*?(?:address:\s*(?P<street1>.+)\naddress:\s*(?P<street2>.+)\naddress:\s*(?P<street3>.+)\naddress:\s*(?P<country>.+)\n)?(?:phone:\s*(?P<phone>.+)\n)?(?:fax-no:\s*(?P<fax>.+)\n)?(?:.+\n)*?(?:e-mail:\s*(?P<email>.+)\n)?(?:.+\n)*?changed:\s*(?P<changedate>[0-9]{2}\/[0-9]{2}\/[0-9]{4}).*\n",# AFNIC madness without country field
"nic-hdl:\s*(?P<handle>.+)\ntype:\s*(?P<type>.+)\ncontact:\s*(?P<name>.+)\n(?:.+\n)*?(?:address:\s*(?P<street1>.+)\naddress:\s*(?P<street2>.+)\naddress:\s*(?P<street3>.+)\naddress:\s*(?P<country>.+)\n)?(?:phone:\s*(?P<phone>.+)\n)?(?:fax-no:\s*(?P<fax>.+)\n)?(?:.+\n)*?(?:e-mail:\s*(?P<email>.+)\n)?(?:.+\n)*?changed:\s*(?P<changedate>[0-9]{2}\/[0-9]{2}\/[0-9]{4}).*\n",# AFNIC madness without country field
"nic-hdl:\s*(?P<handle>.+)\ntype:\s*(?P<type>.+)\ncontact:\s*(?P<name>.+)\n(?:.+\n)*?(?:address:\s*(?P<street1>.+)\n)?(?:address:\s*(?P<street2>.+)\n)?(?:address:\s*(?P<street3>.+)\n)?(?:phone:\s*(?P<phone>.+)\n)?(?:fax-no:\s*(?P<fax>.+)\n)?(?:.+\n)*?(?:e-mail:\s*(?P<email>.+)\n)?(?:.+\n)*?changed:\s*(?P<changedate>[0-9]{2}\/[0-9]{2}\/[0-9]{4}).*\n",# AFNIC madness any country -at all-
"nic-hdl:\s*(?P<handle>.+)\ntype:\s*(?P<type>.+)\ncontact:\s*(?P<name>.+)\n(?:.+\n)*?(?:address:\s*(?P<street1>.+)\n)?(?:address:\s*(?P<street2>.+)\n)?(?:address:\s*(?P<street3>.+)\n)?(?:phone:\s*(?P<phone>.+)\n)?(?:fax-no:\s*(?P<fax>.+)\n)?(?:.+\n)*?(?:e-mail:\s*(?P<email>.+)\n)?(?:.+\n)*?changed:\s*(?P<changedate>[0-9]{2}\/[0-9]{2}\/[0-9]{4}).*\n",# AFNIC madness any country -at all-
"nic-hdl:\s*(?P<handle>.+)\ntype:\s*(?P<type>.+)\ncontact:\s*(?P<name>.+)\n(?:.+\n)*?(?:address:\s*(?P<street1>.+)\n)?(?:address:\s*(?P<street2>.+)\n)?(?:address:\s*(?P<street3>.+)\n)?(?:address:\s*(?P<street4>.+)\n)?country:\s*(?P<country>.+)\n(?:phone:\s*(?P<phone>.+)\n)?(?:fax-no:\s*(?P<fax>.+)\n)?(?:.+\n)*?(?:e-mail:\s*(?P<email>.+)\n)?(?:.+\n)*?changed:\s*(?P<changedate>[0-9]{2}\/[0-9]{2}\/[0-9]{4}).*\n",# AFNIC madness with country field
"nic-hdl:\s*(?P<handle>.+)\ntype:\s*(?P<type>.+)\ncontact:\s*(?P<name>.+)\n(?:.+\n)*?(?:address:\s*(?P<street1>.+)\n)?(?:address:\s*(?P<street2>.+)\n)?(?:address:\s*(?P<street3>.+)\n)?(?:address:\s*(?P<street4>.+)\n)?country:\s*(?P<country>.+)\n(?:phone:\s*(?P<phone>.+)\n)?(?:fax-no:\s*(?P<fax>.+)\n)?(?:.+\n)*?(?:e-mail:\s*(?P<email>.+)\n)?(?:.+\n)*?changed:\s*(?P<changedate>[0-9]{2}\/[0-9]{2}\/[0-9]{4}).*\n",# AFNIC madness with country field
@ -499,6 +554,16 @@ def parse_registrants(data):
]
]
}
}
# Why do the below? The below is meant to handle with an edge case (issue #2) where a partial match followed
# by a failure, for a regex containing the \s*.+ pattern, would send the regex module on a wild goose hunt for
# matching positions. The workaround is to use \S.* instead of .+, but in the interest of keeping the regexes
# consistent and compact, it's more practical to do this (predictable) conversion on runtime.
# FIXME: This breaks on NIC contact regex for nic.at. Why?
{"status": ["registered"], "contacts": {"admin": null, "tech": null, "registrant": null, "billing": null}, "nameservers": ["ns1.us.lt", "ns2.us.lt"], "creation_date": ["2012-08-09T00:00:00"], "raw": ["% Hello, this is the DOMREG whois service.\n%\n% By submitting a query you agree not to use the information made\n% available to:\n% - allow, enable or otherwise support the transmission of unsolicited,\n% commercial advertising or other solicitations whether via email or\n% otherwise;\n% - target advertising in any possible way;\n% - to cause nuisance in any possible way to the registrants by sending\n% (whether by automated, electronic processes capable of enabling\n% high volumes or other possible means) messages to them.\n%\n% Version 0.3\n%\n% For more information please visit http://whois.domreg.lt\n%\nDomain:\t\t\t9v.lt\nStatus:\t\t\tregistered\nRegistered:\t\t2012-08-09\n%\nRegistrar:\t\tUAB \"Interneto vizija\"\nRegistrar website:\thttp://www.iv.lt/\nRegistrar email:\thostmaster@iv.lt\n%\n%\nContact organization:\tUAB \"Interneto vizija\"\nContact email:\t\thostmaster@iv.lt\n%\nNameserver:\t\tns1.us.lt\t\nNameserver:\t\tns2.us.lt\t\n\n"], "registrar": ["UAB \"Interneto vizija\""], "emails": ["hostmaster@iv.lt"]}
{"status": ["DeleteProhibited", "Locked", "RegistrantTransferProhibited"], "nameservers": ["ns.hjs.net", "ns2.hjs.net"], "contacts": {"admin": null, "tech": null, "registrant": null, "billing": null}, "registrar": ["ICI - ROTLD"], "raw": ["\n% Whois Server Version 3.0 - whois.rotld.ro:43\n\n% Rights restricted by copyright.\n% Specifically, this data MAY ONLY be used for Internet operational\n% purposes. It may not be used for targeted advertising or any\n% other purpose.\n\n% Este INTERZISA folosirea datelor de pe acest server in oricare\n% alt scop decat operarea retelei. In special este INTERZISA\n% folosirea lor in scopuri publicitare.\n\n% Top Level Domain : ro\n% Maintainance : www.rotld.ro\n\n Domain Name: b.ro\n Registered On: Before 2001\n Registrar: ICI - ROTLD\n Referral URL: \n\n Nameserver: ns.hjs.net\n Nameserver: ns2.hjs.net\n\n Domain Status: DeleteProhibited\n Domain Status: Locked\n Domain Status: RegistrantTransferProhibited\n\n\n\n"]}
{"status": ["active"], "nameservers": ["ns1.hyves.org", "ns2.hyves.org", "ns3.hyves.org", "ns4.hyves.org"], "raw": ["Domain name: hyves.nl\nStatus: active\n\nRegistrar:\n Domeinbalie.nl\n Osdorper Ban 9A\n 1068LD AMSTERDAM\n Netherlands\n\nDNSSEC: no\n\nDomain nameservers:\n ns1.hyves.org\n ns2.hyves.org\n ns3.hyves.org\n ns4.hyves.org\n\nRecord maintained by: NL Domain Registry\n\nCopyright notice\nNo part of this publication may be reproduced, published, stored in a\nretrieval system, or transmitted, in any form or by any means,\nelectronic, mechanical, recording, or otherwise, without prior\npermission of the Foundation for Internet Domain Registration in the\nNetherlands (SIDN).\nThese restrictions apply equally to registrars, except in that\nreproductions and publications are permitted insofar as they are\nreasonable, necessary and solely in the context of the registration\nactivities referred to in the General Terms and Conditions for .nl\nRegistrars.\nAny use of this material for advertising, targeting commercial offers or\nsimilar activities is explicitly forbidden and liable to result in legal\naction. Anyone who is aware or suspects that such activities are taking\nplace is asked to inform the Foundation for Internet Domain Registration\nin the Netherlands.\n(c) The Foundation for Internet Domain Registration in the Netherlands\n(SIDN) Dutch Copyright Act, protection of authors' rights (Section 10,\nsubsection 1, clause 1).\n\n"], "registrar": ["Domeinbalie.nl", "NL Domain Registry"], "contacts": {"admin": null, "tech": null, "registrant": null, "billing": null}}
{"status": ["Registered"], "contacts": {"admin": null, "tech": null, "registrant": null, "billing": null}, "nameservers": ["ns1.us.lt", "ns2.us.lt"], "creation_date": ["2012-08-09T00:00:00"], "raw": ["% Hello, this is the DOMREG whois service.\n%\n% By submitting a query you agree not to use the information made\n% available to:\n% - allow, enable or otherwise support the transmission of unsolicited,\n% commercial advertising or other solicitations whether via email or\n% otherwise;\n% - target advertising in any possible way;\n% - to cause nuisance in any possible way to the registrants by sending\n% (whether by automated, electronic processes capable of enabling\n% high volumes or other possible means) messages to them.\n%\n% Version 0.3\n%\n% For more information please visit http://whois.domreg.lt\n%\nDomain:\t\t\t9v.lt\nStatus:\t\t\tregistered\nRegistered:\t\t2012-08-09\n%\nRegistrar:\t\tUAB \"Interneto vizija\"\nRegistrar website:\thttp://www.iv.lt/\nRegistrar email:\thostmaster@iv.lt\n%\n%\nContact organization:\tUAB \"Interneto vizija\"\nContact email:\t\thostmaster@iv.lt\n%\nNameserver:\t\tns1.us.lt\t\nNameserver:\t\tns2.us.lt\t\n\n"], "registrar": ["UAB \"Interneto vizija\""], "emails": ["hostmaster@iv.lt"]}
{"status": ["DeleteProhibited", "Locked", "RegistrantTransferProhibited"], "nameservers": ["ns.hjs.net", "ns2.hjs.net"], "contacts": {"admin": null, "tech": null, "registrant": null, "billing": null}, "registrar": ["ICI - Rotld"], "raw": ["\n% Whois Server Version 3.0 - whois.rotld.ro:43\n\n% Rights restricted by copyright.\n% Specifically, this data MAY ONLY be used for Internet operational\n% purposes. It may not be used for targeted advertising or any\n% other purpose.\n\n% Este INTERZISA folosirea datelor de pe acest server in oricare\n% alt scop decat operarea retelei. In special este INTERZISA\n% folosirea lor in scopuri publicitare.\n\n% Top Level Domain : ro\n% Maintainance : www.rotld.ro\n\n Domain Name: b.ro\n Registered On: Before 2001\n Registrar: ICI - ROTLD\n Referral URL: \n\n Nameserver: ns.hjs.net\n Nameserver: ns2.hjs.net\n\n Domain Status: DeleteProhibited\n Domain Status: Locked\n Domain Status: RegistrantTransferProhibited\n\n\n\n"]}
{"status": ["Active"], "nameservers": ["ns1.hyves.org", "ns2.hyves.org", "ns3.hyves.org", "ns4.hyves.org"], "raw": ["Domain name: hyves.nl\nStatus: active\n\nRegistrar:\n Domeinbalie.nl\n Osdorper Ban 9A\n 1068LD AMSTERDAM\n Netherlands\n\nDNSSEC: no\n\nDomain nameservers:\n ns1.hyves.org\n ns2.hyves.org\n ns3.hyves.org\n ns4.hyves.org\n\nRecord maintained by: NL Domain Registry\n\nCopyright notice\nNo part of this publication may be reproduced, published, stored in a\nretrieval system, or transmitted, in any form or by any means,\nelectronic, mechanical, recording, or otherwise, without prior\npermission of the Foundation for Internet Domain Registration in the\nNetherlands (SIDN).\nThese restrictions apply equally to registrars, except in that\nreproductions and publications are permitted insofar as they are\nreasonable, necessary and solely in the context of the registration\nactivities referred to in the General Terms and Conditions for .nl\nRegistrars.\nAny use of this material for advertising, targeting commercial offers or\nsimilar activities is explicitly forbidden and liable to result in legal\naction. Anyone who is aware or suspects that such activities are taking\nplace is asked to inform the Foundation for Internet Domain Registration\nin the Netherlands.\n(c) The Foundation for Internet Domain Registration in the Netherlands\n(SIDN) Dutch Copyright Act, protection of authors' rights (Section 10,\nsubsection 1, clause 1).\n\n"], "registrar": ["Domeinbalie.nl", "NL Domain Registry"], "contacts": {"admin": null, "tech": null, "registrant": null, "billing": null}}