Skip to main content

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

Project description

🐼🔧 Panzr v0.2.4

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

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


产品定位

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

v0.2.4 核心升级: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.5.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.5-py3-none-any.whl (54.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: panzr-0.2.5.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.5.tar.gz
Algorithm Hash digest
SHA256 0d7704655f7774f227dc978acdff8d2646de317dc7af65358f33891123352657
MD5 a73d0c047cb46dea3b820fab8a74aec2
BLAKE2b-256 a3a8a688ba0a8bb98d02745eb57fd521c5f0e0986b673df8299d46195691cbbb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: panzr-0.2.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b3cd3f72c360d327e8c0835d0cd104721ccfd2130ec4a9d859f189554184addc
MD5 37fee0bfff780e45af001c3d570968a4
BLAKE2b-256 795faa273065803142ba3c2dd4445b5cade0de2f62a5301e21898480b97a5a59

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