DD

devnorsai/devnors-data-python

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

901 stars 3 forks 质量 71 趋势 24MIT

devnorsai/devnors-data-python 是从 https://github.com/devnorsai/devnors-data-python. 导入的 MCP 服务器候选

概览

devnorsai/devnors-data-python 是从 https://github.com/devnorsai/devnors-data-python. 导入的 MCP 服务器候选

概述(AI 翻译)

简体中文 |英语

用 Python 的 Devnors 数据,用一个 API 键。

拨打法律案件、法律、企业数据、内容索引、学术研究 (论文/专利/期刊/学者),快速追踪等,通过 单一POST /v1/data/query网关。每次命中均为AI代理设计,且 在适用的情况下,提供官方来源可追溯性。

安装

快速启动

在 开发者控制台,然后:

异步:

代币

使用您的Devnors数据API密钥如下:

或者:

可选的私有/自托管基础网址:

你可以做的事情

重试与分页

  • 自动重试针对429 / 5xx / 连接错误(有界指数) backoff)。不可重试的错误,如400 / 401 / 402 / 501 重试。用DevnorsData(..., max_retries=0)禁用。
  • 分页助手:paginate(...) 通过 total_hits 来浏览页面。

账单与错误

  • 成功调用返回units(已充电令牌)和request_id。
  • 余额不足导致加注DevnorsDataError(code="insufficient_balance", status=402)。
  • 利率上限提高 code="rate_limited" (429)。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Devnors Data Python SDK

简体中文 | English

Use Devnors Data from Python with one API Key.

Call legal cases, laws, enterprise data, content indexes, academic research (papers / patents / journals / scholars), express tracking, and more through a single POST /v1/data/query gateway. Every hit is designed for AI agents, with official-source traceability where applicable.

Install

pip install devnors-data

Quick Start

Create an API Key in the developer console, then:

from devnors_data import DevnorsData

client = DevnorsData(api_key="devnors_sk_live_xxx")  # or set DEVNORS_API_KEY

# Legal judgment documents
res = client.legal_cases("民间借贷 利息", top_k=10)
for hit in res["hits"]:
    print(hit.get("case_no"), hit.get("title"))

# Law articles
laws = client.legal_laws("合同解除 违约金")

# Unified entry for any domain / type
res = client.query(domain="legal", type="case", query="劳动争议", top_k=5)
print(res["units"], "tokens used")

Async:

import asyncio
from devnors_data import AsyncDevnorsData

async def main():
    client = AsyncDevnorsData(api_key="devnors_sk_live_xxx")
    res = await client.legal_cases("交通事故 责任认定")
    print(res["total_hits"])

asyncio.run(main())

Token

Use your Devnors Data API Key in one of these ways:

DevnorsData(api_key="devnors_sk_live_xxx")

or:

DEVNORS_API_KEY=devnors_sk_live_xxx

Optional private / self-hosted base URL:

DEVNORS_DATA_BASE_URL=https://data.devnors.com

Things You Can Do

Search Chinese legal judgment documents for private lending disputes.
Look up current PRC law articles about contract termination and liquidated damages.
Query company registration details with a credit code or company name.
Check whether a company is on the dishonest judgment debtor list.
Get Baidu suggest keywords for "lawyer".
Track a parcel with company code and tracking number.
Search academic papers, patents, journals, or scholars, then fetch a detail by ID.
Paginate legal case hits until I have 100 results.

Retry and Pagination

  • Automatic retry for 429 / 5xx / connection errors (bounded exponential backoff). Non-retryable errors such as 400 / 401 / 402 / 501 are never retried. Disable with DevnorsData(..., max_retries=0).
  • Pagination helper: paginate(...) walks pages using total_hits.
for hit in client.paginate("legal", "case", "借贷纠纷", page_size=20, max_items=100):
    print(hit.get("case_no"))

Billing and Errors

  • Successful calls return units (tokens charged) and request_id.
  • Insufficient balance raises DevnorsDataError(code="insufficient_balance", status=402).
  • Rate limit raises code="rate_limited" (429).
  • Each DevnorsDataError includes code / retryable / next_action / request_id.

Data Domains

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →