This application converts an EPUB file to plain text format. You can use it as a command line interface (CLI) tool or run it as an HTTP service.
Install the required dependencies using pipenv
:
pipenv install
To convert an EPUB file to plain text using the CLI, run the following command:
pipenv run python3 main.py <input_epub_file>
Example:
pipenv run python3 main.py alice-in-wonderland.epub
The plain text output will be saved in the same directory as the input EPUB file.
To start the HTTP service, run the following command:
uvicorn main:app --reload
To convert an EPUB file by uploading it, send a POST request with the file to the /upload
endpoint:
curl -X POST -F "file=@<input_epub_file>" http://localhost:8000/upload -o <output_md_file>
Example:
curl -X POST -F "file=@alice-in-wonderland.epub" http://localhost:8000/upload -o alice.md
To convert an EPUB file by providing its URL, send a POST request with the URL to the /upload
endpoint:
curl -X POST "http://localhost:8000/upload?url=<url_encoded_epub_url>" -o <output_md_file>
Example:
curl -X POST "http://localhost:8000/upload?url=https%3A%2F%2Fwww.gutenberg.org%2Febooks%2F11.epub.noimages" -o "alice.md"
curl -X POST "https://epub2md.vercel.app/upload?url=https%3A%2F%2Fwww.gutenberg.org%2Febooks%2F11.epub.noimages" -o "alice.md"
This project is licensed under the terms of the MIT License.