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

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.2
File Size Uploaded
quantdb_sdk-0.1.2.tar.gz 23.2 kB Details

Built distribution (wheel)

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

Total release size: 42.9 kB

Release files / quantdb_sdk-0.1.2.tar.gz

Download URL quantdb_sdk-0.1.2.tar.gz
Size 23.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a02280f9b1c2e12a4073f63f4b206930a4079f30bda014046371cc7ff3c59089
BLAKE2b-256 checksum
How to use checksums
d6bfb3698fbd0d6f6d7c5afbb67b2b8f7280d11ce0d3af17d49afd3451ff8e35
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.2-py3-none-any.whl

Download URL quantdb_sdk-0.1.2-py3-none-any.whl
Size 19.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bc4488011cdf5fcc38662dea73e831a1628a72d91a3e269dfc585d3b253b6ee7
BLAKE2b-256 checksum
How to use checksums
065b8f9ec939ff4519223e4701b903cee83be2a65da6f5e682c2edb9fe599322
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

This release

0.1.2 This release

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