Write, tag, annotate, and edit a local Zotero SQLite database.
E:\Refer.Hub\zotero.sqlite--backup before any write operation. Backups saved to E:\Refer.Hub\backups/--backup — the script will refusescripts/write_items.py — All write operationsbash
py -3 scripts/write_items.py --backup "E:\Refer.Hub\zotero.sqlite"
This saves a timestamped backup before any write. Always do this first.
First find the item key from zotero-browse skill, then:
bash
py -3 scripts/write_items.py --backup "E:\Refer.Hub\zotero.sqlite" \
--add-tag ZL42EGES "NAFLD" "FGF15" "silymarin"
bash
py -3 scripts/write_items.py --backup "E:\Refer.Hub\zotero.sqlite" \
--add-note ZL42EGES "This paper shows FGF15 is the key mediator of silibinin's anti-NAFLD effect."
bash
# Update title
py -3 scripts/write_items.py --backup "E:\Refer.Hub\zotero.sqlite" \
--set-field ZL42EGES title "New Title Here"
# Update date
py -3 scripts/write_items.py --backup "E:\Refer.Hub\zotero.sqlite" \
--set-field ZL42EGES date "2024"
# Update journal
py -3 scripts/write_items.py --backup "E:\Refer.Hub\zotero.sqlite" \
--set-field ZL42EGES publicationTitle "Journal Name"
# Update DOI
py -3 scripts/write_items.py --backup "E:\Refer.Hub\zotero.sqlite" \
--set-field ZL42EGES DOI "10.1234/example"
bash
py -3 scripts/write_items.py --backup "E:\Refer.Hub\zotero.sqlite" \
--new-item journalArticle \
--title "Example Title" \
--authors "John Doe" "Jane Smith" \
--date "2024" \
--journal "Nature Medicine" \
--doi "10.1038/s41591-024-0001-z"
bash
py -3 scripts/write_items.py --list-fields
bash
py -3 scripts/write_items.py --item-info ZL42EGES
Run --list-fields to see all. Common fields:
fieldNameDescriptiontitlePaper titlecreatorsAuthors (use --authors for new items)datePublication date (YYYY or YYYY-MM-DD)publicationTitleJournal nameDOIDigital Object IdentifierurlWeb URLabstractNoteAbstracttagsTags (use --add-tag instead)volumeVolume numberissueIssue numberpagesPage rangepublisherPublisherISBNISBNISSNISSNjournalAbbreviationJournal abbreviation
When creating new items, use one of:
journalArticle (default for papers)bookbookSectionconferencePaperthesisreportwebpagenoteUse zotero-browse skill to find the paper's attachment key
Run with --backup first
Add tags: bash
py -3 scripts/write_items.py --backup "E:\Refer.Hub\zotero.sqlite" \
--add-tag ZL42EGES "NAFLD" "FGF15" "biomarker"
Confirm backup was created at E:\Refer.Hub\backups/
--backup — always use it