all2md.options.enex
Configuration options for ENEX (Evernote Export) parsing.
This module defines options for parsing Evernote Export (.enex) files, including note metadata, tags, and attachment handling.
- class all2md.options.enex.EnexOptions
Bases:
BaseParserOptions,AttachmentOptionsMixinConfiguration options for ENEX-to-Markdown conversion.
This dataclass contains settings specific to Evernote Export file processing, including note title formatting, metadata handling, tag rendering, and attachment processing. Inherits attachment handling from AttachmentOptionsMixin.
- Parameters:
note_title_level (int, default 1) – Heading level for note titles (1-6). Each note’s title will be rendered as a heading at this level.
include_note_metadata (bool, default True) – Whether to include note metadata (created date, updated date, source URL, etc.) as a paragraph below the note title.
include_tags (bool, default True) – Whether to include note tags in the output.
tags_format ({"frontmatter", "inline", "heading", "skip"}, default "inline") – How to render note tags: - “frontmatter”: Add as YAML frontmatter (tags: [tag1, tag2]) - “inline”: Add as inline text (Tags: tag1, tag2) - “heading”: Add as a heading section with tags listed - “skip”: Don’t include tags in output
notebook_as_heading (bool, default False) – Whether to add notebook name as a top-level heading above notes. Useful when exporting multiple notebooks to a single ENEX file.
date_format_mode ({"iso8601", "locale", "strftime"}, default "strftime") – How to format dates in output: - “iso8601”: Use ISO 8601 format (2023-01-01T10:00:00Z) - “locale”: Use system locale-aware formatting - “strftime”: Use custom strftime pattern
date_strftime_pattern (str, default "%m/%d/%y %H:%M") – Custom strftime pattern when date_format_mode is “strftime”.
sort_notes_by ({"created", "updated", "title", "none"}, default "none") – Sort notes by this criterion: - “created”: Sort by creation date (oldest first) - “updated”: Sort by last updated date (most recent first) - “title”: Sort alphabetically by title - “none”: Preserve order from ENEX file
notes_section_title (str, default "Notes") – Title for the notes section when rendering multiple notes.
Examples
- Convert ENEX with frontmatter tags and ISO dates:
>>> options = EnexOptions( ... tags_format="frontmatter", ... date_format_mode="iso8601" ... )
- Convert with custom date formatting and notebook headings:
>>> options = EnexOptions( ... notebook_as_heading=True, ... date_strftime_pattern="%B %d, %Y", ... date_format_mode="strftime" ... )
- Skip metadata and tags for cleaner output:
>>> options = EnexOptions( ... include_note_metadata=False, ... tags_format="skip" ... )
- note_title_level: int = 1
- include_note_metadata: bool = True
- include_tags: bool = True
- tags_format: Literal['frontmatter', 'inline', 'heading', 'skip'] = 'inline'
- notebook_as_heading: bool = False
- date_format_mode: Literal['iso8601', 'locale', 'strftime'] = 'strftime'
- date_strftime_pattern: str = '%m/%d/%y %H:%M'
- sort_notes_by: Literal['created', 'updated', 'title', 'none'] = 'none'
- notes_section_title: str = 'Notes'
- __init__(attachment_mode: AttachmentMode = 'alt_text', alt_text_mode: AltTextMode = 'default', attachment_output_dir: str | None = None, attachment_base_url: str | None = None, max_asset_size_bytes: int = 52428800, attachment_filename_template: str = '{stem}_{type}{seq}.{ext}', attachment_overwrite: AttachmentOverwriteMode = 'unique', attachment_deduplicate_by_hash: bool = False, attachments_footnotes_section: str | None = 'Attachments', extract_metadata: bool = False, note_title_level: int = 1, include_note_metadata: bool = True, include_tags: bool = True, tags_format: TagsFormatMode = 'inline', notebook_as_heading: bool = False, date_format_mode: DateFormatMode = 'strftime', date_strftime_pattern: str = '%m/%d/%y %H:%M', sort_notes_by: NoteSortMode = 'none', notes_section_title: str = 'Notes') None