首页龙虾技能列表 › zotero-browse — 技能工具

zotero-browse — 技能工具

v1.0.1

[自动翻译] Browse, search, and read papers from a local Zotero library. Use when the user wants to: (1) Search their Zotero library by title, author, or keyword,...

0· 53·0 当前·0 累计
by @lyononthemoon (Liang Guo)·MIT-0
下载技能包
License
MIT-0
最后更新
2026/4/10
安全扫描
VirusTotal
无害
查看报告
OpenClaw
安全
high confidence
The skill's code, runtime instructions, and resource needs are consistent with a local Zotero-browsing tool; it reads a local zotero.sqlite and PDF files and does not request secrets or network access.
评估建议
This skill appears to do what it says: query a local Zotero sqlite DB and extract PDF text. Before installing: (1) ensure you are comfortable granting the agent access to your local Zotero DB and storage folders (the code uses E:\Refer.Hub\... by default — change the --db/--db path or DEFAULT_DB/STORE constants if your library is elsewhere), (2) install Python 3 and PyMuPDF (fitz) in the environment you will run it in, (3) be aware the scripts will print PDF text to stdout or write extracted tex...
详细分析 ▾
用途与能力
Name/description match the actual behavior: the scripts query a local Zotero SQLite DB and locate PDFs in a local storage folder. The required binary (python3 with PyMuPDF) is appropriate. Note: the repository uses Windows-specific default paths (E:\Refer.Hub\zotero.sqlite and storage) which are plausible for the author's environment but will need adjustment on other machines.
指令范围
SKILL.md and the scripts stay within scope: they open the specified sqlite DB, list/search items, resolve storageHash folders, and extract PDF text with PyMuPDF. They do not access network endpoints, environment secrets, or unrelated system files. Note the instructions and code print paths and file sizes and prompt for an attachment key when using interactive search; they assume user consent to read local files.
安装机制
There is no install spec (instruction-only with code files). That is low-risk. The only external dependency is PyMuPDF (fitz), which must be installed in the Python environment before running; no remote downloads or archive extraction are performed by the skill itself.
凭证需求
The skill requests no environment variables or credentials. The operations require filesystem access to the Zotero DB and storage, which is proportionate to its stated purpose.
持久化与权限
always:false and user-invocable:true (default) — the skill is not force-included and does not modify other skills or system config. It performs read-only DB queries (PRAGMA read_only=ON) and reads files; it does not write to system-wide settings or other skills.
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv1.0.12026/4/10

No functional or documentation changes in this release. - Version bump to 1.0.1 with no detected file modifications. - All existing workflows, features, and usage remain unchanged.

● 无害

安装命令 点击复制

官方npx clawhub@latest install zotero-browse
镜像加速npx clawhub@latest install zotero-browse --registry https://cn.clawhub-mirror.com

技能文档

Read papers, search your library, and extract PDF content from a local Zotero database.

Database & Storage Locations

  • Database: E:\Refer.Hub\zotero.sqlite (4300+ items, 2112 stored PDFs)
  • PDF storage: E:\Refer.Hub\storage\{storageHash}/filename.pdf
  • Python stdlib sqlite3 for queries; fitz (PyMuPDF) for PDF reading

Scripts

  • scripts/query_items.py — Search and browse the library
  • scripts/read_pdf.py — Read PDF text by attachment key or title search

Both scripts are executable directly. Always use py -3 on Windows.


Common Workflows

1. Search library by keyword

py -3 scripts/query_items.py --search "FGF15"
py -3 scripts/query_items.py --search "fatty liver"

Returns: matching items with key, title, authors, date, attachment count.

2. Find attachment key for a paper, then read PDF

# Step 1: search to get the attachment key
py -3 scripts/query_items.py --search "Silibinin"

# Step 2: read the PDF (pass the attachment key shown in output) py -3 scripts/read_pdf.py ZL42EGES

3. Read PDF by title search

py -3 scripts/read_pdf.py --search "Silibinin" --pages 5

Prompts for which attachment key to open, then extracts text.

4. Library summary

py -3 scripts/query_items.py --summary

Shows total items and breakdown by type (journalArticle, book, etc.).

5. Recent additions

py -3 scripts/query_items.py --recent 10

6. Get item details by key

py -3 scripts/query_items.py --key ZL42EGES

7. Extract full PDF text to file

py -3 scripts/read_pdf.py ZL42EGES --output extracted.txt

Database Schema

For SQL query reference (schema, table structure, query examples), see:

📄 references/schema.md

Key tables: items, itemData, fields, itemDataValues, itemAttachments, itemTypes, creators, itemCreators, tags


PDF Resolution Logic

Zotero stores PDFs at E:\Refer.Hub\storage\{storageHash}/ where storageHash is the hash from itemAttachments.storageHash. The itemAttachments.path field stores the original filename but the folder is named by storageHash.

Direct open by key:

import sqlite3, fitz, os

DB = r"E:\Refer.Hub\zotero.sqlite" STORAGE = r"E:\Refer.Hub\storage"

conn = sqlite3.connect(DB, timeout=30) conn.execute("PRAGMA read_only=ON") cur = conn.cursor()

cur.execute(""" SELECT itemAttachments.storageHash FROM itemAttachments JOIN items ON itemAttachments.itemID = items.itemID WHERE items.key = ? AND itemAttachments.linkMode = 0 """, (key,)) row = cur.fetchone() if row and row[0]: folder = os.path.join(STORAGE, row[0]) files = [f for f in os.listdir(folder) if f.lower().endswith('.pdf')] if files: pdf_path = os.path.join(folder, files[0]) doc = fitz.open(pdf_path) text = "\n".join(page.get_text() for page in doc)


Tips

  • If database is locked, close Zotero application first
  • For long PDFs, use --pages N to extract just first N pages
  • PDF text extraction works for text-based PDFs; scanned PDFs need OCR
  • Use --info flag to get PDF metadata without extracting full text
  • Attachment keys are 8-character Zotero item keys shown in search results
数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制

了解定制服务