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.4.tar.gz (95.7 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.4-py3-none-any.whl (45.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for zop_cli-0.2.4.tar.gz
Algorithm Hash digest
SHA256 299825d5430efde13ab74fd50b01d596ae6012d5170cad1f83a5ae54bdd626d7
MD5 689e8a4306aa39356523b2431b31b128
BLAKE2b-256 1599c4ad5bda96501fabc22f005da00379a33f01c98e7484a33dade6740f9c3e

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for zop_cli-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 fc70de93a0041d35254b8f1417648d35c6300d5c2b633c93783641eb0e2d0155
MD5 df326f29f8db29e3e88b5ec5828e458c
BLAKE2b-256 b7af7c2be3c13dfaac613911ec6e0cb8442b6c04329ca3b0fd110138db8a2ecb

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