Metadata-Version: 2.5
Name: powerquant-cli
Version: 0.2.6
Summary: Power Quant local research CLI
Project-URL: Repository, https://github.com/Kepler452Byte/power-quant
License-Expression: LicenseRef-PowerQuant-Proprietary AND MIT
License-File: LICENSE
License-File: licenses/LICENSE.vnpy
Requires-Python: >=3.12
Requires-Dist: duckdb<2,>=1.4
Requires-Dist: filelock<4,>=3.20
Requires-Dist: httpx<1,>=0.28
Requires-Dist: numpy<3,>=2
Requires-Dist: pandas<4,>=3
Requires-Dist: polars<2,>=1.36
Requires-Dist: pydantic<3,>=2.5
Requires-Dist: scipy<2,>=1.17
Requires-Dist: typer>=0.27.2
Requires-Dist: tzdata>=2026.3
Description-Content-Type: text/markdown

# Power Quant CLI

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

## 安装

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

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

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

## 接入行情

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

```sh
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；本许可证不授予行情数据的使用或再分发权。
