Skip to main content

ranobelib-python-sdk

PyPI License: MIT Python versions CI Coverage Status Docs

Async Python SDK for ranobelib.me: fetch title metadata, download chapters and volumes, and export to epub, fb2, txt, or pdf.

The SDK talks to the undocumented but open JSON API behind the site (api.cdnlibs.org, part of the lib.social network) instead of scraping HTML.

Status: all the calls in the quickstart below are implemented — metadata, table of contents, single/bulk chapter and volume downloads, whole-title bulk download, translation selection, and export to "txt", "fb2", "epub", or "pdf" (cover + in-chapter illustrations embedded in epub/pdf). Raw API responses are cached to disk, and the underlying client bounds concurrency, paces requests, and retries 429/5xx with backoff. fmt="pdf" needs WeasyPrint's native dependencies (Pango/cairo/GTK3) installed on the system — pip install/uv add alone doesn't guarantee that on every platform; without them, export(fmt="pdf") raises the same "unknown format" error the other three formats don't. Authorization (private/18+/paid content) is out of scope — see CLAUDE.md for the full architecture and design decisions behind all of this.

Installation

uv add ranobelib-python-sdk

or

pip install ranobelib-python-sdk

Requires Python 3.11+.

Quickstart

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")

This is the full current public API — everything above is implemented and works today.

Examples

Complete, runnable scripts for every feature above — title metadata, table of contents, single/bulk chapter and volume downloads, translation selection, whole-title bulk download, disk caching, export to all four formats, and error handling — live in examples/, one heavily commented file per feature. Start there for copy-pasteable code.

Documentation

Full API reference and guides: https://LLIJIYAPNIK.github.io/ranobelib-python-sdk/ (built with mkdocs-material + mkdocstrings, deployed on push to main). CLAUDE.md documents the full architecture, public API contract, and the reasoning behind the SDK's design decisions. CHANGELOG.md lists what changed in each release.

License

MIT — see LICENSE.

Download files

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

Source Distribution

ranobelib_python_sdk-0.4.0.tar.gz (26.3 kB view details)

Uploaded Source

Built Distribution

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

ranobelib_python_sdk-0.4.0-py3-none-any.whl (34.9 kB view details)

Uploaded Python 3

File details

Details for the file ranobelib_python_sdk-0.4.0.tar.gz.

File metadata

  • Download URL: ranobelib_python_sdk-0.4.0.tar.gz
  • Upload date:
  • Size: 26.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ranobelib_python_sdk-0.4.0.tar.gz
Algorithm Hash digest
SHA256 085c6e9b8f7d64643807d04d1735c890dc156e81664d94bdb8ce1969f89209e6
MD5 36a9f8f463b06ebc3e655de7c6720ff3
BLAKE2b-256 ee0b32bf43a8bcd5920170edaf05d921b58ffde1b0427168be6d8e3a2150024f

See more details on using hashes here.

File details

Details for the file ranobelib_python_sdk-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: ranobelib_python_sdk-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 34.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ranobelib_python_sdk-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4a250c26f212090a43ee32bdc8719ed4fbaecd46868eb3035bfddbb6077c6a9e
MD5 7cea284bfaf68a59612a835761e8b308
BLAKE2b-256 6ae253a8c8dbb641cc2e2eb2573529641fb18fd4f985ac554d6bb8148074fe55

See more details on using hashes here.

Release history Release notifications | RSS feed

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.1

2 files

0.6.0

2 files

0.5.0

2 files

0.4.1

2 files

This release

0.4.0 This release

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page