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.1

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.1
File Size Uploaded
quantdb_sdk-0.1.1.tar.gz 15.5 kB Details

Built distribution (wheel)

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

Total release size: 34.0 kB

Release files / quantdb_sdk-0.1.1.tar.gz

Download URL quantdb_sdk-0.1.1.tar.gz
Size 15.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d1379d7b967d338be94a276fc74a159fcc6c636fefcf73bc8b720bb10434d509
BLAKE2b-256 checksum
How to use checksums
0a8e060e184d156a9a38b0b115070aeaf88bf536439ac29235345a793b23d154
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.1-py3-none-any.whl

Download URL quantdb_sdk-0.1.1-py3-none-any.whl
Size 18.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0a3850098a6f5feb247f783ce041e908464728e05d7201c01227b009ea655efb
BLAKE2b-256 checksum
How to use checksums
be9e269410efd08fc463b75fa992daac2536dfba4176bf010f35ab0acb88a4e6
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

This release

0.1.1 This release

2 release files

0.1.0

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