mirror of
https://github.com/open-webui/oikb.git
synced 2026-11-05 01:27:25 +00:00
[PR #61] [CLOSED] feat(zotero): add Zotero connector #95
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/oikb#95
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/oikb/pull/61
Author: @thiswillbeyourgithub
Created: 6/22/2026
Status: ❌ Closed
Base:
main← Head:add-zotero📝 Commits (10+)
ea4a17efeat(zotero): add Zotero connector03718a1feat(cli): dispatch zotero: sources9cf2dc4build: add zotero optional dependency groupa330a84docs: document Zotero connectore709a84docs: clarify ZOTERO_EXCLUDE paths are relative to synced rootddec1d8chore: gitignore perso/ scratch folder5870306fix(sync): create directories parent-first by sorting the mkdir lista793298fix(zotero): never let an un-fetchable attachment abort the whole sync9d17fbdfeat(sync): treat unavailable source files as warnings, not fatal errors00b26bffeat(zotero): add ZOTERO_INCLUDE_NOTES / ZOTERO_INCLUDE_ANNOTATIONS📊 Changes
12 files changed (+1124 additions, -13 deletions)
View changed files
📝
.gitignore(+3 -0)📝
CHANGELOG.md(+7 -0)📝
README.md(+45 -1)📝
pyproject.toml(+3 -0)📝
src/oikb/cli.py(+25 -0)📝
src/oikb/connectors/__init__.py(+14 -0)➕
src/oikb/connectors/zotero.py(+543 -0)📝
src/oikb/daemon.py(+2 -0)📝
src/oikb/sync.py(+39 -12)➕
tests/test_sync_warnings.py(+111 -0)➕
tests/test_zotero_notes_annotations.py(+199 -0)➕
tests/test_zotero_unfiled.py(+133 -0)📄 Description
Summary
Adds a Zotero connector to oikb. It syncs the text of the PDF attachments of items in a Zotero collection (and its subcollections) into an Open WebUI Knowledge Base, mapping the Zotero collection hierarchy onto KB directories. It is read-only with respect to Zotero: it never modifies, deletes, or adds anything to the library.
This is a Claude Code port of an earlier standalone tool I wrote, https://github.com/thiswillbeyourgithub/openwebui-knowledge-zotero-sync, reworked to fit oikb's connector interface.
Zotero connector
zotero:<hierarchy>source scheme.%%separates collection names(e.g.
zotero:Research%%Machine Learning); a barezotero:syncs every top-level collection.ZOTERO_CHECKSUM:version(cheap, hashes the Zotero item version, no download, default) orcontent(hashes the extracted text).ZOTERO_EXCLUDEskips subcollections, relative to the synced root.ZOTERO_LIBRARY_ID,ZOTERO_API_KEY,ZOTERO_LIBRARY_TYPE,ZOTERO_CHECKSUM,ZOTERO_EXCLUDE.pip install oikb[zotero](pyzotero + pymupdf).Sync change: unavailable source files are warnings, not fatal errors
A file the source advertises in its manifest but cannot provide content for (e.g. a Zotero attachment whose bytes aren't in storage: a web link, a linked file, or a WebDAV-only item) is a source-side data gap, not an oikb failure. Previously any such case landed in
result.errorsand exited the whole sync with code 1.This PR adds a
SourceFileUnavailableexception to the connector base.run_synccatches it specifically (no retry) and routes the file to a newresult.warningslist instead of
result.errors, so a sync whose only problems are unavailable source files still succeeds (exit 0). Any otherread_file()exception still fails the run exactly as before. The CLI and daemon surface warnings separately from errors; onlyresult.errorsaffects the exit code / success status.Tests
tests/test_sync_warnings.pycovers all three paths: the Zotero missing-file mapping toSourceFileUnavailable, warning routing inrun_sync, and that a generic read failure is still an error.Notes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.