Skip to main content

Obsipub

Convert your Obsidian knowledge base to beautifully formatted EPUB ebooks with proper chapter structure and attachment handling.

Features

🔧 Smart Processing

  • Bulletproof YAML front matter handling
  • Wikilink conversion to standard markdown links
  • Automatic attachment processing and inclusion
  • Hidden/system file exclusion (.git, .obsidian, etc.)

📚 Perfect EPUB Structure

  • Folders become chapters with proper heading hierarchy
  • Notes become sections with shifted headers for clean TOC
  • Automatic table of contents generation
  • Proper metadata handling

🎯 Flexible Options

  • Include or exclude attachments
  • Keep or remove Obsidian tags
  • Custom book title and author
  • Verbose logging for debugging

Installation

pip install obsipub

From Source

git clone https://github.com/yourusername/obsipub.git
cd obsipub
pip install -e .

Requirements

  • Python 3.7+
  • Pandoc (for EPUB generation)

Installing Pandoc

Ubuntu/Debian:

sudo apt install pandoc

macOS:

brew install pandoc

Windows: Download from pandoc.org

Quick Start

Command Line Usage

# Basic conversion
obsipub /path/to/obsidian/vault output.epub

# With custom title and author
obsipub /path/to/vault mybook.epub --title "My Knowledge Base" --author "Your Name"

# Exclude attachments and keep tags
obsipub /path/to/vault book.epub --no-attachments --include-tags

# Verbose output for debugging
obsipub /path/to/vault book.epub --verbose

Python API Usage

from obsipub import ObsidianToEpubConverter

# Basic usage
converter = ObsidianToEpubConverter(
    vault_path="/path/to/obsidian/vault",
    output_epub_path="output.epub",
    title="My Knowledge Base",
    author="Your Name"
)

success = converter.convert()
if success:
    print("Conversion completed!")
else:
    print("Conversion failed - check warning.log")

# Advanced usage with options
converter = ObsidianToEpubConverter(
    vault_path="/path/to/vault", 
    output_epub_path="book.epub",
    title="Advanced Guide",
    author="Expert Author",
    include_attachments=True,  # Include images and files
    include_tags=False         # Remove #tags from content
)

converter.convert()

How It Works

File Processing

  1. Scanning: Recursively scans your vault, ignoring system directories
  2. Structure: Maps folder hierarchy to EPUB chapter structure
  3. Processing: Handles YAML front matter, wikilinks, and attachments
  4. Generation: Uses Pandoc to create the final EPUB

Heading Hierarchy

Folder/                     → # Chapter (H1)
├── Subfolder/             → ## Subchapter (H2)  
│   ├── Note.md           → ### Note Title (H3)
│   │   ├── # Header      → #### Header (H4)
│   │   └── ## Subheader  → ##### Subheader (H5)

What Gets Processed

  • ✅ Markdown files (.md)
  • ✅ Images (PNG, JPG, GIF, etc.)
  • ✅ Documents (PDF, DOCX, etc.)
  • ✅ Wikilinks [[Note Name]]
  • ✅ Attachments ![[image.png]]

What Gets Excluded

  • ❌ Hidden directories (.obsidian, .git, .trash)
  • ❌ System files (.DS_Store, Thumbs.db)
  • ❌ Temporary files (.tmp, .log, .pyc)

Command Line Options

obsipub [-h] [--title TITLE] [--author AUTHOR] [--no-attachments] 
        [--include-tags] [--verbose] [--version] 
        vault_path output_epub_path

Arguments

  • vault_path: Path to your Obsidian vault directory
  • output_epub_path: Where to save the generated EPUB file

Options

  • --title: Custom book title (default: "Obsidian Vault")
  • --author: Book author name
  • --no-attachments: Skip including images and attachments
  • --include-tags: Keep Obsidian tags like #important in text
  • --verbose: Enable detailed logging output
  • --version: Show version information

Examples

Convert Specific Subfolder

# Convert only your "Projects" folder
obsipub "/path/to/vault/Projects" projects.epub --title "My Projects"

Academic Paper Collection

obsipub "/path/to/research" research.epub \
  --title "Research Collection" \
  --author "Dr. Smith" \
  --include-tags

Clean Documentation Export

obsipub "/path/to/docs" documentation.epub \
  --title "Project Documentation" \
  --no-attachments

Troubleshooting

Common Issues

"Command not found: pandoc"

"Permission denied" errors

  • Ensure you have read access to the vault directory
  • Check write permissions for the output directory

Empty or missing content

  • Check warning.log for specific file processing issues
  • Use --verbose flag for detailed logging
  • Ensure markdown files have actual content after YAML processing

Large file sizes

  • Use --no-attachments to exclude images and documents
  • Consider converting subfolders instead of entire vault

Getting Help

  1. Check warning.log for detailed error information
  2. Run with --verbose for debug output
  3. Ensure all file paths are absolute or correctly relative
  4. Verify Pandoc installation: pandoc --version

Contributing

Contributions welcome! Please feel free to submit issues and pull requests.

Development Setup

git clone https://github.com/yourusername/obsipub.git
cd obsipub
pip install -e ".[dev]"

License

MIT License - see LICENSE file for details.

Changelog

v1.0.0

  • Initial release
  • Modular architecture
  • CLI and Python API
  • Bulletproof YAML processing
  • Smart header hierarchy
  • Attachment handling
  • System file exclusion

Metadata

Release files for obsipub 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for obsipub 1.0.1
File Size Uploaded Provenance Actions
obsipub-1.0.1.tar.gz 15.3 kB Without provenance Details for obsipub-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for obsipub 1.0.1
File Interpreter ABI Platform Actions
obsipub-1.0.1-py3-none-any.whl Python 3 none any Details for obsipub-1.0.1-py3-none-any.whl

Total release size: 29.1 kB

Release files / obsipub-1.0.1.tar.gz

Download URL obsipub-1.0.1.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f3b7ff12740382f4f0fe1a52f4501b344248160f5b3c67f2fd717cbf784ee83e
BLAKE2b-256 checksum
How to use checksums
86cef12d05ecd82799747bb9d4612cb0474bbf5bf3211aa3beadc6fbfcddd48d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / obsipub-1.0.1-py3-none-any.whl

Download URL obsipub-1.0.1-py3-none-any.whl
Size 13.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1529a8de42b7ef317e79d8aa235e4c2f0de9304b9cffc259442b019719be7bd
BLAKE2b-256 checksum
How to use checksums
25ac4672b6141766bfc01a951235c3afc7f849e7f1f4887ce9cc87c3e1b42f3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Security for obsipub 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page