Skip to content

gnzng/zotero_automate

Repository files navigation

Zotero Automation

A Python tool for analyzing Zotero library tags using AI categorization and visualization. Use at your own risk.

Features

  • 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

Installation

  1. Clone the repository:
git clone https://github.com/gnzng/zotero_automate.git
cd zotero_automate
  1. Install dependencies:
pip install -r requirements.txt
  1. Set up environment variables:
cp .env-example .env
# Edit .env with your actual values

You need the following variables in your .env:

  • ZOTERO_DB_PATH: Path to your Zotero SQLite database
  • BACKEND: One of cborg (default), openai, or anthropic

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.

Usage

Make sure zotero is closed, since we need database access. Run the main analysis:

python main.py

You should be able to uncomment or comment the things you would like to run your analysis on.

Output Files

  • unique_tags.txt: List of unique tags from your library
  • categorized_tags.md: AI-categorized tags in markdown format, that works great to include in obsidian
  • Word cloud visualization

wordcloud

  • Interactive network visualizer from tags and categories

network

  • Tag categories as an interactive radar plot

radar

Contributing

Please feel free to open a PR or issue, I am looking forward to feedback.

About

Automatic analysis of zotero tags using LLM AI and RAG

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages