npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-excel-slim

v0.1.0

Published

DeepSeek Harness 超大 Excel 瘦身插件:大表(100MB+ 汽配表)读一次即生成压缩摘要 + 磁盘归档,跨会话复用,excel_slim / excel_query / excel_cache 三个工具替代反复整表 dump,大幅减少 token 消耗。

Readme

📦 dsh-excel-slim

DeepSeek Harness 超大 Excel 瘦身插件(专治 100MB+ 汽配/目录大表烧 token): 读一次 → 压成几 KB 摘要 + 磁盘压缩归档,之后所有会话直接命中缓存, 不再反复把 200MB 内容灌进上下文。


为什么能省钱

你之前的工作流(会话日志实锤):

每次对话:python3 + openpyxl 重新解析 200MB xlsx
        → 把整表/大段内容 print 进对话
        → 之后每一轮请求都要把这坨内容重新发送/计费
        → 一次对话几十块,缓存命中价也压不住体积

装上之后:

第一次调用 excel_slim("xxx.xlsx"):
  流式解析一次(openpyxl read_only,内存有界)→ 生成
    · digest.json          几 KB:表结构 + 每列类型/唯一值/TOP 值 + 前几行预览
    · <sheet>.jsonl.gz     全部行的 gzip 压缩归档(不含图片,体积只有原表的几%~十几%)
  全部落在 ~/.dsh/dsh-excel-slim/cache(按 路径+mtime+大小 指纹缓存,文件一变自动重建)

之后任何会话:
  excel_slim(...)  → 秒回缓存摘要(不再解析大文件)
  excel_query(...) → 在压缩归档里按 search / match / stats 只取少量命中行

提供的三个工具

| 工具 | 作用 | | --- | --- | | excel_slim(path, rebuild?) | 返回压缩摘要:工作表、行列数、每列类型/唯一值/TOP 值/样例、预览行。首次构建,之后秒回缓存 | | excel_query(path, sheet?, mode?, search?, search_columns?, match_column?, match_value?, column?, columns?, limit?, offset?, top_n?) | 在缓存归档里查行 / 统计列分布,只返回少量结果 | | excel_cache(action?, path?) | 查看缓存清单 / 清理缓存 |

示例(模型会这么用,你也可以在提示词里引导)

1. excel_slim("Model 3- 插图(1)-OK(1).xlsx")
2. excel_query(path, sheet="M3目录", search="下摆臂", columns=["OE编号","零件名","车型","价格"], limit=20)
3. excel_query(path, sheet="内部零件表", mode="stats", column="供应商", top_n=10)
4. excel_query(path, sheet="M3目录", match_column="车型", match_value="Model Y 新版", limit=50)

安装

# 本地 tgz
dsh plugin --profile web add "/Users/relphchris/Desktop/DeepSeek Harness/dsh-excel-slim分享包/dsh-excel-slim-0.1.0.tgz"
# 或源码目录
dsh plugin --profile web add "/Users/relphchris/Desktop/DeepSeek Harness/dsh-excel-slim"
# 或手动:解包到 ~/.dsh/profiles/web/node_modules/dsh-excel-slim,
#         并把 cordis.patch.yml 的 insert 追加进 ~/.dsh/profiles/web/cordis.patch.yml

装完重启 dsh web 并刷新页面。

首次解析很慢?正常

200~335MB 的表第一次构建需要几分钟(流式读 + 压缩),进度会打到宿主日志。 之后永远秒回。构建期间再调用同一文件会提示「构建中,稍候重试」。

配置(可选)

在 profile 的 cordis.patch.yml 里给插件行加 config:

- insert:
    - id: excel-slim
      name: dsh-excel-slim
      config:
        cacheRoot: /path/to/cache      # 默认 ~/.dsh/dsh-excel-slim/cache
        python: /opt/anaconda3/bin/python3   # 默认 auto:自动找带 openpyxl 的 python
        maxScanRows: 500000            # 单次查询最多扫描行数
        maxQueryRows: 200              # 单次查询最多返回行数
        maxDigestChars: 9000           # 摘要文本上限(字符)

找不到 openpyxl 时会自动 python3 -m venv + pip install openpyxl(一次性); 本机建议直接用 /opt/anaconda3/bin/python3(已带 openpyxl 3.1.5 + pandas)。

隐私与数据

  • 全部本地:缓存只在你自己的 ~/.dsh/dsh-excel-slim/cache
  • 不读取、不保存任何 API Key;不外发任何数据
  • 归档不含图片、样式、公式,只含单元格值(含公式的取缓存值)

卸载

dsh plugin --profile web remove dsh-excel-slim
rm -rf ~/.dsh/dsh-excel-slim

配套建议(省钱三件套)

  1. 把官方自带的「自动压缩 + 工具结果剪枝 + /compact」打开(web 配置里默认是关的): 在 ~/.dsh/profiles/web/cordis.patch.yml 加:

    - update:
        - id: compaction-basic
          disabled: false
        - id: command-compact
          disabled: false
        - id: tool-result-pruner
          disabled: false
          config:
            thresholdChars: 8192
            headChars: 4096
            tailChars: 1024
        - id: spill-policy
          config:
            maxInlineBytes: 20000

    效果:历史自动压缩成摘要;>20KB 的工具输出自动「首尾预览 + 全文落盘」;对话太长时可手动 /compact。

  2. 新会话直接吃缓存:把大表路径写进开场提示词, 例如「先 excel_slim("/Users/.../xxx.xlsx") 看结构,需要时再 excel_query,不要重新解析这个大文件」。

  3. 给本插件配置 python:config.python: /opt/anaconda3/bin/python3(避免首次构建时临时装 openpyxl)。