Skip to content
Back to skills

Epub To Markdown

ASecurity

Convert EPUB files to well-formatted single markdown files with images extracted.

  • 50 stars
  • 0 votes
  • 2 copies
  • 13 views
  • Added June 11, 2026
documentationpythonbash

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 3 files and shows the line behind each finding

Scanned June 11, 2026

npx -y skills add jykim/claude-obsidian-skills --skill epub-to-markdown --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Epub To Markdown?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Epub To Markdown
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jykim-epub-to-markdown/badge)](https://www.skillsdirectory.com/skills/jykim-epub-to-markdown)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# EPUB to Markdown Skill

Convert EPUB files to well-formatted single markdown files with images extracted.

## Usage

```bash
python3 epub_to_markdown.py "<epub_path>" -o "<output_path>"
```

## Features

- **Metadata extraction**: title, author, language, publisher, publication date
- **TOC parsing**: Extracts table of contents with hierarchy
- **HTML to Markdown**: Converts chapter HTML using html2text
- **Heading preservation**: Maintains H1-H6 hierarchy
- **Image extraction**: Extracts images to `_files_/` folder with book prefix
- **Single file output**: All chapters in one markdown file

## Output Structure

```
output_dir/
├── book.epub           # Original file
├── book.md             # Extracted markdown
└── _files_/            # Images folder
    ├── BookTitle_cover.jpg
    ├── BookTitle_figure1.png
    └── ...
```

## Image Prefix

Images are extracted with a book prefix derived from the title:
- Title: "Die Empty: Unleash Your Best Work Every Day"
- Prefix: `DieEmptyUnleash` (first 3 words, special chars removed)
- Image: `_files_/DieEmptyUnleash_cover.jpg`

This prevents filename collisions when extracting multiple books to the same folder.

## Output Format

```markdown
---
title: {from metadata}
author: {from metadata}
language: {from metadata}
source_file: original.epub
source_type: epub
extracted: YYYY-MM-DD HH:MM:SS
status: extracted
---

# {Book Title}

## Table of Contents
- Chapter 1
- Chapter 2
...

---

## Chapter 1

{content with ![alt](_files_/BookTitle_image.png) links}

---

## Chapter 2

{content}
```

## Dependencies

```bash
pip install ebooklib beautifulsoup4 html2text
```

Or use requirements.txt:
```bash
pip install -r requirements.txt
```

## Options

| Flag | Description |
|------|-------------|
| `-o`, `--output` | Output markdown file path (default: same as epub with .md) |
| `-q`, `--quiet` | Suppress progress messages |

## Limitations

- **DRM-protected EPUBs**: Cannot be extracted (will fail with error)
- **Complex formatting**: May simplify to plain text
- **Large EPUBs**: May take time for books with many chapters/images

Files in this skill

  • SKILL.md2.1 KB
  • epub_to_markdown.py16.8 KB
  • requirements.txt59 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in documentation →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.