From evernote-pack
Handles Evernote data with schema design, ENML parsing, attachment storage, incremental USN sync, and ENEX export/import.
npx claudepluginhub jeremylongshore/claude-code-plugins-plus-skills --plugin evernote-packThis skill is limited to using the following tools:
Best practices for handling Evernote data including ENML content processing, attachment management, local database sync, and ENEX export/import.
Guides Evernote data migration: scope assessment, ENEX/JSON/Markdown exports, ENML imports, bulk API operations with rate limits, and integrity verification.
Migrates notes from Notion, Evernote, Roam, Bear, Apple Notes to Obsidian. Converts links to wikilinks, relocates attachments, migrates tags, generates frontmatter using Node.js scripts.
Exports Apple Notes to Markdown, JSON, HTML files, and SQLite databases using macOS osascript and bash. Converts internal HTML to Markdown for backups, app exports, or searchable archives.
Share bugs, ideas, or general feedback.
Best practices for handling Evernote data including ENML content processing, attachment management, local database sync, and ENEX export/import.
Design a local database schema that mirrors Evernote's data model. Key tables: notes (guid, title, content, notebookGuid, created, updated, USN), notebooks (guid, name, stack), tags (guid, name), resources (guid, noteGuid, mime, hash, size). Track Update Sequence Numbers (USN) for incremental sync.
CREATE TABLE notes (
guid TEXT PRIMARY KEY,
title TEXT NOT NULL,
content TEXT,
notebook_guid TEXT REFERENCES notebooks(guid),
created BIGINT,
updated BIGINT,
usn INTEGER DEFAULT 0
);
Parse ENML to extract plain text (strip tags), convert to HTML (replace <en-note> with <body>, resolve <en-media> to <img>/<a> tags), or convert to Markdown. Validate ENML before sending to the API by checking for required declarations and forbidden elements.
function enmlToPlainText(enml) {
return enml
.replace(/<\?xml[^>]*\?>/g, '')
.replace(/<!DOCTYPE[^>]*>/g, '')
.replace(/<[^>]+>/g, ' ')
.replace(/\s+/g, ' ')
.trim();
}
Download resources via noteStore.getResource(guid, withData, ...). Store binary data locally with the MD5 hash as filename. Track MIME types for proper content-type serving. Compute hashes for integrity verification.
Implement incremental sync using getSyncState() to get the current server USN, then getSyncChunk() to fetch changes since your last sync. Process chunks in order: notebooks first, then tags, then notes, then resources.
const syncState = await noteStore.getSyncState();
if (syncState.updateCount > lastSyncUSN) {
const chunk = await noteStore.getSyncChunk(lastSyncUSN, 100, true);
// Process chunk.notebooks, chunk.tags, chunk.notes, chunk.resources
}
Export notes to ENEX (Evernote's XML export format), JSON, or Markdown. ENEX preserves the full note structure including resources and is compatible with Evernote import.
For the complete data schema, sync manager, ENML processor, and export implementations, see Implementation Guide.
| Error | Cause | Solution |
|---|---|---|
BAD_DATA_FORMAT | Malformed ENML during update | Validate ENML with DTD check before API call |
QUOTA_REACHED | Upload limit exceeded | Check user.accounting.uploaded before creating notes |
DATA_CONFLICT | Note modified since last read | Refetch note by GUID and merge changes |
| Sync chunk gaps | Missed USN range | Request full sync from USN 0 |
For enterprise features, see evernote-enterprise-rbac.
Local mirror: Sync all notes to a local SQLite database using incremental sync. Store resources on disk keyed by MD5 hash. Use the local mirror for full-text search without API calls.
Markdown export: Convert all notes in a notebook to Markdown files, preserving folder structure from notebook stacks, and saving attachments to an assets/ directory.