Python client library for Reverse NS API.
Project description
Overview
The client library for Reverse NS API in Python language.
The minimum Python version is 3.6.
Installation
pip install reverse-ns
Examples
Full API documentation available here
Create a new client
from reversens import *
client = Client('Your API key')
Make basic requests
# Get categories for a domain name.
response = client.get('ns.google.com')
for row in response.result:
print("Domain: " + row.name)
Advanced usage
Extra request parameters
# Iterating over all pages
# Specify the target name server.
client.name_server = "ns2.google.com"
# Now you can use the `Client` instance as an iterable object
for page in client:
# Precess the data:
for row in page.result:
print(row.name)
# You can access the last response object via `last_result` property
print(client.last_result.size)
# Please note, that `client.get_raw(...)` method doesn't
# update value of the `last_result` field.
# Also, `iter(client)` will reset the `last_result` value to None
# Getting raw API response in XML
xml = client.get_raw('ns.google.com', output_format=Client.XML_FORMAT)
Using Response model reference
response = client.get('....')
# Getting list of domains
response.result
# Checking the size of the domain list
response.size
# Checking if there is a next page
if response.has_next():
....
# `current_page` shows the `search_from` value
...
r = client.get(ns='ns', search_from='last.domain.of.the.previous.page.com')
print(r.current_page)
# >>'last.domain.of.the.previous.page.com'
Changelog
1.0.0 (2021-07-09)
First release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
reverse-ns-1.0.0.tar.gz
(9.3 kB
view details)
Built Distribution
File details
Details for the file reverse-ns-1.0.0.tar.gz
.
File metadata
- Download URL: reverse-ns-1.0.0.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26910d381f7c9d935fbfdc8b0133e3763067d0411d949a61dbaf1a9225195ee4 |
|
MD5 | 5eff7b6bad41264242717bf433ff54d7 |
|
BLAKE2b-256 | 91065a65e22817e2e774d052677fa3c0082a2e8316aa34cc00c22a2cc3d47510 |
File details
Details for the file reverse_ns-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: reverse_ns-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 244be19674a535386fb949ea3849f2ae91881a6d4d974e5db582097b5a8cb9f8 |
|
MD5 | deeb0aac9dd7152be31780893c604fa0 |
|
BLAKE2b-256 | 4af14092ed71619ff5b2ed783e09fa75bbfd0abf03bd636b9d1ce2c0433b9333 |