A Python library for LANraragi API.
Many thanks to the author of this wonderful manga server.
Install this package:
pip install lanraragi_apiGet metadata of a random archive:
See demo.py
from lanraragi_api import LANraragiAPI
from lanraragi_api.base.archive import ArchiveMetadata
apikey = "your-key"
server = "http://127.0.0.1:3000"
api = LANraragiAPI(server, key=apikey)
archives: list[ArchiveMetadata] = api.search.get_random_archives()
print(archives[0])All the APIs in the lanraragi_api.base package are
from the official LANraragi document, which you will be using in most times.
Functions in the lanraragi_api.enhanced package are built on the base APIs, offering useful functionalities.
server_side.pycontains server-side functions. The code is the same to that of LANraragi, only translated from Perl to Python.script.pycontains functions for operation and management.
Every release of lanraragi-api is made only for the corresponding release of LANraragi. So you should choose the correct lanraragi-api version based on the server version.
| LANraragi | lanraragi-api |
|---|---|
v.0.9.0 |
0.9.0.0, 0.9.0.1, ... , 0.9.0.x |
v.0.9.40 |
0.9.40.0, 0.9.40.1, ... , 0.9.40.y |
In order to make it simple, the first three version numbers are always the same, while the last version number of lanraragi-api serves as patches (just choose the latest one).
Package and project manager: uv
Python version: 3.10
Use GNU Make to handle the development process. See Makefile for details.