Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ build/
.pytest_cache
.coverage

# Linting
.ruff_cache

# Data/output
data
output/
Expand Down
49 changes: 33 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Tools for extracting and formatting bibliographic data from Zotero databases.

Reads directly from Zotero's local SQLite database — no API key needed. Export collections as CSV or APA-formatted references, generate PDF cover images with thumbnails, and extract annotated PDFs with baked-in highlights and markdown notes. Includes a CLI for common workflows and a Python API for custom pipelines.

## Project Structure

```
Expand All @@ -20,20 +22,27 @@ zotlib/
├── scripts/ # Utility scripts
│ ├── extract-annotations.js # Annotation extractor (interactive + headless)
│ ├── create-parent-item.js # Create parents for standalone PDFs
│ ├── run-extract.sh # Shell wrapper for headless extraction
│ └── generate_schema_docs.py # Generate docs/schema.md
├── docs/ # Documentation
│ └── schema.md # Database schema reference
│ └── run-extract.sh # Shell wrapper for headless extraction
├── tests/ # Test suite
└── pyproject.toml # Project configuration
```

## Installation

From source:

```bash
git clone https://github.com/gitronald/zotlib.git
cd zotlib
uv sync
```

As a dependency:

```bash
uv add git+https://github.com/gitronald/zotlib.git
```

## Configuration

Run `zotlib init` to auto-discover Zotero paths and save them to `zotlib.toml`:
Expand Down Expand Up @@ -66,7 +75,22 @@ Path resolution priority (for both database and PDFs dir):

## CLI Commands

### Export data
### Explore

Browse collections and inspect database schema. The `show-tables` command documents Zotero's largely undocumented SQLite table structure, including column descriptions and types.

```bash
# List available collections
zotlib show-collections

# Show database tables
zotlib show-tables
zotlib show-tables items
```

### Export

Export collection data in multiple formats. Supports linked attachments via `--pdfs-dir` for PDFs stored outside Zotero's default storage.

```bash
# Export all tables as CSV
Expand All @@ -80,25 +104,18 @@ zotlib export-apa -c publications

# Generate cover images and thumbnails
zotlib export-covers -c publications
zotlib export-covers -c publications -p "/path/to/linked-pdfs/"

# Export annotated PDFs and markdown notes
zotlib export-annotations -c mycollection
zotlib export-annotations -c mycollection -p "/path/to/linked-pdfs/"
```

### Explore and manage
### Backup

```bash
# List available collections
zotlib show-collections

# Show database tables
zotlib show-tables
zotlib show-tables items
Archive the entire Zotero data directory as a compressed `.tar.bz2` file with a progress bar. Saves to `data/backups/zotero-YYYY-MM-DD.tar.bz2` by default. Use `-o` to specify a custom output path or `-d` to point to a different database.

# Back up the Zotero data directory
```bash
zotlib backup
zotlib backup -o ~/backups/zotero-2026-03-21.tar.bz2
```

### Output structure
Expand Down
177 changes: 0 additions & 177 deletions docs/schema.md

This file was deleted.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "zotlib"
version = "0.4.0"
version = "0.4.1"
description = "Extract and format bibliographic data from Zotero databases"
readme = "README.md"
requires-python = ">=3.10"
Expand Down
48 changes: 0 additions & 48 deletions scripts/generate_schema_docs.py

This file was deleted.

2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion zotlib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Zotlib - Extract and format bibliographic data from Zotero databases."""

__version__ = "0.4.0"
__version__ = "0.4.1"

from zotlib.database import ZoteroDatabase
from zotlib.extractors import (
Expand Down
Loading