libsocial-core
The site-independent core shared by the async Python SDKs for the lib.social sites
(ranobelib.me, mangalib.me, ...). They all sit on one backend, api.cdnlibs.org, and differ
mainly in the Site-Id they send and in what a chapter contains.
This package is the shared part:
ApiClient: theapi.cdnlibs.orgclient, scoped to a site by aSite(id + origin). Bounded concurrency, retries with backoff on 429/5xx, and request pacing shared by every client in the process that talks to the same host.TitleClient: one title's metadata, table of contents, translations (branches), chapter fetching and whole-title download, with a disk cache.Catalog: catalog listing/search and the genre/country/status lists, filtered to the site.- Models (
Title,Chapter,ChapterBranch,Volume, ...) and exceptions.
It's meant to be used through a site package, which sets the site and its chapter model —
most likely ranobelib-python-sdk, not
directly.
from libsocial import Site, TitleClient
from libsocial.models import Chapter, Title, Volume
class MyChapter(Chapter):
content: str | None = None
class MyVolume(Volume[MyChapter]):
pass
class MySite(TitleClient[Title, MyChapter, MyVolume]):
site = Site(id=3, origin="https://ranobelib.me")
title_model = Title
chapter_model = MyChapter
volume_model = MyVolume
async with MySite("https://ranobelib.me/ru/book/6712--high-school-dxd-novel") as client:
info = await client.get_info()
Repository, documentation and the site packages: https://github.com/LLIJIYAPNIK/ranobelib-python-sdk.
MIT licensed.
Metadata
Release files for libsocial-core 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| libsocial_core-1.0.0.tar.gz | 29.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| libsocial_core-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 64.9 kB