This is a simple python script for creating epub files from chapters composed by images.
To download the source code you just need to type this in a bash:
matteopiffari@main:~$ git clone https://github.com/matteopiffari/PyImg2EpubInstall EbookLib:
matteopiffari@main:~$ pip install EbookLibSetup the input directory (/chapters in the default config)
To make the script work the directory must be structured in this way:
chapters
├─── 001
│ ├─── 001.jpg
│ ├─── ...
│ └─── n.jpg
├─── 002
│ ├─── 001.jpg
│ ├─── ...
│ └─── n.jpg
├─── ...
└─── n
├─── 001.jpg
├─── ...
└─── n.jpgYou can also find this structure inside the file
/chapters/STRUCT.md
Before start you need to change some variables in the code:
TITLE: the title of the bookAUTHOR: the author of the bookDESCRIPTION: the description or trama of the bookOUTPUT_DIR(optional): the output directory where epub files will saved
After that you can run the script in this way:
matteopiffari@main:~$ cd PyImg2Epub
matteopiffari@main:~/PyImg2Epub$ python main.pyYou will find the .epub files in the folder named
output(or the one specified in theOUTPUT_DIRvariable in the code)
- matteopiffari - Idea & Work