ebook
/ebook
Work with EPUB files - extract, update, and manage metadata, download and embed covers, update series info. Use when handling EPUB ebook libraries or metadata.
- Author
- hevangel ↗
- Repository
- media-agent-skills ↗
- Licence
- MIT
- Last repository change
- 25.10.2026
Assessment and security
- Files in this package
- 9
- Scripts
- 6
- HTML comments
- 0
- URLs in SKILL.md
- 2
No signals detected. Repository changed on 25.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
- 6 scripts in this package. Review them before installing, as Claude may execute them.
Scripts: scripts/check_metadata.py, scripts/download_cover.py, scripts/embed_cover.py, scripts/extract_metadata.py, scripts/update_metadata.py, scripts/update_series_metadata.py
What it does and when to use it
Work with EPUB files - extract, update, and manage metadata, download and embed covers, update series info. Use when handling EPUB ebook libraries or metadata.
Original author description
Work with EPUB files - extract, update, and manage metadata, download and embed covers, update series info. Use when handling EPUB ebook libraries or metadata.
How it works
- Configuration
- Reference
- Available Scripts
- Common Tasks
- EPUB Metadata Fields (Dublin Core)
- EPUB Structure
- Code Examples
- Common Issues
- Notes
SKILL.md preview
---
name: ebook
description: "Work with EPUB files - extract, update, and manage metadata, download and embed covers, update series info. Use when handling EPUB ebook libraries or metadata."
license: MIT
compatibility: Requires Python 3.13+, uv, ebooklib, and lxml
---
# EPUB Manager
## Configuration
Library paths are loaded from the `.env` file in the workspace root.
```env
EBOOK_LIBRARY_PATH=/path/to/ebook/library
```
You can configure multiple library paths as needed. The default structure follows Calibre conventions:
`$EBOOK_LIBRARY_PATH/Author Name/Book Title (ID)/book.epub`
## Reference
- Code Snippets: `scripts/`
- Code Snippet README: `scripts/README.md`
- Kavita integration: See the `kavita` skill
## Available Scripts
| Script | Purpose |
|--------|---------|
| `extract_metadata.py` | Extract metadata from EPUBs to JSON |
| `update_metadata.py` | Update Dublin Core metadata (title, author, publisher) |
| `update_series_metadata.py` | Add Calibre-compatible series info |
| `embed_cover.py` | Embed cover images into EPUBs |
| `download_cover.py` | Download covers from OpenLibrary/Google Books (supports multiple ISBNs) |
| `check_metadata.py` | Find EPUBs with missing metadata |
## Common Tasks
### Extract Metadata
Extract metadata from all EPUB files in a directory recursively and save to JSON.
### Check for Missing Metadata
Analyze extracted metadata to find EPUBs missing title, author, or other key fields.
### Fetch Missing Metadata
- Use `fetch-ebook-metadata` from Calibre: https://manual.calibre-ebook.com/generated/en/fetch-ebook-metadata.html
- Use [openlibrary-client](https://pypi.org/project/openlibrary-client/) for additional metadata.
### Update Metadata
Modify EPUB metadata (title, author, publisher) by editing the OPF file within the EPUB.
### Update Series Info
Add Calibre-compatible series metadata (`calibre:series` and `calibre:series_index`).
## EPUB Metadata Fields (Dublin Core)
- `title`, `creator`, `publisher`, `date`, `language`, `identifier` (ISBN)
- `subject` (genres/tags), `description`, `rights`, `contributor`
## EPUB Structure
EPUB files are ZIP archives containing:
- `mimetype` - Must be first file, uncompressed
- `META-INF/container.xml` - Points to OPF file
- `content.opf` - Package document with metadata
- `OEBPS/` - Content directory with XHTML, CSS, images
## Code Examples
### Extract Metadata
```python
import os
from pathlib import Path
from skills.ebook.scripts.extract_metadata import extract_epub_metadata, scan_epub_files
metadata = extract_epub_metadata(Path("book.epub"))
all_metadata = scan_epub_files(Path(os.environ["EBOOK_LIBRARY_PATH"]))
```
### Update Metadata
```python
from skills.ebook.scripts.update_metadata import update_epub_metadata
update_epub_metadata("book.epub", {
'creator': ['Author 1', 'Author 2'],
'publisher': 'Publisher Name'
})
```
### Download and Embed Cover
```python
from skills.ebook.scripts.download_cover import download_cover_multi_isbn
from skills.ebook.scripts.embed_cover import embed_cover_image
isbns = ['9780545060394', '0545060397']
source = download_cover_multi_isbn(isbns, 'temp/cover.jpg')
if source:
embed_cover_image('book.epub', 'temp/cover.jpg')
```
### Update Series
```python
from skills.ebook.scripts.update_series_metadata import update_epub_series
update_epub_series('book.epub', 'Series Name', 1)
```
## Common Issues
- **Cover Not Showing**: Multiple cover images in EPUB. Use `embed_cover_image()` with `remove_existing_covers=True`.
- **Series Not Detected**: Use `update_epub_series()` to add Calibre series metadata.
- **Changes Not in Kavita**: Trigger rescan with force mode via the Kavita skill.
## Notes
- Use `uv` as the Python package manager.
- Temporary files go in `$WORKSPACE_PATH/temp/`.
- Backups created automatically with `.backup` extension.
- Always test on a few files before batch processing.
Files in this package (9)
- SKILL.md 4 KB
- skill.json 1 KB
- scripts/README.md 8 KB
- scripts/check_metadata.py 3 KB
- scripts/download_cover.py 10 KB
- scripts/embed_cover.py 8 KB
- scripts/extract_metadata.py 4 KB
- scripts/update_metadata.py 7 KB
- scripts/update_series_metadata.py 7 KB
Versions
The database has no other skills named ebook.
Database snapshot: 13.11.2026 · package version a6c37ba8603f (SHA-256 digest of the entire package)
Downloads in the last 30 days: 2 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100epub
Read, write, and edit EPUB2/EPUB3 ebooks as an EPUB file format expert. Extract text, metadata, structure, and knowledge from EPUB files for enrichment or memory. Create valid EPUBs from scratch. Validate against the EPUB specification. Use when the user mentions epub, ebook,… - 100pdf-to-epub
Turn a PDF into a searchable, reflowable EPUB 3, including scans with no text layer (OCR, layout, chapters). Use when a PDF should become an ebook, or an EPUB needs checking. - 100find-ebook
用尽调式检索寻找指定书籍的合法授权电子书资源和获取路径,优先确认中文译本、 非扫描电子版、GitHub/GitBook 明确授权仓库、PDF、EPUB、MOBI、Kindle、Markdown、在线阅读和图书馆借阅。 Trigger when the user uses /find-ebook or find-ebook, asks to find an ebook, 电子书资源, epub, mobi, pdf, Kindle edition, downloadable book, 中文译本, or asks for a specific title such as 李飞飞自传 的电子版。 - 100pdf2epub
Use when converting a PDF book to EPUB, e.g. 'pdf to epub', 'convert this PDF book for my e-reader', 'EPUB with cover and TOC', 'pdf to ebook for kobo/kindle'. Builds a text-layer PDF into an EPUB with cover image, one section per chapter, a parsed 目录/Contents TOC, inline… - 96convert-documents-to-markdown
Convert Word (.doc, .docx), PowerPoint (.ppt, .pptx), Excel (.xls, .xlsx), OpenDocument (.odt, .ods, .odp), RTF, EPUB, CSV, and PDF files to GitHub-Flavored Markdown. Use when a task needs the contents of an office document, spreadsheet, presentation, ebook, or PDF you cannot read directly. - 100audiobooks
Manage audiobooks: download missing covers, organize metadata, embed cover art, and download from AudiobookBay. Use when working with audiobook libraries, cover images, or AudiobookBay searches.