II — LIGHT NOVELS · RANOBELIB

ranobelib-python-sdk

Async Python SDK for ranobelib.me: title metadata, chapter and volume downloads, export to EPUB, FB2, TXT and PDF.

PYTHON 3.11+ LICENSE MIT PYPI ↗ GITHUB ↗ CHANGELOG

Installation

Install the package from PyPI. Python 3.11 or newer is required.

SHELL
$  uv add ranobelib-python-sdk
# or
$  pip install ranobelib-python-sdk

Quick start

PYTHON
from ranobelib import RanobeLib

async with RanobeLib("https://ranobelib.me/ru/book/6712--high-school-dxd-novel") as lib:
    info = await lib.get_info()
    toc = await lib.get_table_of_contents()

    chapter = await lib.get_chapter(volume=6, number="51.6")
    volume = await lib.get_volume(volume=6)

    chapters = await lib.get_chapters([(6, "51.6"), (6, "52")])
    volumes = await lib.get_volumes([1, 2, 3])

    translations = await lib.get_translations(volume=6, number="51.6")
    chapter = await lib.get_chapter(volume=6, number="51.6", branch_id=...)

    all_volumes = await lib.download_title(translation_index=0, chapter_delay=0.5)

    await lib.export(chapters, fmt="epub", path="output.epub")