HeadlinesBriefing favicon HeadlinesBriefing.com

Rust-Powered EPUB Library for Python

Hacker News •
×

A new Rust-based EPUB library called fast-ebook has been released for Python developers, offering significantly faster performance than existing solutions. The library supports EPUB2 and EPUB3 formats with features for reading, writing, validation, and markdown conversion. Built with Rust and leveraging parallel processing through Rayon, it can convert War and Peace's 368 chapters in just 71ms.

Fast-ebook provides a familiar API that mirrors the popular ebooklib, making migration straightforward for existing projects. Developers can switch with minimal code changes or use a compatibility layer for one-line updates. The library includes comprehensive functionality including metadata access, item filtering by type, table of contents navigation, and support for various media types like images, fonts, and audio.

Beyond the Python package, fast-ebook offers a standalone CLI tool for batch processing without requiring Python installation. Features include metadata extraction, EPUB validation against specifications, markdown conversion, item extraction, and parallel batch scanning. Available under the MIT license, the project is hosted on GitHub with installation options including pre-built binaries from GitHub Releases or source compilation via Cargo.