Skip to main content

ZotMD

ZotMD synchronizes a personal Zotero library and its PDF annotations to Obsidian-native Markdown. It reads metadata and annotations through the Zotero Web API, writes one note per item with a Better BibTeX citation key, and preserves user text inside an explicit Notes region.

Requirements

  • macOS and Python 3.13 or newer. Other platforms are best effort.
  • A personal Zotero library. Group libraries are not supported.
  • Better BibTeX citation keys.
  • A dedicated Zotero API key with personal-library read access and no write access.
  • Internet access during synchronization. Zotero Desktop does not need to be running.

Install

Install ZotMD with uv:

uv tool install zotmd
zotmd config
zotmd sync --full --dry-run
zotmd sync --full

Run zotmd sync for subsequent incremental synchronizations. ZotMD detects metadata changes, child-only annotation and attachment changes, citation-key renames, and removals.

Credentials

Interactive setup can store the API key in the owner-only configuration file. To keep it out of the file, set it in the environment before setup and future commands:

export ZOTMD_API_KEY="your-read-only-key"
zotmd config

ZOTMD_API_KEY takes precedence over a stored key and is never copied into the configuration file by setup.

Generated Notes

ZotMD owns canonical YAML frontmatter and all generated body content except text between these boundaries:

## Notes
<!-- zotmd:notes:start -->
Your notes remain here.
<!-- zotmd:notes:end -->

## Annotations

Only content inside the boundaries is preserved on later syncs. Each annotation links to its own Zotero attachment. Attachments and PDFs are linked, not copied.

Safety

zotmd sync --dry-run performs Web API and local reads but does not create directories, migrate state, write notes, move files, delete files, or advance checkpoints. Any malformed API record, target collision, rendering error, filesystem error, or state error produces exit status 1 and leaves the library checkpoint pending.

ZotMD 0.4 requires fresh state and does not accept the old zotero.library_type setting. If upgrading from 0.3, rename the old output directory as a backup or select a distinct empty output directory, archive the old sync.sqlite, and rerun zotmd config to rewrite config.toml for a personal library before starting a fresh full sync. Do not delete the old notes first, and keep the backups until the rebuilt library has been checked.

Documentation

See the ZotMD documentation for setup, configuration, template context, generated metadata, commands, and troubleshooting.

License

ZotMD is available under the MIT License.

Metadata

Release files for zotmd 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zotmd 0.4.0
File Size Uploaded
zotmd-0.4.0.tar.gz 158.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for zotmd 0.4.0
File Interpreter ABI Platform
zotmd-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 216.7 kB

Release files / zotmd-0.4.0.tar.gz

Download URL zotmd-0.4.0.tar.gz
Size 158.2 kB
Tags Source
SHA-256 checksum
How to use checksums
537a9238a1ef5d7ec4dace25a173f4ca53e34d0f89cc43748a8f5a4853f06838
BLAKE2b-256 checksum
How to use checksums
f8084bbf520286018833f2bbd472efbab489e005a3873d04a5036212125f2a19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / zotmd-0.4.0-py3-none-any.whl

Download URL zotmd-0.4.0-py3-none-any.whl
Size 58.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3668e59c3aa7337ca5d1f37abe15f270dd8711d96a34f5003d97f5c2c306ebe5
BLAKE2b-256 checksum
How to use checksums
68ff96ececde0c2559fe5cb99b2df647fc077d2871acbb29ede79fdff62a3358
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.5.1

2 release files

0.5.0

2 release files

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page