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.6.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.6-py3-none-any.whl (54.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: panzr-0.2.6.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.6.tar.gz
Algorithm Hash digest
SHA256 003b6aa70e92170f9f73a5fda03ec7f878e2e9c0d4e43446cd1045fb57065d4a
MD5 8f583d57a5aff123721d3dbc7e0ba51b
BLAKE2b-256 962ff33f2a055cf7cc4cc171d8699d0bb2d19499792f9bf479129f77ccc21714

See more details on using hashes here.

File details

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

File metadata

  • Download URL: panzr-0.2.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 1274791a3f6f1f960521eee5b0a390a58a8fef59720913364b8436696de642c6
MD5 1e75a59911a598d05a84f5da9e1af783
BLAKE2b-256 834ea5902e95ec116221a2e3af12dfd403d6afc24a24e8517868d74863d1514b

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