A modern Python CLI tool to convert Evernote .enex files to individual HTML files with media preservation and beautiful styling.
# Install uv (recommended)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Get the code
git clone https://github.com/bcelary/enex-html-archive.git
cd enex-html-archive
# Install
uv pip install .
# Convert your notes
enex-html-archive -i /path/to/enex/files -o /path/to/output- Individual HTML files: Each note exported to its own standalone HTML file
- Organized structure: Each .enex file gets its own directory with navigation
- Media preservation: Attachments and images extracted and linked properly in media/ directories
- Theme support: Choose between light and dark themes for generated HTML
- Responsive design: Mobile-friendly HTML with modern CSS
- Rich navigation: Table of contents with hierarchical browsing across all notes
- Clean URLs: Sanitized filenames for web compatibility
- Modern packaging: Proper Python package with CLI entry point
- Type safety: Full type annotation throughout for better development experience
- Zero dependencies: Pure Python implementation using only stdlib
git clone https://github.com/bcelary/enex-html-archive.git
cd enex-html-archive# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install the package
uv pip install .pip install .# Install in development mode with development dependencies
uv pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install# Basic usage
enex-html-archive --input-dir /path/to/enex/files --output-dir /path/to/output
# Short form
enex-html-archive -i ~/Documents/Evernote -o ~/Sites/notes
# With light theme (default is dark)
enex-html-archive -i ./notes -o ./html-output --theme light
# With verbose output
enex-html-archive -i ./notes -o ./html-output --verbose
# Run as Python module (note: module name is enex2html)
python -m enex2html -i ./notes -o ./html-output
# Show help
enex-html-archive --helpFor best results with this converter, export your notes strategically from Evernote:
- Export by notebook: Export each notebook separately to get organized directory structure
- Select .enex format: In Evernote, go to File → Export Notes → Choose .enex format
- Include attachments: Make sure "Include tags" and attachments are selected during export
- One notebook per file: Each .enex file will become its own directory with individual note files
Recommended export structure:
input-folder/
├── Work_Notes.enex
├── Personal_Journal.enex
├── Recipes.enex
└── Travel_Plans.enex
This approach ensures clean organization and makes it easier to navigate your converted notes.
output-dir/
├── index.html # Main table of contents
├── assets/ # CSS and JavaScript assets
│ ├── css/ # Theme CSS files
│ │ ├── dark.css
│ │ └── light.css
│ └── js/ # JavaScript files
│ └── theme-switcher.js
└── notebooks/ # Notebook directories
├── Personal_Journal/
│ ├── index.html # Notes in this notebook
│ ├── note_001_meeting_notes.html
│ ├── note_002_project_plan.html
│ └── media/ # Notes resources (images, attachments, ...)
│ ├── screenshot.png
│ └── document.pdf
└── Recipes/
├── index.html
├── note_001_recipe.html
└── media/
└── food_photo.jpg
# Run pre-commit on all files
pre-commit run --all-files
# Run type checking
mypy src/enex2html
# Format code
black src/enex2html
# Lint code
ruff check src/enex2htmlMIT License - see LICENSE file for details.
This project was inspired by hudvin/enex2html, which provided the foundation for understanding the ENEX format and conversion process.
Contributions are welcome! Please feel free to submit a Pull Request.