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 to a format of your own, size estimates, console progress output, the catalog, footnotes, images, paragraphs, and error handling — live in examples/ranobelib/, 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 1.0.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 1.0.0
File Size Uploaded Provenance Actions
ranobelib_python_sdk-1.0.0.tar.gz 29.7 kB Without provenance Details for ranobelib_python_sdk-1.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 69.0 kB

Release files / ranobelib_python_sdk-1.0.0.tar.gz

Download URL ranobelib_python_sdk-1.0.0.tar.gz
Size 29.7 kB
Tags Source
SHA-256 checksum
How to use checksums
df85079cd64d3561fc9b7775f72b93c381d8ab7f38f5d33ca99c6596e593560e
BLAKE2b-256 checksum
How to use checksums
bb68f8de69794bd7d62a4e8da2b8a03fba6e03f59ea7550f2134bf88b2a160cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","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-1.0.0-py3-none-any.whl

Download URL ranobelib_python_sdk-1.0.0-py3-none-any.whl
Size 39.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d2820668fbfab55ecd4c3394fd520cadd2cc7e54fd8993c25022fd4dbccff02
BLAKE2b-256 checksum
How to use checksums
545f54040017a2d1c2d22124b2059ff0a37a1186e5286cf4e2f87f7e43130016
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","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 1.0.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