Skip to content

A tool with python to create ebooks in EPUB format.

Notifications You must be signed in to change notification settings

JintaoLee-Roger/epubook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Epubook

English 中文

A tool with python to create ebooks in EPUB format.

test.py is an example to obtain the first ten chapters by web crawler, then create an ebook in EPUB format.

This example is for learning purposes only.

Usage

epub = Epub('filename') # the file name to save without suffix, such as mybook

# set book's name, optional, default: the saved file name
epub.set_title('my book name')

# add an author, if there are two or more author, call this 
# function multiple times, optional, default: "Unknow"
epub.add_author('Roger')

# add book's cover image (input file's path), optional, default: No cover
epub.add_cover('cover.jpg')

# add book's introduction, optional, default: "No introduction"
intro = 'epubook is fine'
epub.add_intro(intro)

# create chapters
for i, id in enumerate(id_list):
    chaper = get_chapter(i)
    epub.create_chapter(id, title_list[i], chaper, False)

# create ebook in epub format
epub.create()

About

A tool with python to create ebooks in EPUB format.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages