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

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.3
File Size Uploaded
quantdb_sdk-0.1.3.tar.gz 22.3 kB Details

Built distribution (wheel)

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

Total release size: 42.0 kB

Release files / quantdb_sdk-0.1.3.tar.gz

Download URL quantdb_sdk-0.1.3.tar.gz
Size 22.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1d5e90f0716cb496039698735fe37c1052d0ce1f9da22d9a7b5f9f1a624aba22
BLAKE2b-256 checksum
How to use checksums
a34d2ca280618d95bb8ca59e389318b94b49223f89727f184394f4ac9c8fce5c
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.3-py3-none-any.whl

Download URL quantdb_sdk-0.1.3-py3-none-any.whl
Size 19.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
00debf628ae6cc66b7fb3cb2b005de00d37e362eaa6ad72c5a8d2bd9c32c0d71
BLAKE2b-256 checksum
How to use checksums
29ee21e426cbddb47fa6badc5a38d4470736ee8dd13f11585b7a2dcef44d9a7f
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

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

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