Skip to main content

A Django app for storing, cataloguing, and reading e-Books (PDF, EPUB, CBZ)

Project description

django-bookkeeper

PyPI version Python versions Django versions CI License Code style: Ruff

A Django app for storing, cataloguing, and reading e-Books (PDF, EPUB, CBZ).

Features

  • Upload PDF, EPUB, and CBZ files (drag-and-drop or browse)
  • Automatic metadata extraction — title, author, publisher, cover image
  • Deduplication by SHA-256 hash
  • Modern reader with:
    • EPUB rendering via epub.js (chapters are extracted to HTML at upload time for performance; epub.js is used as a fallback for fixed-layout EPUBs)
    • PDF rendering via PDF.js
    • CBZ page-by-page comic reader
    • Keyboard navigation (arrow keys)
  • Reader settings: light/sepia/dark themes, font family & size, line height, column width
  • Highlights in five colours with optional notes
  • Bookmarks with titles and notes
  • Reading progress — auto-saved position and percentage
  • 5-star ratings per user
  • Favourites and finished-book tracking
  • Extensible hook signals for recent-books lists, activity feeds, etc.
  • Django best-practices: django-storages compatible, AUTH_USER_MODEL aware, namespaced URLs

Screenshots

Signin Library Overview Reader

Try the demo

The fastest way to see Bookkeeper in action — one command downloads five public-domain classics from Project Gutenberg and starts a local server:

git clone https://github.com/ehwio/django-bookkeeper
cd django-bookkeeper
make demo

Then open http://127.0.0.1:8000/ and sign in as demo / demo.

On subsequent runs, use make demo-run to start the server without re-seeding. Use make demo-reset to wipe the database and media and re-seed from scratch.

Admin interface: after seeding, create an admin account to access /admin/:

cd demo
PYTHONPATH=../src:.. uv run python manage.py create_admin

Then visit http://127.0.0.1:8000/admin/ and sign in with your admin credentials.

Or with Docker:

docker compose up

Uses Dockerfile.demo — builds the demo image from the demo/ directory.

The demo ships with:

  • Pride and Prejudice — Jane Austen
  • Twenty Thousand Leagues Under the Seas — Jules Verne
  • The Time Machine — H.G. Wells
  • Alice's Adventures in Wonderland — Lewis Carroll
  • Frankenstein — Mary Wollstonecraft Shelley

Books are downloaded from Project Gutenberg on first run. They are public domain and freely distributable.


Installation

pip install django-bookkeeper
# or
uv add django-bookkeeper

Add to INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    "bookkeeper",
]

Include URLs:

# urls.py
from django.urls import include, path

urlpatterns = [
    path("books/", include("bookkeeper.urls", namespace="bookkeeper")),
]

Run migrations:

python manage.py migrate

Dependencies

django-bookkeeper requires Django 4.2 or later and uses these packages:

Package Purpose
django-storages Storage backend abstraction
Pillow Image processing (covers)
ebooklib EPUB metadata/structure extraction
PyMuPDF PDF text/metadata extraction
python-magic File type detection
beautifulsoup4 HTML/XML parsing
lxml Fast XML/HTML processing
rarfile CBR comic support

Optional dependencies

Feature Package / Requirement
Social login social-auth-app-django
CBR comic support system unrar or unar binary
Cloud storage Already included — django-storages is a required dependency

Hooks

Connect to Bookkeeper signals to extend behaviour:

from bookkeeper.hooks import book_opened, book_finished, progress_updated

@book_opened.connect
def track_recent(sender, user, book, **kwargs):
    RecentBook.objects.update_or_create(user=user, defaults={"book": book})

Available signals: book_opened, progress_updated, book_finished, book_rated, book_uploaded, highlight_created, bookmark_created.

Development

git clone https://github.com/ehwio/django-bookkeeper
cd django-bookkeeper
uv sync --extra dev
uv run pytest --cov
uv run ruff check src/ tests/ demo/

GitFlow

  • main — stable releases
  • develop — integration branch
  • feature/* — new features
  • fix/* — bug fixes
  • release/* — release prep

See RELEASING.md for the step-by-step release process (TestPyPI → PyPI via GitHub Actions).

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_bookkeeper-0.3.2.tar.gz (8.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_bookkeeper-0.3.2-py3-none-any.whl (61.1 kB view details)

Uploaded Python 3

File details

Details for the file django_bookkeeper-0.3.2.tar.gz.

File metadata

  • Download URL: django_bookkeeper-0.3.2.tar.gz
  • Upload date:
  • Size: 8.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for django_bookkeeper-0.3.2.tar.gz
Algorithm Hash digest
SHA256 14c227efe439f0af5e9211cdc70e0116e4bcd8907df80f0edd0e19607ae081c9
MD5 148297c3ac8dcc8a89cd993138319838
BLAKE2b-256 a65c07d424c32abfe8da35709dc914016e480729d9a79f9d6216ac53e387bf5f

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_bookkeeper-0.3.2.tar.gz:

Publisher: publish-pypi.yml on ehwio/django-bookkeeper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_bookkeeper-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_bookkeeper-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 90f4b516408fa9080c0f55ecb4e1ad356dd325266a58a2bf189c1ca30f934119
MD5 8604bcde39555a36827812e8150c89c7
BLAKE2b-256 bcb1dcc88e0c89c4461e04c3880355dd47038d7664eb0ec359b3eb13f981b07a

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_bookkeeper-0.3.2-py3-none-any.whl:

Publisher: publish-pypi.yml on ehwio/django-bookkeeper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page