Zotcurate (zotc) — a command-line tool for creating/syncing Zotero collections from citation keys

Hi folks!

I'm releasing a tool called zotcurate (zotc) that addresses something I've found missing from the Zotero ecosystem: a way to send information (particularly collection lists) back to Zotero from rour writing, note-making, and thinking environments.

The outbound pipeline — getting references out of Zotero into Quarto, R Markdown, Obsidian, and so on — is extremely well-served. Better BibTeX, Zotero Integration, ZotLit, zotxt, and others all handle that direction beautifully. But if you finish a manuscript and want a Zotero collection containing exactly the 40 papers you cited, or you've refined a reading list in Obsidian and want it mirrored as a Zotero collection, there's currently no automated path. You do it by hand.
zotc provides the automation for this workflow.

GitHub: https://github.com/jeetsukumaran/zotcurate
[Zotcurate](https://github.com/jeetsukumaran/zotcurate)

How it works
The tool reads citation keys from whatever you're working in — a .qmd or .rmd document, a .bib file, a CSV reading list, a plaintext file, even stdin — and uses the BetterBibTeX SQLite database (read-only) to resolve those keys to Zotero item keys. It then drives the official Zotero Web API to create, populate, or synchronize collections.
All write operations are dry runs by default. You see exactly what would happen before passing --execute.

```
# Preview new collection from citations in "paper.qmd"
zotc collection create "Projects/PhyloReview" paper.qmd
# Create new collection from citation in "paper.qmd"
zotc collection create "Projects/PhyloReview" paper.qmd --execute
# Collections can be compiled from other sources:
zotc collection create "Projects/PhyloReview" references.bib --execute
zotc collection create "Projects/PhyloReview" references.yaml --execute
zotc collection create "Projects/PhyloReview" references.csv --execute
# Keep a collection in sync: update in-situ
zotc collection replace "Reading/Phylogenetics" curated.bib --execute
# Or just preview what would change: differences with respect to Zotero collection
zotc collection diff "Reading/Phylogenetics" curated.bib
```

On a standard Zotero install, the BBT database path and your library ID are auto-detected — usually only your API key needs to be supplied.

What it requires

Python 3.10+, no third-party dependencies
Zotero with the Better BibTeX plugin installed
A Zotero API key (from zotero.org/settings/keys)


Supported input formats
It can extract citation keys from BibTeX, CSV, TSV, YAML, JSON, plaintext, and Markdown (handling Pandoc @key, [@key; @key2], Obsidian [[path/@key]], and [text](@key.md) syntax).
Sign In or Register to comment.