# pydig
pydig is a python wrapper library for the 'dig' command line tool.
[![Build Status](https://travis-ci.org/leonsmith/pydig.svg?branch=master)](https://travis-ci.org/leonsmith/pydig)
[![Python Versions](https://img.shields.io/pypi/pyversions/pydig.svg)](https://pypi.org/project/pydig/)
[![License](https://img.shields.io/pypi/l/pydig.svg?color=informational)](https://pypi.org/project/pydig/)
## Versioning
pydig follows [SemVer](https://semver.org/) (MAJOR.MINOR.PATCH) to track what is in each release.
* Major version number will be bumped when there is an incompatible API change
* Minor version number will be bumped when there is functionality added in a backwards-compatible manner.
* Patch version number will be bumped when there is backwards-compatible bug fixes.
Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.
## Installation
Installation the package from pypi with your tool of choice `pip`, `poetry`
or `pipenv`.
```bash
pip install pydig
```
## Usage
To use the default resolver you can call `pydig.query` this resolver will use
the `dig` command found in your `$PATH`.
```
>>> import pydig
>>> pydig.query('example.com', 'A')
['93.184.216.34']
>>> pydig.query('www.github.com', 'CNAME')
['github.com.']
>>> pydig.query('example.com', 'NS')
['a.iana-servers.net.', 'b.iana-servers.net.']
```
If your want to adjust the executable location, the nameservers to dig will
query against or would like to pass additional arguments/flags, you can
configure your own instance of a resolver. and call the `query` method of your
custom resolver.
```
>>> import pydig
>>> resolver = pydig.Resolver(
... executable='/usr/bin/dig',
... nameservers=[
... '1.1.1.1',
... '1.0.0.1',
... ],
... additional_args=[
... '+time=10',
... ]
... )
>>> resolver.query('example.com', 'A')
>>> ['93.184.216.34']
```
## Documentation
The code is 150~ lines with 100% test coverage
https://github.com/leonsmith/pydig/tree/master/pydig
Raw data
{
"_id": null,
"home_page": "https://github.com/leonsmith/pydig",
"name": "pydig",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.5,<4.0",
"maintainer_email": "",
"keywords": "dig,dns,pydig,resolver,lookup",
"author": "Leon Smith",
"author_email": "_@leonmarksmith.com",
"download_url": "https://files.pythonhosted.org/packages/f3/4d/312bbd4eb8bbea9215eac2980a75bad67d0cb38be7b8bce2d23354276ff8/pydig-0.4.0.tar.gz",
"platform": "",
"description": "# pydig\n\npydig is a python wrapper library for the 'dig' command line tool.\n\n[![Build Status](https://travis-ci.org/leonsmith/pydig.svg?branch=master)](https://travis-ci.org/leonsmith/pydig)\n[![Python Versions](https://img.shields.io/pypi/pyversions/pydig.svg)](https://pypi.org/project/pydig/)\n[![License](https://img.shields.io/pypi/l/pydig.svg?color=informational)](https://pypi.org/project/pydig/)\n\n## Versioning\n\npydig follows [SemVer](https://semver.org/) (MAJOR.MINOR.PATCH) to track what is in each release.\n\n* Major version number will be bumped when there is an incompatible API change\n* Minor version number will be bumped when there is functionality added in a backwards-compatible manner.\n* Patch version number will be bumped when there is backwards-compatible bug fixes.\n\nAdditional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.\n\n\n## Installation\n\nInstallation the package from pypi with your tool of choice `pip`, `poetry`\nor `pipenv`.\n\n```bash\npip install pydig\n```\n\n## Usage\n\nTo use the default resolver you can call `pydig.query` this resolver will use\nthe `dig` command found in your `$PATH`.\n```\n>>> import pydig\n>>> pydig.query('example.com', 'A')\n['93.184.216.34']\n>>> pydig.query('www.github.com', 'CNAME')\n['github.com.']\n>>> pydig.query('example.com', 'NS')\n['a.iana-servers.net.', 'b.iana-servers.net.']\n```\n\nIf your want to adjust the executable location, the nameservers to dig will\nquery against or would like to pass additional arguments/flags, you can\nconfigure your own instance of a resolver. and call the `query` method of your\ncustom resolver.\n\n```\n>>> import pydig\n>>> resolver = pydig.Resolver(\n... executable='/usr/bin/dig',\n... nameservers=[\n... '1.1.1.1',\n... '1.0.0.1',\n... ],\n... additional_args=[\n... '+time=10',\n... ]\n... )\n>>> resolver.query('example.com', 'A')\n>>> ['93.184.216.34']\n```\n\n## Documentation\n\nThe code is 150~ lines with 100% test coverage\n\nhttps://github.com/leonsmith/pydig/tree/master/pydig\n",
"bugtrack_url": null,
"license": "GPL-3.0",
"summary": "Python wrapper library for the 'dig' command line tool",
"version": "0.4.0",
"project_urls": {
"Homepage": "https://github.com/leonsmith/pydig",
"Repository": "https://github.com/leonsmith/pydig"
},
"split_keywords": [
"dig",
"dns",
"pydig",
"resolver",
"lookup"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4cee6b942922ecbda33ba9d34393f4cec5f107bea665b6f107a81410cb94019d",
"md5": "5e704eba497e677fdfe1c3de355c1e43",
"sha256": "eddb17778268d58c93db21b2044f420640ade70096875608a2880b3e5935ccd4"
},
"downloads": -1,
"filename": "pydig-0.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5e704eba497e677fdfe1c3de355c1e43",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.5,<4.0",
"size": 16167,
"upload_time": "2021-08-25T20:41:59",
"upload_time_iso_8601": "2021-08-25T20:41:59.548964Z",
"url": "https://files.pythonhosted.org/packages/4c/ee/6b942922ecbda33ba9d34393f4cec5f107bea665b6f107a81410cb94019d/pydig-0.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f34d312bbd4eb8bbea9215eac2980a75bad67d0cb38be7b8bce2d23354276ff8",
"md5": "78d5add148578c75f28bb3ba1725839f",
"sha256": "57c127ab2d2e6afb58d7bab9c9592c074cb5ccc0d2e5c0817e344ac6e140333a"
},
"downloads": -1,
"filename": "pydig-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "78d5add148578c75f28bb3ba1725839f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.5,<4.0",
"size": 15839,
"upload_time": "2021-08-25T20:42:01",
"upload_time_iso_8601": "2021-08-25T20:42:01.191568Z",
"url": "https://files.pythonhosted.org/packages/f3/4d/312bbd4eb8bbea9215eac2980a75bad67d0cb38be7b8bce2d23354276ff8/pydig-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2021-08-25 20:42:01",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "leonsmith",
"github_project": "pydig",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"tox": true,
"lcname": "pydig"
}