Metadata-Version: 2.3
Name: lanraragi_api
Version: 0.9.81.2
Summary: A Python library for LANraragi API.
Author: Gustav
Author-email: Gustav <gustaavv.git@yahoo.com>
Requires-Dist: pydantic==2.13.5
Requires-Dist: requests==2.34.2
Requires-Python: >=3.10
Project-URL: repository, https://github.com/gustaavv/lanraragi-api
Description-Content-Type: text/markdown

# lanraragi-api

[![PyPI](https://img.shields.io/pypi/v/lanraragi_api.svg)](https://pypi.org/project/lanraragi_api/)
[![Docs](https://img.shields.io/badge/docs-GitHub%20Pages-2ea44f?logo=github)](https://gustaavv.github.io/lanraragi-api/)
[![License](https://img.shields.io/github/license/gustaavv/lanraragi-api.svg)](https://github.com/gustaavv/lanraragi-api/blob/master/LICENSE)
[![CI](https://github.com/gustaavv/lanraragi-api/actions/workflows/ci.yml/badge.svg)](https://github.com/gustaavv/lanraragi-api/actions/workflows/ci.yml)
[![Coverage](https://gustaavv.github.io/lanraragi-api/coverage-badge.svg)](https://gustaavv.github.io/lanraragi-api/coverage/combined/index.html)

A Python library for [LANraragi](https://github.com/Difegue/LANraragi) API.

> Many thanks to the author of this wonderful manga server.



## Quick start

Install this package:

```shell
pip install lanraragi_api
```

Get metadata of a random archive:


```python
from lanraragi_api import LANraragiAPI

apikey = "your-key"
server = "http://127.0.0.1:3000"
api = LANraragiAPI(server, key=apikey)

archives = api.search.get_random_archives()
if len(archives) > 0:
    print(archives[0])
```



## How to use?

All the APIs in the `lanraragi_api.base` package are
from [the official LANraragi document](https://sugoi.gitbook.io/lanraragi/api-documentation/getting-started), 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.py` contains server-side functions. The code is the same to that of LANraragi, only translated from Perl to Python.
- `script.py` contains functions for operation and management.





## Release versions

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).



## Development

Package and project manager: uv

Python version: 3.10

Use GNU Make to handle the development process. See [Makefile](Makefile) for details.