A Python tool for analyzing Zotero library tags using AI categorization and visualization. Use at your own risk.
- Extract and analyze tags from Zotero SQLite database
- AI-powered tag categorization via cborg, OpenAI, or Anthropic
- Generate word clouds from tags
- Export categorized tags in Obsidian markdown format
- Save unique tags for further analysis
- Clone the repository:
git clone https://github.com/gnzng/zotero_automate.git
cd zotero_automate- Install dependencies:
pip install -r requirements.txt- Set up environment variables:
cp .env-example .env
# Edit .env with your actual valuesYou need the following variables in your .env:
ZOTERO_DB_PATH: Path to your Zotero SQLite databaseBACKEND: One ofcborg(default),openai, oranthropic
Depending on the backend, set the corresponding variables:
| Backend | Required variables |
|---|---|
cborg |
CBORG_API_KEY, CBORG_BASE_URL, CBORG_MODEL |
openai |
OPENAI_API_KEY, OPENAI_MODEL |
anthropic |
ANTHROPIC_API_KEY, ANTHROPIC_MODEL |
cborg (https://cborg.lbl.gov/) is an OpenAI-compatible API and is the default backend.
Make sure zotero is closed, since we need database access. Run the main analysis:
python main.pyYou should be able to uncomment or comment the things you would like to run your analysis on.
unique_tags.txt: List of unique tags from your librarycategorized_tags.md: AI-categorized tags in markdown format, that works great to include in obsidian- Word cloud visualization
- Interactive network visualizer from tags and categories
- Tag categories as an interactive radar plot
Please feel free to open a PR or issue, I am looking forward to feedback.


