Skip to main content

Armored Analytics in Your Terminal — 终端数据分析驾驶舱

Project description

🐼🔧 Panzr v0.2.7

Armored Analytics in Your Terminal. 终端里的装甲数据分析。

Panzr 是你的终端数据分析驾驶舱。 "Your Terminal Data Cockpit."


产品定位

Panzr 是一个 TUI (Terminal User Interface) 数据分析工具箱。底层整合 DuckDB、Polars、plotext 等成熟引擎,Panzr 本身只负责:菜单导航、参数拼装、流程串联、结果展示。

v0.2.6 核心升级:DuckDB 成为唯一数据引擎。文件组注册为 DuckDB View(零内存),探查/聚合/SQL 统一走 DuckDB。新增 LLM 自然语言生成 SQL。


功能矩阵

Tab 功能 底层引擎
🔌 连接 扫描目录、关键词搜索分组、多选加载、DuckDB View 注册 DuckDB + Polars
🔍 探查 Polars 管道 (筛选→排序→去重→选列), 懒加载, 三段式布局 Polars Lazy
📝 SQL DuckDB 查询, DataCatalog + 编辑器 + 结果, Harlequin 布局 DuckDB
🤖 AI SQL 自然语言 → SQL (DeepSeek), 自动注入表结构 LLM
📊 聚合 跨文件 GROUP BY, 多聚合函数, DuckDB 全量扫描 DuckDB
📈 可视化 柱状图/折线图/散点图/直方图, 终端渲染 plotext
📋 报告 一键数据诊断报告 (Data Profile) DuckDB + Rich

安装

pip install -e .

依赖: textual duckdb polars plotext rich openai

外部工具 (可选): visidata harlequin jq

LLM SQL 生成

export DEEPSEEK_API_KEY=sk-你的key

使用

panzr
# 自动加载目录
panzr --load ~/FinData/资金结算
# 加载 siku 插件
panzr --siku

典型工作流

扫描目录 → 多选分组 → DuckDB View 注册 (全量零内存)
  → 探查 (Polars lazy 管道, limit 500)
  → SQL (AI 生成或手写, 全量查询)
  → 聚合 (跨文件 GROUP BY)
  → 可视化

快捷键

快捷键 功能
Ctrl+Q / Ctrl+C 退出 Panzr
Ctrl+T 下一个 Tab
Ctrl+P 上一个 Tab
Ctrl+Enter 执行 SQL 查询

项目结构

panzr/
├── app.py                  # 主 App + CSS + 快捷键
├── state.py                # 全局数据上下文 (AppState)
├── startup_check.py        # 启动环境检测器
├── engines/
│   ├── loader.py           # 文件扫描 + 分组
│   ├── duckdb_engine.py    # DuckDB 查询引擎
│   ├── harlequin_launcher.py  # Harlequin 子进程启动
│   ├── llm.py              # LLM SQL 生成 (DeepSeek)
│   └── exporter.py         # 导出
└── tabs/
    ├── connect.py          # 连接 Tab (扫描+多选+DuckDB)
    ├── explore.py          # 探查 Tab (Polars lazy 管道)
    ├── query.py            # SQL Tab (DataCatalog 布局)
    ├── aggregate.py        # 聚合 Tab (DuckDB GROUP BY)
    ├── vision.py           # 可视化 Tab (plotext)
    └── report.py           # 报告 Tab (Rich)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

panzr-0.2.7.tar.gz (48.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

panzr-0.2.7-py3-none-any.whl (54.7 kB view details)

Uploaded Python 3

File details

Details for the file panzr-0.2.7.tar.gz.

File metadata

  • Download URL: panzr-0.2.7.tar.gz
  • Upload date:
  • Size: 48.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for panzr-0.2.7.tar.gz
Algorithm Hash digest
SHA256 e238625d4ca8046d1c0e7d5c98f6b4c9c1e329ac0d239f14450428b88eca241b
MD5 134808b1420fdb310bf67bfce1038818
BLAKE2b-256 c92e2c4fd1a246b1541fe4606e8574715d2307c9a4aeed27fec87d3aa982127f

See more details on using hashes here.

File details

Details for the file panzr-0.2.7-py3-none-any.whl.

File metadata

  • Download URL: panzr-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 54.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for panzr-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d393a1c6b81155c1b6b1d6b323b1cb399b5603f5d8d39e83b95aabc351786eaf
MD5 08c4090b9e27bf1d50e7412c5e49614c
BLAKE2b-256 c4146627ce126b4b1031a462a5c453a78f51cdd6963a40eebb3d3fd2252292a1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page