Skip to main content

Python module to interact with ViewDNS.info API

Project description

viewdns-python

viewdns-python is a Python library for interacting with the ViewDNS.info API.

Installation

Use the package manager pip to install viewdns-python.

pip setup.py install

Usage

import viewdns

client = viewdns.Client('your-api-key')

Features

viewdns-python does not support all the tools yet. Below is a list of what is currently supported:

DNS Record Lookup

dns_records = client.get_dns_records('twitter.com')

print(dns_records) # [<DNSRecord> {name=twitter.com., ttl=293, class_=IN, type=SOA, priority=None, data=ns1.p26.dynect.net. zone-admin.dyndns.com. 2007158928 3600 600 604800 60, class=IN}, ...]

Get HTTP Headers

http_headers = client.get_http_headers('twitter.com')

print(http_headers) # [<HTTPHeader> {name=http_status, value=301}, ...]

IP Location Finder

ip_location = client.get_ip_location('11.11.11.11')

print(ip_location) # <IPLocation> {city=Bullard, zipcode=75757, region_code=TX, country_code=US, country_name=United States, latitude=32.1095, longitude=-95.3342, gmt_offset=, dst_offset=, region_name=Texas}

Testing

Docker

Build the container.

docker build -t viewdns-python-tests .

Run the tests.

docker run viewdns-python-tests

Links

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

viewdns-python-0.0.1.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

viewdns_python-0.0.1-py3-none-any.whl (2.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page