
: Re: How to rename epubs when the file name is a numeric string? I have a number of EPUB titles that need renaming, from the likes of "1631214659.epub" to "Moon's Napa and Sonoma" and so on. They
I wrote a small python script to do that.
pip install epub
Install the epub library and run the below script with a sibling directory containing all your epub files to be renamed.
import os
import glob
import epub
dirName = "books" #the folder containing your epub files, should be in the
#directory which contains the script.
for File in glob.glob(dirName + "*.epub"):
with epub.open_epub(File) as book:
title = book.opf.metadata.titles[0][0]
os.rename(File, dirName + "" + title + ".epub")
Note : The title should not be too long (not exceeding your os' filename limit).
Free books android app tbrJar TBR JAR Read Free books online gutenberg
More posts by @Nuzhat