Skip to content

Tancy2024/zotero_to_obsidian

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

📚 Zotero → Obsidian 文献笔记生成器

自动读取 Zotero 高亮 → Claude AI 分析 → 一键生成 Obsidian 笔记


🗂️ 文件说明

zotero_to_obsidian/
├── zotero_sync.py      ← 主程序(Python)
├── 一键同步.ps1         ← Windows 一键启动脚本
└── README.md           ← 本说明文件

⚡ 快速开始(5步)

第1步:填入 API Key

打开 zotero_sync.py,第22行改成你的真实 Key:

ANTHROPIC_API_KEY = "sk-ant-api03-xxxxxx"替换这里

获取 Key:https://console.anthropic.com/

第2步:确认 Zotero 数据库路径

打开 Zotero → Edit → Preferences → Advanced → Files and Folders 查看 "Data Directory Location",确认与脚本第26行一致:

ZOTERO_DB = r"C:\Users\a1878184\Zotero\zotero.sqlite"

第3步:安装 Python 依赖

打开 PowerShell,运行:

pip install anthropic

第4步:在 Obsidian 里创建文件夹

在你的 Vault 里创建一个名为 Literature Notes 的文件夹

第5步:运行!

方法A(推荐): 右键点击 一键同步.ps1 → 用 PowerShell 运行

方法B: 在终端直接运行:

python zotero_sync.py

📋 使用说明

命令 说明
python zotero_sync.py 处理最近修改的10篇文献
python zotero_sync.py --all 处理所有有高亮的文献
python zotero_sync.py --title "causal" 搜索标题含 "causal" 的文献
python zotero_sync.py --dry-run 预览笔记内容,不写入

📝 生成的笔记格式

---
title: "论文标题"
authors: ["作者1", "作者2"]
year: 2024
journal: "期刊名"
tags: [literature, unread]
---

# 论文标题

> 一句话总结(30字内)

## 📌 核心方法
## 💡 主要贡献  
## ⚠️ 局限性
## ✅ 优势
## 🔗 与我研究的关联

## 🖍️ 我的高亮摘录
> "你在 Zotero 里高亮的文字..." (p.5)

🔧 常见问题

Q: 提示找不到 Zotero 数据库 → 先关闭 Zotero,再运行脚本(SQLite 不能同时被两个程序读取)

Q: API Key 错误 → 确认 Key 以 sk-ant- 开头,且 console.anthropic.com 账户有余额

Q: 笔记没有出现在 Obsidian → 检查 Obsidian CLI 是否开启:Settings → General → Command line interface

Q: 高亮没有被读取 → 确认是用 Zotero 内置 PDF 阅读器高亮的(不是外部软件)


💡 高亮颜色含义(Zotero 内置)

颜色 建议用途
🟡 黄色 重要内容
🔴 红色 非常关键
🟢 绿色 方法描述
🟣 紫色 理论/定义
⚪ 灰色 背景信息

Made for Hazel's PhD Research · Causal Inference & CPS Security

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors