| name | evernote-data-handling |
| description | Best practices for handling Evernote data.
Use when implementing data storage, processing notes,
handling attachments, or ensuring data integrity.
Trigger with phrases like "evernote data", "handle evernote notes",
"evernote storage", "process evernote content".
|
| allowed-tools | Read, Write, Edit, Grep |
| version | 1.13.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","evernote","evernote-data"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Evernote Data Handling
Overview
Best practices for handling Evernote data including ENML content processing, attachment management, local database sync, and ENEX export/import.
Prerequisites
- Understanding of Evernote data model (Notes, Notebooks, Tags, Resources)
- Database for local storage (SQLite, PostgreSQL, etc.)
- File storage for attachments
Instructions
Step 1: Data Schema Design
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
);
Step 2: ENML Content Processing
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, )
.();
}