|
1 | | -# whois |
2 | | -* A Python package for retrieving WHOIS information of domains. |
3 | | -* This package will not support querying ip CIDR ranges or AS information |
4 | | -* It requires the whois cli component of your os to be installed: e.g. `/usr/bin/whois` on Linux |
5 | | - |
6 | | -## NOTE |
7 | | -* 2023-04-25: mboot |
8 | | - * when DannyCork returns he can decide on the future of this repo. |
9 | | - * in his absence future development will take place in: https://github.com/mboot-github/WhoisDomain |
10 | | - * and new pypi releases will come from: https://pypi.org/project/whoisdomain/ |
11 | | - * efforts will be made to keep the v1.x.y version of whoisdomain compatible with this repo |
12 | | - * changes will be verified and back copied also here for the time being |
13 | | - * starting 2024-02, this repo will be abandon-ware |
14 | | - |
15 | | -## Support |
16 | | - * Python 3.x is supported for x >= 9 |
17 | | - * Python 2.x IS NOT supported. |
| 1 | +# whoisdomain |
18 | 2 |
|
| 3 | + * A Python package for retrieving WHOIS information of DOMAIN'S ONLY. |
| 4 | + * Python 2.x IS NOT supported. |
| 5 | + * Currently no additional python packages need to be installed. |
19 | 6 |
|
20 | | -## Features |
21 | | - * Python wrapper for the "whois" cli command of your operating system. |
22 | | - * Simple interface to access parsed WHOIS data for a given domain. |
23 | | - * Able to extract data for all the popular TLDs (com, org, net, biz, info, pl, jp, uk, nz, ...). |
24 | | - * Query a WHOIS server directly instead of going through an intermediate web service like many others do. |
25 | | - * Works with Python >= 3.9 |
26 | | - * All dates as datetime objects. |
27 | | - * Possibility to cache results. |
28 | | - * Verbose output on stderr during debugging to see how the internal functions are doing their work |
29 | | - * raise a exception on Quota ecceeded type responses |
30 | | - * raise a exception on PrivateRegistry tld's where we know the tld and know we don't know anything |
31 | | - * allow for optional cleaning the whois response before extracting information |
32 | | - * optionally allow IDN's to be translated to Punycode |
33 | | - * optional specify the whois command on query(...,cmd="whois") as in: https://github.com/gen1us2k/python-whois/ |
34 | | - |
35 | | -## Dependencies |
36 | | - * please install also the command line "whois" of your distribution |
37 | | - * this library parses the output of the "whois" cli command of your operating system |
| 7 | +--- |
38 | 8 |
|
39 | | -## Docker |
40 | | - * docker pull mbootgithub/whoisdomain:latest |
| 9 | +## Notes |
41 | 10 |
|
42 | | -## Help Wanted |
43 | | -Your contributions are welcome, look for the Help wanted tag https://github.com/DannyCork/python-whois/labels/help%20wanted |
| 11 | + * This package will not support querying ip CIDR ranges or AS information |
| 12 | + * This was a copy of the original DanyCork 'whois'. |
| 13 | + * Significantly refactored in 2023. |
| 14 | + * The output is still compatible with DanyCork 'whois' |
44 | 15 |
|
45 | | -## Usage example |
| 16 | +## Versioning |
46 | 17 |
|
47 | | -Install the cli `whois` of your operating system if it is not present already |
| 18 | + * I will start versioning at 1.x.x |
| 19 | + * the second item will be YYYYMMDD, |
| 20 | + * the third item will start from 1 and be only used if more than one update will have to be done in one day. |
48 | 21 |
|
49 | | -Install `whois` package from your distribution (e.g apt install whois) |
| 22 | +Versions `1.x.x` will keep the output compatible with Danny Cork until 2024-02-03 (February 2024) |
50 | 23 |
|
| 24 | +## Releases |
51 | 25 |
|
52 | | - $pip install whois |
| 26 | + * Releases are avalable at: [Pypi](https://pypi.org/project/whoisdomain/) |
53 | 27 |
|
54 | | - >>> import whois |
55 | | - >>> domain = whois.query('google.com') |
| 28 | +Pypi releases can be installed with: |
56 | 29 |
|
57 | | - >>> print(domain.__dict__) |
58 | | - { |
59 | | - 'expiration_date': datetime.datetime(2020, 9, 14, 0, 0), |
60 | | - 'last_updated': datetime.datetime(2011, 7, 20, 0, 0), |
61 | | - 'registrar': 'MARKMONITOR INC.', |
62 | | - 'name': 'google.com', |
63 | | - 'creation_date': datetime.datetime(1997, 9, 15, 0, 0) |
64 | | - } |
| 30 | + * `pip install whoisdomain` |
65 | 31 |
|
66 | | - >>> print(domain.name) |
67 | | - google.com |
| 32 | +## Features |
| 33 | + * See: [Features](docs/Features.md) |
68 | 34 |
|
69 | | - >>> print(domain.expiration_date) |
70 | | - 2020-09-14 00:00:00 |
| 35 | +## Dependencies |
| 36 | + * please install also the command line "whois" of your distribution as this library parses the output of the "whois" cli command of your operating system |
71 | 37 |
|
72 | | -## ccTLD & TLD support |
73 | | -see the file: ./whois/tld_regexpr.py |
74 | | -or call whois.validTlds() |
| 38 | +### Notes for Mac users |
| 39 | + * it has been observed that the default cli whois on Mac is showing each forward step in its output, this makes parsing the result very unreliable. |
| 40 | + * using a brew install whois will give in general better results. |
75 | 41 |
|
76 | | -## Issues |
77 | | - * Raise an issue https://github.com/DannyCork/python-whois/issues/new |
| 42 | +## Docker release |
| 43 | + * See [Docker](docs/Docker.md) |
78 | 44 |
|
79 | | -## Changes: 2022-06-09: maarten_boot: |
80 | | - * the returned list of name_servers is now a sorted unique list and not a set |
81 | | - * the help function whois.validTlds() now outputs the true tld with dots |
| 45 | +## Usage example |
| 46 | + * See [Usage](docs/Usage.md) |
82 | 47 |
|
83 | | -## 2022-09-27: maarten_boot |
84 | | - * add test2.py to replace test.py |
85 | | - * ./test2.py -h will show the possible usage |
86 | | - * all tests from the original program are now files in the ./tests directory |
87 | | - * test can be done on all supported tld's with -a or --all and limitest by regex with -r <pattern> or --reg=<pattern> |
| 48 | +## whoisdomain |
| 49 | + * the cli `whoisdomain` is documented in [whoisdomain-cli](docs/whoisdomain-cli.md) |
88 | 50 |
|
89 | | -## 2022-11-04: maarten_boot |
90 | | - * add support for Iana example.com, example.net |
| 51 | +## ccTLD & TLD support |
91 | 52 |
|
92 | | -## 2022-11-07: maarten_boot |
93 | | - * add testing against static known data in dir: ./testdata/<domain>/output |
94 | | - * test.sh will test all domains in testdata without actually calling whois, the input data is instead read from testdata/<domain>/input |
| 53 | +Most `tld's` are now autodetected via IANA root db, see the Analizer directory |
| 54 | +and `make suggest`. |
95 | 55 |
|
96 | | -## 2022-11-11: maarten_boot |
| 56 | + * see the file: [tld_regexpr](./whoisdomain/tldDb/tld_regexpr.py) |
| 57 | + * for python use: `whoisdomain.validTlds()` |
| 58 | + * for cli use `whoisdomain -S` |
97 | 59 |
|
98 | | - * add support for returning the raw data from the whois command: flag include_raw_whois_text |
99 | | - * add support for handling unsupported domains via whois raw text only: flag return_raw_text_for_unsupported_tld |
| 60 | +--- |
100 | 61 |
|
101 | | -## 2023-01-18: sorrowless |
| 62 | +## Support |
| 63 | + * Python 3.x is supported for x >= 9 |
| 64 | + * Python 2.x IS NOT supported. |
102 | 65 |
|
103 | | - * add an opportunity to specify maximum cache age |
| 66 | +## Author's |
| 67 | + * See: [Authors](docs/Authors.md) |
104 | 68 |
|
105 | | -## 2023-01-25: maarten_boot |
| 69 | +--- |
106 | 70 |
|
107 | | - * convert the tld file to a Dict, we now no longer need a mappper for python keywords or second level domains. |
108 | | - * utf8 level domains also need no mapper anymore an can be added as is with a translation to xn--<something> |
109 | | - * added xn-- tlds for all known utf-8 domains we currently have |
110 | | - * we can now add new domains on the fly or change them: whois.mergeExternalDictWithRegex(aDictToOverride) see example exampleExtend.py |
| 71 | +## Updates |
| 72 | + * see [Updates](docs/Updates.md) for a full history of changes. |
| 73 | + * Only the latest update is mentioned here |
111 | 74 |
|
112 | | -## 2023-01-27: maarten_boot |
| 75 | +### 1.20230906.1 |
| 76 | + * introduce parsing based on functions |
| 77 | + * allow contextual search in splitted data and plain data |
| 78 | + * allow contextual search based on earlier result |
| 79 | + * fix a few tld to return the proper registrant string (not nic handle) |
113 | 80 |
|
114 | | - * add autodetect via iana tld file (this has only tld's) |
115 | | - * add a central collection of all compiled regexes and reuse them: REG_COLLECTION_BY_KEY in _0_init_tld.py |
116 | | - * refresh testdata now that tld has dot instead of _ if more then one level |
117 | | - * add additional strings meaning domain does not exist |
| 81 | +### 1.20230913.1 |
| 82 | + * if you have installed `tld` (pip install tld) you can enable withPublicSuffix=True to process untill you reach the pseudo tld. |
| 83 | + * the public_suffix info is added if available (and if requested) |
| 84 | + * example case is: ./test2.py -d www.dublin.airport.aero --withPublicSuffix |
118 | 85 |
|
119 | | -## 2023-02-02: maarten_boot |
| 86 | +### 1.20230913.3 |
| 87 | + * fix re.NOFLAGS, it is not compatible with 3.9, it appears in 3.11 |
120 | 88 |
|
121 | | - * whois.QuotaStringsAdd(str) to add additional strings for over quota detection. whois.QuotaStrings() lists the current configured strings |
122 | | - * whois.NoneStringsAdd(str) to add additional string for NoSuchDomainExists detection (whois.query() retuning None). whois.NoneStrings() lsts the current configured strings |
123 | | - * suppress messages to stderr if not verbose=True |
| 89 | +## 1.20230917.1 |
| 90 | + * prepare work on pylint |
| 91 | + * switch to logging: all verbose is currently log.debug(); to show set LOGLEVEL=DEBUG before calling, see Makefile: make test |
| 92 | + * experimental: add extractServers: bool default False; when true we will try to extract the "redirect info chain" on rcf1036/whois and jwhois for linux/darwin |
| 93 | + * add missing option to query(), test in production environment done |
124 | 94 |
|
125 | | -## 2023-07-20: maarten_boot |
| 95 | +## 1.20231102.1 |
| 96 | + * fix from kazet for .pl tld. |
126 | 97 |
|
127 | | - * sync with https://github.com/mboot-github/WhoisDomain; 1.20230720.1; (gov.tr), (com.ru, msk.ru, spb.ru), (option to preserve partial output after timeout) |
128 | | - * sync with https://github.com/mboot-github/WhoisDomain; 1.20230720.2; add t_test hint support; fix some server hints |
| 98 | +## 1.20231115.1 |
| 99 | + New tld's and removal of a few tlds no longer supported at iana |
129 | 100 |
|
130 | | -## 2023-08-21: mboot-github (maarten_boot) |
| 101 | + * abb, bw, bn, crown, crs, fj (does not work), gp (does not work), weir, realtor, post, mw, pf (a strange one), iq (gives timout), mm, int, hm (does not work) |
131 | 102 |
|
132 | | - * abandon any python below 3.9 (mypy compatibilities) |
133 | | - * major refactor into more object based approch and parameterContext |
134 | | - * allow custom caching backends (e.g. redis, dbm, ...) |
| 103 | +--- |
135 | 104 |
|
136 | | -## 2023-09-22 see new paramaters in whois/context/parameterContext.oy |
| 105 | +## in progress |
137 | 106 |
|
138 | | - * Sync with latest whoisdomain |
139 | | - * Allow cleaning up the http(s) info in the status response. |
140 | | - * Allow correlation with tld (pip install tld) public_suffix. |
141 | | - * Allow display of what whois-servers were used until we reach the final item. |
0 commit comments