docstring/docs update for asn_alts/allow_permutations deprecation, asn_methods addition (#158)

This commit is contained in:
secynic 2017-03-05 21:21:11 -06:00
parent 3292643400
commit 00d959dc16
8 changed files with 42 additions and 10 deletions

View File

@ -26,6 +26,12 @@ Arguments supported by IPASN.lookup().
| | | attempt if the ASN dns lookup fails. |
| | | Allow permutations must be enabled. |
| | | Defaults to all ['whois', 'http']. |
| | | *WARNING* deprecated in favor of new |
| | | argument asn_methods. |
+------------------------+--------+-------------------------------------------+
| asn_methods | List | Array of ASN lookup types to attempt, in |
| | | order. Defaults to all |
| | | ['dns', 'whois', 'http']. |
+------------------------+--------+-------------------------------------------+
| extra_org_map | List | Dictionary mapping org handles to RIRs. |
| | | This is for limited cases where ARIN REST |

13
CLI.rst
View File

@ -8,7 +8,8 @@ installed to your Python environment Scripts directory.
- ipwhois_cli.py has full ipwhois.py functionality.
- ipwhois_utils_cli.py has full utils.py functionality.
- The others (net.py, rdap.py, whois.py) will be included in a future release.
- The others (net.py, rdap.py, whois.py, nir.py, asn.py) will be included in a
future release.
ipwhois_cli.py
==============
@ -21,8 +22,8 @@ ipwhois_cli.py [-h] [--whois] [--exclude_nir] [--json] [--hr]
[--proxy_http "PROXY_HTTP"]
[--proxy_https "PROXY_HTTPS"] [--disallow_permutations]
[--inc_raw] [--retry_count RETRY_COUNT]
[--asn_alts "ASN_ALTS"] [--extra_org_map "ASN_ALTS"]
[--depth COLOR_DEPTH]
[--asn_alts "ASN_ALTS"] [--asn_methods "ASN_METHODS"]
[--extra_org_map "EXTRA_ORG_MAP"] [--depth COLOR_DEPTH]
[--excluded_entities "EXCLUDED_ENTITIES"] [--bootstrap]
[--rate_limit_timeout RATE_LIMIT_TIMEOUT]
[--get_referral] [--extra_blacklist "EXTRA_BLACKLIST"]
@ -62,7 +63,8 @@ IPWhois settings:
Disable additional methods if DNS lookups to Cymru
fail. This is the opposite of the ipwhois
allow_permutations, in order to enable
allow_permutations by default in the CLI.
allow_permutations by default in the CLI. *WARNING*
deprecated in favor of new argument asn_methods.
Common settings (RDAP & Legacy Whois):
--inc_raw Include the raw whois results in the output.
@ -74,6 +76,9 @@ Common settings (RDAP & Legacy Whois):
attempt if the ASN dns lookup fails. Allow
permutations must be enabled. Defaults to all:
"whois,http"
--asn_methods ASN_METHODS
Array of ASN lookup types to attempt, in order.
Defaults to all ['dns', 'whois', 'http'].
--extra_org_map ASN_ALTS
Dictionary mapping org handles to RIRs. This is for
limited cases where ARIN REST (ASN fallback HTTP

View File

@ -43,7 +43,12 @@ Arguments supported by IPWhois.lookup_rdap().
| asn_alts | List | Array of additional lookup types to attempt if|
| | | the ASN dns lookup fails. Allow permutations |
| | | must be enabled. Defaults to all |
| | | ['whois', 'http']. |
| | | ['whois', 'http']. *WARNING* deprecated in |
| | | favor of new argument asn_methods. |
+--------------------+--------+-----------------------------------------------+
| asn_methods | List | Array of ASN lookup types to attempt, in |
| | | order. Defaults to all |
| | | ['dns', 'whois', 'http']. |
+--------------------+--------+-----------------------------------------------+
| extra_org_map | Dict | Dictionary mapping org handles to RIRs. |
| | | This is for limited cases where ARIN REST |

View File

@ -24,6 +24,11 @@ Summary
ipwhois is a Python package focused on retrieving and parsing whois data
for IPv4 and IPv6 addresses.
.. attention::
The IPWhois argument allow_permutations and the lookup argument asn_alts
have been deprecated in favor of new argument asn_methods.
.. attention::
NIR (National Internet Registry) lookups are enabled by default as of
@ -192,7 +197,9 @@ Input
| | | proxy support or None. |
+--------------------+--------+-----------------------------------------------+
| allow_permutations | Bool | Allow net.Net() to use additional methods if |
| | | DNS lookups to Cymru fail. |
| | | DNS lookups to Cymru fail. *WARNING* |
| | | deprecated in favor of new argument |
| | | asn_methods. |
+--------------------+--------+-----------------------------------------------+
RDAP (HTTP)

View File

@ -54,6 +54,12 @@ Arguments supported by IPWhois.lookup_whois().
| | | attempt if the ASN dns lookup fails. |
| | | Allow permutations must be enabled. |
| | | Defaults to all ['whois', 'http']. |
| | | *WARNING* deprecated in favor of new |
| | | argument asn_methods. |
+------------------------+--------+-------------------------------------------+
| asn_methods | List | Array of ASN lookup types to attempt, in |
| | | order. Defaults to all |
| | | ['dns', 'whois', 'http']. |
+------------------------+--------+-------------------------------------------+
| extra_org_map | Dict | Dictionary mapping org handles to RIRs. |
| | | This is for limited cases where ARIN |

View File

@ -42,7 +42,8 @@ class IPWhois:
proxy_opener: The urllib.request.OpenerDirector request for proxy
support or None.
allow_permutations: allow net.Net() to use additional methods if DNS
lookups to Cymru fail.
lookups to Cymru fail. *WARNING* deprecated in favor of new
argument asn_methods.
"""
def __init__(self, address, timeout=5, proxy_opener=None,

View File

@ -101,7 +101,7 @@ class Net:
proxy_opener: The urllib.request.OpenerDirector request for proxy
support or None.
allow_permutations: Use additional methods if DNS lookups to Cymru
fail.
fail. *WARNING* deprecated in favor of new argument asn_methods.
Raises:
IPDefinedError: The address provided is defined (does not need to be

View File

@ -155,7 +155,8 @@ group.add_argument(
action='store_true',
help='Disable additional methods if DNS lookups to Cymru fail. This is the'
' opposite of the ipwhois allow_permutations, in order to enable '
'allow_permutations by default in the CLI.',
'allow_permutations by default in the CLI. *WARNING* deprecated in '
'favor of new argument asn_methods.',
default=False
)
@ -348,7 +349,8 @@ class IPWhoisCLI:
proxy_https: The urllib.request.ProxyHandler dictionary for proxy
HTTPS support or None.
allow_permutations: allow net.Net() to use additional methods if DNS
lookups to Cymru fail.
lookups to Cymru fail. *WARNING* deprecated in favor of new
argument asn_methods.
"""
def __init__(