Zotero Sync

by Frithjof Gressmann
5
4
3
2
1
Score: 59/100

Description

Category: 3rd Party Integrations

The Zotero Sync plugin integrates your Zotero library with Obsidian, enabling you to sync your Zotero items as markdown files. This plugin allows you to link, search, and access your Zotero library within Obsidian, but it is read-only, meaning no changes will be synced back to Zotero. By leveraging the Zotero web API, the plugin provides seamless access to your library's metadata and notes without requiring Zotero to be installed. Custom templates allow full control over the markdown file generation, making it a flexible tool for those who prefer working with Obsidian's note-taking system while keeping their Zotero data intact.

Reviews

No reviews yet.

Stats

39
stars
9,829
downloads
6
forks
988
days
282
days
282
days
3
total PRs
0
open PRs
0
closed PRs
3
merged PRs
18
total issues
3
open issues
15
closed issues
16
commits

Latest Version

9 months ago

Changelog

  • Support for local synchronization
  • Fix issue with non-group access API keys

README file from

Github

Obsidian Zotero Sync Client

This plugin leverages the Zotero Sync API to mirror your Zotero library as markdown files within Obsidian.

Zotero does not have to be installed since the data is directly obtained from Zotero's web API - all you need is an Zotero API key and internet connection when syncing. Alternatively, you can enable synchronization with your locally installed Zotero App.

Note that, by design, the synchronization is read-only and does not modify your Zotero library. Any changes to the markdown files will be lost and not synced back into Zotero. The rationale is to enable seamless Zotero integration via note linking and search while keeping all literature data within Zotero.

Alternatives

This plugin is for you if you are interested in linking to and searching through a read-only version of your Zotero library within Obsidian. Check out the following alternatives if you are interested in:

Usage

Install the plugin and enable it in the settings. Generate a Zotero API key and fill it in the plugin settings. Alternatively, you can enable the local API in your Zotero App and enable local sync (Zotero > Settings > Advanced > Allow other applications on this computer to communicate with Zotero).

The plugin will sync and cache all Zotero data incremently to minimize API usage.

After initial synchronization (which may take a while), all Zotero notes should appear in the configured vault folder.

Mobile devices

While this plugin is only available on desktop, any generated Zotero markdown files will be synced to connected mobile clients just like any other file.

Custom templates

By default, the markdown files are generated using a standard template which can be previewed and modified in the settings, giving you full control over the file generation.

https://github.com/frthjf/obsidian-zotero-sync-client/assets/5411942/81a58562-af7a-4d74-a1c8-459dc78e116f

During template generation, you can access the item data as well as the global $collections and $items mapping which contains all collections and items. Furthermore, the library information is available in the $library variable.

Example template

let n = '';

// generate properties
n += '---\n';
n += 'Tags:\n';
n += data.tags.map(t => {
    // remove spaces around hyphens and replace other spaces with underscores
    let formattedTag = t.tag.replace(/\s*-\s*/g, '-').replace(/\s+/g, '_');
    return '- "' + formattedTag + '"';
}).join('\n');

n += '\n';
n += 'Collections:\n'
if (data.super_collections) {
  console.log(data.super_collections)
  n += data.super_collections.map(k => '- ' + $collections.get(k).name).join('\n');
}
n += '\n';
n += 'Library: ' + $library.name;
n += '\n';
n += 'Authors: \n';
if (data.creators) {
	data.creators.forEach(author => {
	n += '- "[[People/' + author.firstName + ' ' + author.lastName + ']]"\n'; 
	});
}
"\"\n";
n += '---\n';

// generate content
n += data.marker;
n += '\n\n';
n += '## Abstract ' + '\n' + data.abstractNote + '\n\n';
n += '\n\n';
if (data.children) {
	const notes = data.children.filter(
		c => c.itemType.toLowerCase() == 'note'
	)
	notes.forEach(c => {
		n += c.note_markdown + '\n\n';
	});
}
return n;

Acknowledgements

This plugin uses the excellent retorquere/zotero-sync package for the Zotero API integration.

Similar Plugins

info
• Similar plugins are suggested based on the common tags between the plugins.