Skip to main content

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.

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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

lanraragi_api-0.9.0.2-py3-none-any.whl (14.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page