Reverse NS API的Python客户端库。
项目描述
概述
Python语言的Reverse NS API客户端库。
最低Python版本为3.6。
安装
pip install reverse-ns
示例
完整的API文档可在此处找到
创建新客户端
from reversens import *
client = Client('Your API key')
进行基本请求
# Get categories for a domain name.
response = client.get('ns.google.com')
for row in response.result:
print("Domain: " + row.name)
高级使用
额外的请求参数
# 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)
使用响应模型参考
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'
变更日志
1.0.0 (2021-07-09)
首次发布
项目详情
下载文件
下载适合您平台文件的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。
源分布
reverse-ns-1.0.0.tar.gz (9.3 kB 查看哈希值)
构建版本
reverse_ns-1.0.0-py3-none-any.whl (9.9 kB 查看哈希)