https://github.com/agusmakmun/welut
:wavy_dash: welut is django plugin to convert the .epub, .mobi or .pdf files as images. Usefull to manage e-library or e-commerce bassed on e-book system.
https://github.com/agusmakmun/welut
django django-plugin e-book e-library ebook-converter epub-converter mobi-converter paperless pdf-converter welut
Last synced: 4 months ago
JSON representation
:wavy_dash: welut is django plugin to convert the .epub, .mobi or .pdf files as images. Usefull to manage e-library or e-commerce bassed on e-book system.
- Host: GitHub
- URL: https://github.com/agusmakmun/welut
- Owner: agusmakmun
- License: mit
- Created: 2017-11-13T02:04:35.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-24T06:32:15.000Z (over 7 years ago)
- Last Synced: 2025-02-01T17:05:48.390Z (5 months ago)
- Topics: django, django-plugin, e-book, e-library, ebook-converter, epub-converter, mobi-converter, paperless, pdf-converter, welut
- Language: Python
- Homepage:
- Size: 12.8 MB
- Stars: 10
- Watchers: 2
- Forks: 10
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
**Welut** is a ebook converter
Requirements
=============* **ebook-convert:** ``$ sudo apt install calibre`` - *convert epub & mobi to pdf.*
* **pdftocairo:** ``$ sudo apt install -y poppler-utils`` - *convert pdf to images*Installation
------------------------------Welut is available directly from `PyPI`_:
1. Installing the package.
::
$ pip install welut
2. Don't forget to add ``'welut'`` to your ``'INSTALLED_APPS'``.
::
# settings.py
INSTALLED_APPS = [
....
'welut',
]3. Doing makemigrations & migrate
::
./manage.py makemigrations welut
./manage.py migrate welutConfiguration (``settings.py``)
---------------------------------------::
WELUT_EXTENSIONS = ['.pdf', '.epub', '.mobi'] # support file extensions
WELUT_REMOVED_EXTENSIONS = ['.pdf', '.epub', '.mobi'] # file to remove after uploaded
WELUT_IMAGES_EXTENSION = '.png' # format images extensionUsage
------------------------------You can using ``ForeignKey`` or ``OneToOneField``.
::
from django.db import models
from welut.models import EbookConverterclass EBook(models.Model):
title = models.CharField(max_length=200)
ebook_file = models.ForeignKey(EbookConverter, related_name='ebook_file')
created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(auto_now=True)def __str__(self):
return self.titledef get_files(self):
""" return list images of ebook per-page """
return self.ebook_file.get_files()**Templates**
::
{% for img_url in object.get_files %}
![]()
{% endfor %}Usage Preview
------------------------------.. image:: https://raw.githubusercontent.com/agusmakmun/welut/master/welut_demo/media/welut-demo.png
.. _PyPI: https://pypi.python.org/pypi/welut