storizzi/notes-exporter
About
Export Apple Notes to html, plain text, Markdown (eg for Obsidian), PDF, and DOCX (word) including images / attachments
Productivity & AutomationMeasured star growth
- in 24h
- +1
- in 7 days
- +3
- in 15 days
- +3
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalApple Notes Export Tool
Version 1.7.1 (released 27 November 2026) — see Releases
Export Apple Notes to HTML, Markdown, PDF, Word and EPUB with images intact, or run it as a service that other programs use over HTTP. Search across notes by text, date, or AI-powered semantic similarity. Edit markdown locally and sync changes back to Apple Notes.
Thanks to @sulkaharo for performance optimizations and feature improvements!
Works on macOS only (uses AppleScript). Requires the Notes app.
- Released under MIT license
- Release History
- Possible future features
Guides
| Guide | For | Covers |
|---|---|---|
| Basic Guide | Getting started | Export, search, scheduling, reconciliation |
| Advanced Guide | Power users | Bidirectional sync, AI search, Qdrant, JSON output |
| Technical Reference | Developers | All CLI options, env vars, JSON schemas, file structure |
| Integration Guide | Other programs | The manifest, JSON Lines events, exit codes, locking |
| Service API | Other programs, over HTTP | notes-exporter serve: runs, schedule, manifest and files, users and API keys |
| AI assistants (MCP) | Claude Code, Claude Desktop, MCP clients | ./setup_mcp.zsh or the web page's MCP tab: search, read, export and (optionally) edit notes from an assistant |
Quick Start
# Install
brew install git python
git clone https://github.com/storizzi/notes-exporter.git
cd notes-exporter
# Export all notes to Markdown (the first run creates .venv and installs the dependencies)
./exportnotes.zsh --convert-markdown
# Search your notes
./exportnotes.zsh --query "meeting notes"
./exportnotes.zsh --query --modified-within 7d -l "."
Output goes to ~/Downloads/AppleNotesExport/ by default. Use python3, not
python: macOS has no python command.
What It Does
Export from Apple Notes to multiple formats:
- Raw HTML, processed HTML (with extracted images), plain text
- Markdown (for Obsidian, etc.), PDF, Word (DOCX), EPUB (one book per note, or one per folder)
- Incremental — only re-exports changed notes (~3x faster than full export)
- Nested folders kept as nested directories (
--folder-hierarchy) - Images optionally converted (
--image-format jpeg),#tagsread with--tags
Search across all exported notes:
- Text and regex search with context, date filtering, image filtering
- AI-powered semantic search via Qdrant vector database
Sync changes back to Apple Notes:
- Edit exported markdown files locally, push changes back
- Conflict detection with
.conflict.mdsidecars - Create new Apple Notes from local markdown files
Manage your note collection:
- Reconciliation to find orphans, missing files, and mismatches
- Qdrant vector indexing for semantic search
- Scheduled automatic exports via launchd
- Machine-readable JSON Lines output from all commands
- A
manifest.jsondescribing every note and its files, for other programs (INTEGRATION.md)
Serve your notes to other programs and AI assistants:
- A service that exports on a schedule and serves notes over an authenticated HTTP API, with a web page (SERVICE-API.md)
- An MCP server so Claude Code, Claude Desktop and other assistants can search, read and (if you allow it) change notes (MCP.md)
Releases
The latest first; every change, and how to upgrade, is in RELEASES.md.
Recent
| Version | Date | |
|---|---|---|
| 1.7.1 | 27 Nov 2026 | A held change can still be looked up once it has been approved or rejected |
| 1.7.0 | 27 Nov 2026 | AI assistants (MCP): Claude Code, Claude Desktop or any MCP client can search, read and export notes (MCP.md). Safer writing: a backup in Notes before every change, deleting, limits on mass changes and an approval list |
| 1.6.0 | 14 Nov 2026 | Update and restart the service from a client or the web page |
| 1.5.1 | 14 Nov 2026 | Settings for clients, and writing notes through the service |
Milestones
| Version | Date | |
|---|---|---|
| 1.5.0 | 11 Nov 2026 | The service: notes-exporter serve exports on a schedule and serves the notes over an authenticated HTTP API, with a web page (SERVICE-API.md). EPUB output |
| 1.4.0 | 11 Nov 2026 | Nested folders, manifest.json, JSON Lines events and exit codes for other programs (INTEGRATION.md), reliable deletions and moves |
| 1.3.0 | 18 Mar 2026 | Sync edited Markdown back to Notes, text and AI (Qdrant) search, reconciliation |
| 1.0.0 | 10 Jun 2025 | Incremental export and deletion tracking |
Setup
Prerequisites
brew install git python
Optional (for specific features):
- Google Chrome — for PDF conversion
- Pandoc — for Word conversion (
brew install pandoc) - Docker + Ollama — for AI search (setup guide)
Install
git clone https://github.com/storizzi/notes-exporter.git
cd notes-exporter
exportnotes.zsh creates a virtual environment in .venv and installs
requirements.txt into it on first use (and again when the file changes).
To manage it yourself:
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
./exportnotes.zsh --venv-dir .venv ... # or --python .venv/bin/python
Homebrew's Python refuses a plain pip install outside a virtual environment.
First Export
./exportnotes.zsh --convert-markdown
macOS will ask whether your terminal may control Notes on the first run; click Allow. A scheduled or scripted run should use --non-interactive, which exits with code 3 instead of waiting at that prompt.
Running as a service
python3 -m venv .venv && .venv/bin/pip install -r requirements.txt
./notes-exporter user add simon --admin --generate-password --keychain # the password goes to your login Keychain
./notes-exporter serve # http://127.0.0.1:8790/
./notes-exporter permission request # (another terminal, at the Mac) click Allow when macOS asks
./notes-exporter apikey create --name FunHoard --scopes read,run,settings \
--env-file ~/dev/storizzi/repos/apps/desktop/media-server/backend/.env --env-var NOTES_EXPORTER_API_KEY
./notes-exporter service install --replace-legacy # stop the serve above first
./notes-exporter permission request # once more: the LaunchAgent asks as its own process
- The first admin.
--generate-password --keychainmakes a strong password and keeps it in your login Keychain asnotes-exporter(open the Passwords app to see it); it is never printed. Without them you type one. - Serve. Open http://127.0.0.1:8790/, sign in, and set the export folder, formats and schedule under Settings.
- The Notes permission. macOS must let the service control Notes.
permission request(or Ask macOS for access to Notes on the web page) makes macOS show its dialog on this Mac; click Allow. The permission belongs to the process that asks, so it is asked by the running service, and asked again once the LaunchAgent runs it. Until it is allowed, scheduled runs fail with exit code 3 rather than wait at a prompt. - An API key for another program, written straight into its env file (mode 0600, other lines untouched, only the key's prefix shown); add
--replaceto rotate it later. Programs send it asAuthorization: Bearer ne_…; keys are never accepted in a URL. - Keep it running after you log in:
service install(a LaunchAgent,com.storizzi.notes-exporter). If you scheduled exports withsetup_launchd.pybefore, install refuses until that job is gone;--replace-legacyunloads it and moves its plist aside (it says what it will do first).
The service listens on this Mac only unless you pass --allow-remote; use a reverse proxy with HTTPS for that. Everything else, the endpoints and the settings are in SERVICE-API.md.
Tests
python3 -m venv .venv && .venv/bin/pip install -r requirements.txt
# Run all tests
.venv/bin/python -m pytest -v
# By category
pytest -m unit # Fast unit tests
pytest -m integration # Subprocess-based integration tests
pytest -m search # Search features
pytest -m sync # Bidirectional sync
pytest -m qdrant # Qdrant vector DB
pytest -m reconcile # Reconciliation
pytest -m export # Export features
pytest -m json_output # JSON output
# Via test runner
tests/test.zsh # All tests
tests/test.zsh search # Just search tests
The service has its own tests (tests/service, tests/e2e), and ikt test notes-exporter (or node scripts/test-all.js) runs every tier: unit, service, e2e and, when epubcheck is installed, epubcheck. The live tier exports your real Notes through the running service and runs only with NOTES_EXPORTER_LIVE=1 (SERVICE-API.md).
All tests use isolated temp directories and never touch your live data or Apple Notes: the end-to-end tests of exportnotes.zsh use a stand-in for osascript (tests/fake_osascript.py).
Explore related projects
Loading…