a Python library for LANraragi API
Project description
lanraragi-api
a Python library for LANraragi API.
Many thanks to the author of this wonderful manga server.
All the APIs in the lanraragi_api.base
package are
from the official LANraragi document.
- Based on those APIs, I also made some enhancements, e.g.
Archive#set_artists()
. - Some APIs have not been tested, you can switch on
Config.USE_UNTESTED_FUNCTIONS
to use it anyway.
Code in the lanraragi_api.enhanced
package are mainly scripts that built on the existing APIs.
- server_side.py contains useful function implemented in the server's code. The code is the same, only translated from Perl to Python.
- script.py contains useful scripts for operation and management. There are:
subfolders_to_artists
: Walk through content folder, and set artist tag for those archives without artist tag. For every archive, the artist will be the name of its parent folder. This function is similar to Subfolders to Categories, but has better performance.remove_all_categories
: For every category, remove all the archives it contains. After that, all the categories are removed.
Releases
The release version (tags) of lanraragi-api is almost the same to that of LANraragi, except that there will be a suffix .apiXYZ
.
e.g. The tag for LANraragi is 0.9.0
, then the corresponding tag for lanraragi-api is v.0.9.0.api0
. api0
means the first release for that version of LANraragi. The number after api
is just an auto increment one.
For python package releases, v.0.9.0.api0
will be 0.9.0.0
.
Demo
Install this package:
pip install lanraragi_api
Use this package:
See demo.py
from lanraragi_api import LANraragiAPI
from lanraragi_api.common.entity import Archive
apikey = ''
server = 'http://127.0.0.1:3000'
api = LANraragiAPI(apikey, server)
archives: list[Archive] = api.search.get_random_archives()
print(archives[0])
Build
python.exe .\setup.py bdist_wheel sdist
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for lanraragi_api-0.9.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 697cbfdf4c4f1383825d80a79e8367feaf45422eaf934f3f70b52dd3621763cd |
|
MD5 | ba9c794bffd0799c23249244be4d6618 |
|
BLAKE2b-256 | 7790948b048a0cbfbafaa411dc5ea0666a47f5dd11840aec0479b4c165b02b38 |