-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated the docs and the setup script to the url of their location
- Loading branch information
1 parent
1cb6fc8
commit 27f66d3
Showing
6 changed files
with
66 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
#!/usr/bin/env python | ||
# cymruwhois.py | ||
# Copyright (C) 2009 Justin Azoff [email protected] | ||
# | ||
# This module is released under the MIT License: | ||
# http://www.opensource.org/licenses/mit-license.php | ||
|
||
import socket | ||
import errno | ||
|
||
|
@@ -145,8 +151,12 @@ def cache(self, r): | |
self.c.set(self.KEY_FMT % r.ip, r, 60*60*6) | ||
|
||
def lookup(self, ip): | ||
"""Look up a single address. This function should not be called in | ||
loop, instead call lookupmany""" | ||
"""Look up a single address. | ||
.. warning:: | ||
Do not call this function inside of a loop, the performance | ||
will be terrible. Instead, call lookupmany or lookupmany_dict | ||
""" | ||
return list(self.lookupmany([ip]))[0] | ||
|
||
def lookupmany(self, ips): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
About | ||
===== | ||
|
||
cymruwhois is a python library for interfacing with the whois.cymru.com service. | ||
|
||
Get it | ||
------ | ||
released versions are available for download at the `Python Package Index <http://pypi.python.org/pypi/cymruwhois/1.0>`_. | ||
|
||
Source | ||
------ | ||
The latest source code is avialable at the `githug project page <http://github.com/JustinAzoff/python-cymruwhois/tree/master>`_. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
API | ||
--- | ||
|
||
.. autoclass:: cymruwhois.Client | ||
:members: lookup,lookupmany,lookupmany_dict | ||
:undoc-members: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Command-line Interface | ||
====================== | ||
The cymruwhois utility program lets you do lookups from the command line or | ||
shell scripts. | ||
|
||
Lookups can be done from stdin or from files:: | ||
|
||
justin@dell ~ % cat /tmp/ips | cymruwhois | ||
15169 66.102.1.104 66.102.0.0/23 US GOOGLE - Google Inc. | ||
22990 169.226.1.110 169.226.0.0/16 US ALBANYEDU - The University at Albany | ||
12306 82.98.86.176 82.98.64.0/18 DE PLUSLINE Plus.Line AG IP-Services | ||
|
||
justin@dell ~ % cymruwhois /tmp/ips | ||
15169 66.102.1.104 66.102.0.0/23 US GOOGLE - Google Inc. | ||
22990 169.226.1.110 169.226.0.0/16 US ALBANYEDU - The University at Albany | ||
12306 82.98.86.176 82.98.64.0/18 DE PLUSLINE Plus.Line AG IP-Services | ||
|
||
|
||
The formatting of contents of the output can be controlled with the -f and -d options:: | ||
|
||
justin@dell ~ % cymruwhois /tmp/ips -f asn,cc | ||
15169 US | ||
22990 US | ||
12306 DE | ||
|
||
justin@dell ~ % cymruwhois /tmp/ips -f asn,cc -d, | ||
15169,US | ||
22990,US | ||
12306,DE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters