Skip to main content

QuantDB Python SDK

QuantDB 量化数据平台官方 Python SDK,提供同步与异步两种客户端,封装了全部 API 端点。

安装

pip install quantdb-sdk

开发依赖:

pip install -e ".[dev]"

快速开始

API Key 鉴权(推荐)

from quantdb_sdk import QuantDBClient

client = QuantDBClient(api_key="qdb_xxx...")

# 查询用量
usage = client.get_usage()
print(f"已用: {usage['used_gb']:.2f} GB, 剩余: {usage['remaining_gb']:.2f} GB")

# K 线查询(免费)
df = client.query_kline(
    "600519.SH",
    adj_type="forward",
    start_date="2026-01-01",
    end_date="2026-07-22",
)
print(df.head())

用户名密码鉴权

client = QuantDBClient(username="admin", password="admin123")

核心功能

  • 数据查询:K 线、Tick 通过下载 Parquet 切片后客户端解析(消耗流量);股票列表、交易日历、元数据走网关 JSON(不计流量)。
  • 数据下载:Parquet 文件下载或直读 DataFrame,计入订阅流量。
  • 本地分析:基于 DuckDB 对本地 Parquet 执行 SQL。
  • 账户管理:查询用户信息、用量、API Key、订阅与订单。
  • 异步客户端:基于 httpx,适用于 asyncio 量化框架。

流量说明

每月前 30 GB 下载流量免费,超出部分按 ¥1/GB 计费;账户余额不足时,下载会被限流,充值后即可恢复。

文档

完整文档请访问:https://www.quantmindai.cn/docs/sdk.html

Release files for quantdb-sdk 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for quantdb-sdk 0.1.0
File Size Uploaded
quantdb_sdk-0.1.0.tar.gz 15.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for quantdb-sdk 0.1.0
File Interpreter ABI Platform
quantdb_sdk-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 33.8 kB

Release files / quantdb_sdk-0.1.0.tar.gz

Download URL quantdb_sdk-0.1.0.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
286f4012735ce1268061f767e8254a88b252b2e87a844e6bc21b265de7a0263a
BLAKE2b-256 checksum
How to use checksums
ead30aa5e755e3a70df22456e93cd9b1bec7bf8dfac45aefa8126572eb10d4ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / quantdb_sdk-0.1.0-py3-none-any.whl

Download URL quantdb_sdk-0.1.0-py3-none-any.whl
Size 18.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d9ae4e9fa8809677eb7ccd6f61ed4fab050815fdfb4a7ce471a469eb1773aca8
BLAKE2b-256 checksum
How to use checksums
f5fef74561cd8dbc3930da238b96162c296b0d76905cfab82d3274ccaacc4a46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release history Release notifications | RSS feed

0.3.4

1 release file

0.3.3

2 release files

0.3.2

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.10

1 release file

0.2.9

2 release files

0.2.8

1 release file

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page