whotfis-py


Namewhotfis-py JSON
Version 0.0.7 PyPI version JSON
download
home_pagehttps://github.com/xV4L3x/whotfis-py
SummarySimple package to interact with the whois command line tool
upload_time2024-06-01 07:21:03
maintainerNone
docs_urlNone
authorValerio Pio De Nicola
requires_pythonNone
licenseApache 2
keywords python whois whois command line whois python whois python package
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Avaiability
| Platform | Status               |
|----------|----------------------|
| MacOS    | Supported ✅          |
| Linux    | In Progress 🚧       |
| Windows  | Not supported yet  ❌ |


# Installation
To install the package, just run the following command:
```bash
pip install whotfis-py
```
# Usage
```python
import whotfis_py
result = whotfis_py.lookup("QUERY", registry)
```
The package has different classes for different registers on which will the whois lookup be performed, so when executing the query is possible to specify the database MACRO

```python
import whotfis_py
from whotfis_py import registries

whotfis_py.lookup("QUERY", registries.RADB)
```
From the available registers the program supports:

- ARPIN
- APNIC
- ABUSE
- AFRINIC
- USMILITARY
- INTERNIC
- IANA
- KRNIC
- LACNIC
- RIPE
- RADB

If you want to specify a custom register you also need to provide the server name for that register 

```python
whotfis_py.lookup("QUERY", registries.CUSTOM, "whois.radb.net")
```

## Results
The `lookup()` function will return a class depending on the registry you passed, all the classes are specified in the file `whois_py/result.py`, if you want to list all the possible values at runtime you can use the `dir()`method on the object

```python
result = whotfis_py.lookup("QUERY", registries.RADB)
attributes = dir(result)
```

All the classes inherit from the `whois_result` super class, which provide the `dict()` method to convert all the instances of the class to dictionary
```python
result = whotfis_py.lookup("QUERY", registries.RADB)
print(result.dict())
```

Since the CUSTOM registry output is unknown the parameters will be setted at runtime during the lookup, the accepted parameters are only in the `key:value` shape.

In case of duplicate keys in the output there are two policies, a list of appendable keys is provided for each class in the `whois_result` class, if the key is not in the list the value will be overwritten, otherwise the value will be appended to the others.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/xV4L3x/whotfis-py",
    "name": "whotfis-py",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "python, whois, whois command line, whois python, whois python package",
    "author": "Valerio Pio De Nicola",
    "author_email": "valeriopio02@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/ed/da/52841290cbf65849997d1784fcf2ed2d854b2e74f18fa44c69025a00c0a6/whotfis_py-0.0.7.tar.gz",
    "platform": null,
    "description": "# Avaiability\n| Platform | Status               |\n|----------|----------------------|\n| MacOS    | Supported \u2705          |\n| Linux    | In Progress \ud83d\udea7       |\n| Windows  | Not supported yet  \u274c |\n\n\n# Installation\nTo install the package, just run the following command:\n```bash\npip install whotfis-py\n```\n# Usage\n```python\nimport whotfis_py\nresult = whotfis_py.lookup(\"QUERY\", registry)\n```\nThe package has different classes for different registers on which will the whois lookup be performed, so when executing the query is possible to specify the database MACRO\n\n```python\nimport whotfis_py\nfrom whotfis_py import registries\n\nwhotfis_py.lookup(\"QUERY\", registries.RADB)\n```\nFrom the available registers the program supports:\n\n- ARPIN\n- APNIC\n- ABUSE\n- AFRINIC\n- USMILITARY\n- INTERNIC\n- IANA\n- KRNIC\n- LACNIC\n- RIPE\n- RADB\n\nIf you want to specify a custom register you also need to provide the server name for that register \n\n```python\nwhotfis_py.lookup(\"QUERY\", registries.CUSTOM, \"whois.radb.net\")\n```\n\n## Results\nThe `lookup()` function will return a class depending on the registry you passed, all the classes are specified in the file `whois_py/result.py`, if you want to list all the possible values at runtime you can use the `dir()`method on the object\n\n```python\nresult = whotfis_py.lookup(\"QUERY\", registries.RADB)\nattributes = dir(result)\n```\n\nAll the classes inherit from the `whois_result` super class, which provide the `dict()` method to convert all the instances of the class to dictionary\n```python\nresult = whotfis_py.lookup(\"QUERY\", registries.RADB)\nprint(result.dict())\n```\n\nSince the CUSTOM registry output is unknown the parameters will be setted at runtime during the lookup, the accepted parameters are only in the `key:value` shape.\n\nIn case of duplicate keys in the output there are two policies, a list of appendable keys is provided for each class in the `whois_result` class, if the key is not in the list the value will be overwritten, otherwise the value will be appended to the others.\n",
    "bugtrack_url": null,
    "license": "Apache 2",
    "summary": "Simple package to interact with the whois command line tool",
    "version": "0.0.7",
    "project_urls": {
        "Homepage": "https://github.com/xV4L3x/whotfis-py"
    },
    "split_keywords": [
        "python",
        " whois",
        " whois command line",
        " whois python",
        " whois python package"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3a337bfbf06845db6f4997ef7170e1ce19859b864de43262480c7af0ca20e744",
                "md5": "a78bc460805c0b6d5d90bdf55248639f",
                "sha256": "59b24e12a60cae3578656ec8af0b57b3ea6d6e3f234b517c4cd188a8c0b22c93"
            },
            "downloads": -1,
            "filename": "whotfis_py-0.0.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a78bc460805c0b6d5d90bdf55248639f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 9602,
            "upload_time": "2024-06-01T07:21:01",
            "upload_time_iso_8601": "2024-06-01T07:21:01.323579Z",
            "url": "https://files.pythonhosted.org/packages/3a/33/7bfbf06845db6f4997ef7170e1ce19859b864de43262480c7af0ca20e744/whotfis_py-0.0.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "edda52841290cbf65849997d1784fcf2ed2d854b2e74f18fa44c69025a00c0a6",
                "md5": "d0ccb2ee324c048c1a04d706df72cd54",
                "sha256": "dd300eec64012761fb2dbdda0545127ae35926c525c7fa56a398aa096d740421"
            },
            "downloads": -1,
            "filename": "whotfis_py-0.0.7.tar.gz",
            "has_sig": false,
            "md5_digest": "d0ccb2ee324c048c1a04d706df72cd54",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 8811,
            "upload_time": "2024-06-01T07:21:03",
            "upload_time_iso_8601": "2024-06-01T07:21:03.003471Z",
            "url": "https://files.pythonhosted.org/packages/ed/da/52841290cbf65849997d1784fcf2ed2d854b2e74f18fa44c69025a00c0a6/whotfis_py-0.0.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-01 07:21:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "xV4L3x",
    "github_project": "whotfis-py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "whotfis-py"
}
        
Elapsed time: 0.65844s