Public API¶
obsidian_import
¶
obsidian-import: Extract files into Obsidian-flavored Markdown.
Public API
extract_file(path, config) -> ExtractedDocument extract_text(path, config) -> str discover_files(config) -> Iterator[DiscoveredFile]
extract_file
¶
Extract a single file to Obsidian-flavored markdown.
Uses the configured backend for the file's extension. Returns an ExtractedDocument with the extracted markdown and metadata. For image files, the source image is listed in associated_files for copying.
Source code in obsidian_import/__init__.py
extract_text
¶
Extract raw markdown text from a file. No frontmatter, no metadata wrapping.
discover_files
¶
Discover files matching the configured input directories and extensions.
obsidian_import.config
¶
Configuration dataclasses for obsidian-import.
config_for_backend
¶
config_for_backend(backend: str, timeout_seconds: int, max_file_size_mb: int, xlsx_max_rows_per_sheet: int) -> ImportConfig
Create an ImportConfig with all backends set to a single backend name.
Useful for consumers that just need quick extraction without managing the full config surface. Media extraction is disabled by default.
Source code in obsidian_import/config.py
load_config
¶
Load config from YAML file, merging on top of bundled defaults.
Users can write minimal YAML with only overrides. Relative paths in config are resolved relative to the config file's directory.