跳转到主要内容

Python客户端库,用于域名信誉API。

项目描述

domain-reputation-py license domain-reputation-py release domain-reputation-py build

概述

Python语言编写的域名信誉API客户端库。

最小Python版本是3.6。

安装

pip install domain-reputation

示例

完整API文档可在此找到

创建新的客户端

from domainreputation import *

client = Client('Your API key')

执行基本请求

# Get DNS records for a domain name.
response = client.get('youtube.com')
print(response)

# Get raw API response in XML format
raw_result = client.get_raw('bbc.com',
    output_format=Client.XML_FORMAT)

高级用法

额外请求参数

result = client.get(
    'samsung.com',
    Client.MODE_FULL)

响应模型概述

Response:
    - mode: str
    - reputation_score: float
    - test_results: [TestResult]
        - test: str
        - test_code: int
        - warnings: [str]
        - warning_codes: [int]

示例响应

{
'mode': 'full',
'reputation_score': 81.16,
'test_results':
  [
      {
          "test": "Name servers configuration meets best practices",
          "testCode": 76,
          "warnings": [
              "Some name servers are located on a single ASN: \
               ns44.domaincontrol.com - AS44273, ns43.domaincontrol.com - AS44273"
          ],
          "warningCodes": [
              1013
          ]
      },
      {
          "test": "Mail servers configuration check",
          "testCode": 80,
          "warnings": [
              "AAAA records not configured for mail servers",
              "SPF record not configured",
              "DMARC is not configured"
          ],
          "warningCodes": [
              5007,
              5015,
              5016
          ]
      },
      {
          "test": "Malware databases check",
          "testCode": 82,
          "warnings": [
              "Status: dangerous"
          ],
          "warningCodes": [
              4001
          ]
      },
      {
          "test": "SSL Certificate configuration",
          "testCode": 89,
          "warnings": [
              "No SSL certificates found"
          ],
          "warningCodes": [
              6023
          ]
      }
  ]
}

变更日志

1.0.0 (2021-10-25)

  • 首次发布

项目详情


下载文件

下载适合您平台的应用程序。如果您不确定选择哪一个,请了解更多关于 安装包 的信息。

源分发

domain-reputation-1.0.0.tar.gz (9.1 kB 查看散列值)

上传于 来源

构建分发

domain_reputation-1.0.0-py3-none-any.whl (10.1 kB 查看哈希值)

上传于 Python 3

由以下提供支持