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. The part shared by every lib.social site (API client, request pacing, cache, titles, chapters, catalog) comes from libsocial-core, installed with it.

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/libsocial-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.

Metadata

Release files for ranobelib-python-sdk 0.14.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ranobelib-python-sdk 0.14.0
File Size Uploaded Provenance
ranobelib_python_sdk-0.14.0.tar.gz 29.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ranobelib-python-sdk 0.14.0
File Interpreter ABI Platform
ranobelib_python_sdk-0.14.0-py3-none-any.whl Python 3 none any Details

Total release size: 68.6 kB

Release files / ranobelib_python_sdk-0.14.0.tar.gz

Download URL ranobelib_python_sdk-0.14.0.tar.gz
Size 29.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a3ad2fbd511de9f12a4f905f47bb1269ed736a432e8a7684b7b2a26df42fbe64
BLAKE2b-256 checksum
How to use checksums
12c7861850805606f30d40414f255e089c43bda6b81b9ec56e9cace355ca9eaa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","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}

Release files / ranobelib_python_sdk-0.14.0-py3-none-any.whl

Download URL ranobelib_python_sdk-0.14.0-py3-none-any.whl
Size 39.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bed97505fcfaceddb3ecc0db7af1ca8686fbb572376e25e2323192d5ad9331b0
BLAKE2b-256 checksum
How to use checksums
36820dcb25c848cf92f1651661e06ce31727c8441dbc7301024f8b8fb91809c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","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}

Security for ranobelib-python-sdk 0.14.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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