Skip to main content

High-throughput Zotero CLI focused on batch operations and automation

Project description

zop

一个面向批量操作和自动化场景的高吞吐 Zotero 命令行工具。

安装

从 PyPI 安装(推荐):

uv tool install zop-cli

也可用 pipx:pipx install zop-cli,或 pip:pip install zop-cli。安装后命令名为 zop

开发安装(可编辑,含开发依赖):

uv sync

贡献与维护流程见 CONTRIBUTING

配置

zop 按以下顺序查找配置(首个存在的文件生效):ZOP_CONFIG 环境变量 → 平台配置目录(platformdirs)→ ~/.config/zop/config.toml。平台配置目录:Windows 为 %LOCALAPPDATA%\zop\、macOS 为 ~/Library/Application Support/zop/、Linux 为 ~/.config/zop/。在任一位置创建 config.toml:

[zotero]
data_dir = "D:\\Program Data\\zotero"
library_id = "12345"
api_key = "your-api-key"

读取操作走本地 SQLite(data_dir/zotero.sqlite),写入操作走 Zotero Web API。 读取无需联网,也不需要 API key。

用法

zop collection list                    # 列出所有集合
zop collection list --tree              # 以父子树形展示
zop collection items ABC12345           # 列出某集合下的条目
zop collection create "新主题"          # 创建集合
zop collection create "子主题" --parent "新主题"
zop collection delete ABC12345          # 删除集合(级联)
zop collection reparent ABC12345 --parent "新父级"
zop collection move KEY1 KEY2 --to TARGET_KEY   # 移动条目
zop collection plan plan.json --dry-run        # 校验批量计划
zop collection plan plan.json --execute       # 执行批量计划

Agent skill

为 AI 编程助手(Claude Code、Codex、Cursor 等)配套了一个 agent skill,教 agent 如何调用 zop、解析 JSON 信封输出、以及批量 plan 的 dry-run → execute 流程:

npx skills add kingdomad/zop --skill zop -a claude-code -y

详见 skills/zop/SKILL.md

zot 的差异

  • 真正的批量:创建集合使用 Zotero 的批量 POST(每请求 50 条)
  • 有界并发 PATCH:移动条目使用并行 PATCH(默认 8 路并发),而非逐条顺序调用
  • 真正的 dry-run:zop collection plan --dry-run 会实际检查名称冲突、父级解析与条目存在性
  • reparent 支持:zop collection reparent 可用(zot 未暴露此能力)
  • 单条失败隔离:批量移动中某一条失败不会中断整批任务

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

zop_cli-0.2.1.tar.gz (91.9 kB view details)

Uploaded Source

Built Distribution

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

zop_cli-0.2.1-py3-none-any.whl (43.6 kB view details)

Uploaded Python 3

File details

Details for the file zop_cli-0.2.1.tar.gz.

File metadata

  • Download URL: zop_cli-0.2.1.tar.gz
  • Upload date:
  • Size: 91.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.15

File hashes

Hashes for zop_cli-0.2.1.tar.gz
Algorithm Hash digest
SHA256 c7b1821ac048fe8173d0bb7fe91598f43144c98d20b5c7140d88a645e1e294f4
MD5 a6eeca104b23e7fa0ba94542255c1a8b
BLAKE2b-256 368fcb3d4684c7921b06caee6771cf5d3504f42542e65a018e8a50bc26415aba

See more details on using hashes here.

File details

Details for the file zop_cli-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: zop_cli-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 43.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.15

File hashes

Hashes for zop_cli-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 409434f4e4bdffd0e1ee8fbcb692fe634fedcc58c733f49d642d8db9d72b61f2
MD5 6e2bd4dcd09740481805b4cedb4d5fe9
BLAKE2b-256 37801f93142ee55ab7fe3b53805d2186de846dfd6b2ea252e7b4d16977609496

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