All Projects → anqxyr → mkepub

anqxyr / mkepub

Licence: MIT license
Simple minimalistic library for creating EPUB3 files

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to mkepub

epub-package.dart
A dart package to parse EPUB files
Stars: ✭ 21 (-69.12%)
Mutual labels:  epub, epub-files
rePocketable
Tool to fetch articles from (getPocket|the web) and turn them into epub
Stars: ✭ 49 (-27.94%)
Mutual labels:  epub, epub-generation
jEpub
Simple EPUB builder library, works in modern browsers.
Stars: ✭ 33 (-51.47%)
Mutual labels:  epub, epub-generation
Calibre
The official source code repository for the calibre ebook manager
Stars: ✭ 11,221 (+16401.47%)
Mutual labels:  epub, epub-generation
Epubreader
.NET library for reading EPUB files
Stars: ✭ 222 (+226.47%)
Mutual labels:  epub
Asciidoctor Epub3
📘 Asciidoctor EPUB3 is a set of Asciidoctor extensions for converting AsciiDoc to EPUB3 & KF8/MOBI
Stars: ✭ 166 (+144.12%)
Mutual labels:  epub
Folioreader Android
A Java ePub reader and parser framework for Android.
Stars: ✭ 2,025 (+2877.94%)
Mutual labels:  epub
Epubviewer
ePub viewer with dictionary, themes, search, offline support, and more
Stars: ✭ 156 (+129.41%)
Mutual labels:  epub
Open Publisher
Using Jekyll to create outputs that can be used as Pandoc inputs. In short - input markdown, output mobi, epub, pdf, and print-ready pdf. With a focus on fiction.
Stars: ✭ 242 (+255.88%)
Mutual labels:  epub
Laravel Book
Up to date Epub, Mobi and PDF versions from the official Laravel Docs
Stars: ✭ 221 (+225%)
Mutual labels:  epub
Bookdown
Authoring Books and Technical Documents with R Markdown
Stars: ✭ 2,768 (+3970.59%)
Mutual labels:  epub
Blitz
An eBook Framework (CSS + template)
Stars: ✭ 179 (+163.24%)
Mutual labels:  epub
Eplee
Sweet, simple epub reader
Stars: ✭ 227 (+233.82%)
Mutual labels:  epub
Epub Specs
Shared workspace for EPUB 3 specifications.
Stars: ✭ 164 (+141.18%)
Mutual labels:  epub
Duofolio
A simple ebook reader to help you learn languages 📖
Stars: ✭ 233 (+242.65%)
Mutual labels:  epub
Manifold
Transforming scholarly publications into living digital works.
Stars: ✭ 163 (+139.71%)
Mutual labels:  epub
Pandoc Book Template
A simple Pandoc template to build documents and ebooks.
Stars: ✭ 214 (+214.71%)
Mutual labels:  epub
Safaribooks
Download and generate EPUB of your favorite books from O'Reilly Learning (aka Safari Books Online) library.
Stars: ✭ 3,208 (+4617.65%)
Mutual labels:  epub
Folioreaderkit
📚 A Swift ePub reader and parser framework for iOS.
Stars: ✭ 2,382 (+3402.94%)
Mutual labels:  epub
Pandoc Markdown Book Template
A template for creating epub books from markdown using pandoc.
Stars: ✭ 191 (+180.88%)
Mutual labels:  epub

Build Status Coverage Status license

mkepub

mkepub is a minimalistic library for creating .epub files.

Pros:

  • Easy to use, minimalistic API.
  • Automatically generated TOC.
  • Support for nested TOC of any depth.
  • Support for embedded images.
  • Support for embedded fonts.
  • In-progress books are stored on disk rather than in memory, enabling creation of large (5000+ pages, 20+ MiBs) epub files.
  • Adherence to the EPUB3 specs.
  • Support for most of the EPUB metadata, including language, subject, description, and rights.

Cons:

  • No support for custom page filenames or directory structure.
  • No support for reading or editing epub files.
  • No content validation - using broken or unsupported html code as page content will lead to mkepub successfully creating a .epub file that does not meet EPUB3 specifications.
  • Probably other issues.

Basic Usage

import mkepub

book = mkepub.Book(title='An Example')
book.add_page(title='First Page', content='Lorem Ipsum etcetera.')
book.save('example.epub')

Advanced Usage

import mkepub

book = mkepub.Book(title='Advanced Example', author='The Author')
# multiple authors can be specified as a list:
# mkepub.Book(title='Advanced Example', authors=['The First Author', 'The Second Author'])
with open('cover.jpg', 'rb') as file:
    book.set_cover(file.read())
with open('style.css') as file:
    book.set_stylesheet(file.read())

first = book.add_page('Chapter 1', 'And so the book begins.')

child = book.add_page('Chapter 1.1', 'Nested TOC is supported.', parent=first)
book.add_page('Chapter 1.1.1', 'Infinite nesting levels', parent=child)
book.add_page('Chapter 1.2', 'In any order you wish.', parent=first)

book.add_page('Chapter 2', 'Use <b>html</b> to make your text <span class="pink">prettier</span>')

book.add_page('Chapter 3: Images', '<img src="images/chapter3.png" alt="You can use images as well">')
# as long as you add them to the book:
with open('chapter3.png', 'rb') as file:
    book.add_image('chapter3.png', file.read())

book.save('advanced.epub')
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].