Skip to main content

Static OPDS catalog generator powered by Python

Project description

Lib2OPDS

lib2opds generates static OPDS (version 1.2) catalog for local e-book library.

Features

  • Directory hierarchy support
  • Virtual directories: new books, authors, etc.
  • ePUB format: metadata extraction, thumbnail generation
  • PDF format: metadata extraction, thumbnail generation
  • "Lazy" updating of feeds. lib2opds re-generates feeds only when new files are added into the library
  • Sidecar files for metadata extraction
  • Global and local configuration files as well as command line options
  • Caching for better processing of libraries with many books

How to install

lib2opds is distributed on PyPI. The best way to install it is with pipx.

pipx install lib2opds

How to use

$ tree ./test-library/
./test-library/
├── Linux
│   └── How Linux Works - Brian Ward.epub
└── Science Fiction
    ├── All Systems Red.epub
    └── I, Robot - Isaac Asimov.epub

$ lib2opds --opds-base-uri "/opds/" --library-base-uri "/library/" --library-dir "./test-library" --opds-dir "./output"

$ tree ./output/
./output/

├── covers
│   ├── 03e1b3fe-66b2-43eb-b9f1-da72813419e2
│   ├── 14cdd72c-680c-491c-a017-ddd0d2dbb1d2
│   └── e01dab66-3f78-402a-9ac8-83ebc6b24f11
├── feeds
│   ├── 101bcb13-37bf-4e13-a543-22c5ff3567d3.xml
│   ├── 127ae484-af53-4056-9cff-517984321e26.xml
│   └── db1d5760-72f5-4f23-af42-d9d6406207c9.xml
└── index.xml

/etc/lib2opds.ini is used by default and options can be overridden via command line arguments.

Example of configuration file for Nginx:

location /library {
        alias /library-dir;
}

location /opds {
        auth_basic  "Library Area";
        auth_basic_user_file /etc/nginx/htpasswd;
        alias /opds-dir;
        index index.xml;
}

location /opds/covers {
        alias /opds-dir/covers;
}

Library location here is not protected with basic auth because of the bug in some e-book reader software.

Sidecar files

lib2opds detects sidecar files for the target e-book file and extracts metadata and cover from them.

For example, in case of some-book.epub e-book file lib2opds will try to check for some-book.info and some-book.cover files.

.info sidecar files are basically INI-format files:

[Publication]
title = 1984
authors =  George Orwell
description = Some summary here
language = en
issued = 1949
publisher = SomePublisher, Inc.
identifier = urn:isbn:9781443434973

.cover is just an image file.

Tested devices and applications

The full list of devices and applications is available on the wiki page.

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

lib2opds-0.2.0.tar.gz (39.3 kB view details)

Uploaded Source

Built Distribution

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

lib2opds-0.2.0-py3-none-any.whl (40.3 kB view details)

Uploaded Python 3

File details

Details for the file lib2opds-0.2.0.tar.gz.

File metadata

  • Download URL: lib2opds-0.2.0.tar.gz
  • Upload date:
  • Size: 39.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for lib2opds-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6b7eb65163aeb7cfa1f9762308dbf86a1301b0e8f6a51fd255e2b37f3fe3aeac
MD5 56f0b2a0b8a1ad8b84cdee4ea2b5dd51
BLAKE2b-256 e12c1dbd3182b63677504b99d9df5252b775cb9002bbc9bafda0a20ec56db21c

See more details on using hashes here.

Provenance

The following attestation bundles were made for lib2opds-0.2.0.tar.gz:

Publisher: publish-to-pypi.yml on oxdef/lib2opds

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

File details

Details for the file lib2opds-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: lib2opds-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 40.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for lib2opds-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a5ecf5fa8e3b8acbc98cb0216c0742593304e0aa1266e1820f83d2b33afd68fc
MD5 bb0064f37d34b9b68d2bf2643d4ab5d6
BLAKE2b-256 739bc9c152251c6eb0b28cbd515425b8cc5376ae9b403f1a7c402d1a9d082582

See more details on using hashes here.

Provenance

The following attestation bundles were made for lib2opds-0.2.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on oxdef/lib2opds

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