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.3.tar.gz (93.3 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.3-py3-none-any.whl (44.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for zop_cli-0.2.3.tar.gz
Algorithm Hash digest
SHA256 3848945132d622249e25a8fac1fa0df37abb0ce48b8d7646839d931b877f954b
MD5 620e6171ab1b879f3748d839e84fb665
BLAKE2b-256 94f0c8122c8e70c4fa1c635c01dce3703065b5e4e9d7754d5882b925a9ab3f51

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for zop_cli-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 90ea61c9ff90cb4777f976af0ce99f12519ac65ddcac81c29cc8e3d2cd5ae1db
MD5 0455c90a5d08056bda73147089e2b652
BLAKE2b-256 90a8b685c872eeaee7c833f982c12b64f261381f74e11d795e6ffef85e4e7426

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