Skip to main content

Power Quant CLI

本地行情准备、因子计算、选股、研究及策略回测;结果保存在本地 DuckDB 和文件。

安装

推荐通过 uv 安装独立工具环境:

uv tool install --python 3.12 powerquant-cli
pq --help
uv tool upgrade powerquant-cli

也支持在 Python 3.12+ 环境通过 pip install powerquant-cli 安装。

接入行情

向管理员获取行情读取密钥,无需注册账户。服务当前仅在 LAN/WireGuard 内可达。

export MARKET_BASE_URL='http://服务器地址/market/api/v1'
export MARKET_API_TOKEN='管理员提供的行情密钥'
pq examples --directory powerquant-examples
cd powerquant-examples/selection
pq data prepare --config prepare.json

PowerShell 使用 $env:MARKET_BASE_URL="..." 与 $env:MARKET_API_TOKEN="..."。

按实际覆盖调整 prepare.json 的股票和日期,将返回 manifest_path 写入 compute.json、select.json;按示例 README 执行 compute、select 和 backtest。不同使用目的的快照须分别通过完整性检查。

密钥到期或撤销后在线准备会失败,已下载快照仍可离线使用。行情密钥不用于定义发布;发布定义另使用 PQ_QUANT_URL/PQ_QUANT_TOKEN。默认本地目录为 ~/.powerquant。

Python

公开请求模型与调用入口位于 quant_cli.api,与 CLI 使用同一应用服务。

使用许可

自有代码采用随包附带的专有许可证:允许安装、查看源码、为自用进行修改,以及商业使用;未经书面授权不得再分发或转售本软件及其修改版本。第三方组件保留各自许可证。行情访问仍需要有效 Token;本许可证不授予行情数据的使用或再分发权。

Metadata

Release files for powerquant-cli 0.2.6

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

Source distribution (sdist)

Source distribution for powerquant-cli 0.2.6
File Size Uploaded
powerquant_cli-0.2.6.tar.gz 447.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for powerquant-cli 0.2.6
File Interpreter ABI Platform
powerquant_cli-0.2.6-py3-none-any.whl Python 3 none any Details

Total release size: 888.1 kB

Release files / powerquant_cli-0.2.6.tar.gz

Download URL powerquant_cli-0.2.6.tar.gz
Size 447.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f2fe53dda49746ee9a0d9c914e82c64d768f8d802a3171db495f3be739e86b25
BLAKE2b-256 checksum
How to use checksums
4ff2898121f131146128b5a2bbbfe22fcc48208b8cb5e892454e15ed8f6bafa8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / powerquant_cli-0.2.6-py3-none-any.whl

Download URL powerquant_cli-0.2.6-py3-none-any.whl
Size 440.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
32f648c0ddc03d229ccb95b0c0d1263d2dc5439c2d85bc24a031b7057f623e27
BLAKE2b-256 checksum
How to use checksums
474f1272e2c032213c88d5fd041572c0349eddd869c8335df1cd218af311f641
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.7

2 release files

This release

0.2.6 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