Skip to main content

A python wrapper for the Kavita API

Project description

A python wrapper for the Kavita API

Table of Contents

Installation

Use pip in your terminal of choice.
$ python -m pip install kavitapy

This library requires Python 3. Testing is done on Python 3.10

Usage

Import the package using

import kavitapy

Plugin authentication

Plugin authentication is done automatically whenever you call an object or one of its methods.
For example:

kavitapy.Reader("url","apikey")

Your token can also be accessed.

kavitapy.Reader("url","apikey").token

Replace url with your server address. Make sure to include http:// or https://.
Replace apikey with your user's API key. You can find it under the 3rd Party Clients tab in your user settings in the webinterface.

HTTP Status Code

Any method returns the full http response. Use .status_code to view the returned status code

kavitapy.Reader("url","apikey").status_code
kavitapy.Reader("url","apikey").chapter_info(Chapter ID(Int)).status_code

Returned Contents

Many of the methods return not only as status code, but also other content. For example, a list of Books or Manga matching a particular query.
Use .content to view the raw response

kavitapy.Library("url","apikey").search(Query(String)).content

Often times the response content can also be parsed by decoding it with .json()

...
import json
...
kavitapy.Library("url","apikey").search(Query(String)).json()

/api/Reader endpoints

Return information about a single chapter

kavitapy.Reader("url","apikey").chapter_info(Chapter(Int))

Return content: Json

Mark all series in the list as read or unread

kavitapy.Reader("url","apikey").mark_multiple_series("operation",Series(List))

operation can be either read or unread.
Return content: None

Mark all series in the list as read

kavitapy.Reader("url","apikey").mark_multiple_series_read(Series(List))

Return content: None

Mark all series in the list as unread

kavitapy.Reader("url","apikey").mark_multiple_series_unread(Series(List))

Return content: None

Return progress for a chapter

kavitapy.Reader("url","apikey").get_progress(Chapter(Int))

Return content: Json

Set reading progress on chapter

kavitapy.Reader("url","apikey").progress(Series(Int),Volume(Int),Chapter(Int),Page(Int),[Bookscroll(String)])

Setting Bookscroll is optional
Return content: Json

Return the current progress on a series

kavitapy.Reader("url","apikey").continue_point(Series(Int))

Return content: Json

/api/Library endpoints

Return all libraries

kavitapy.Library("url","apikey").content

Return content: Json

Scan the given library

kavitapy.Library("url","apikey").scan(Library(int))

Return content: None

Search series by name

kavitapy.Library("url","apikey").search(Query(String))

Return content: Json

/api/Series endpoints

Return all series. Allows you to specify a variety of filters

kavitapy.Series("url","apikey").default([Library(Int)],[PageNumber(Int)],[PageSize(Int)],[ReadStatus(Dict)],[RequestBody(Dict)])

This method does not require any parameters.
The Parameters RequestBody and ReadStatus are mutually exclusive.

This is the format for ReadStatus

{"unread": True,
 "in_progress": True,
 "read": True}

See the official API Documentation for RequestBody
Return content: Json

Return all volumes, chapters and page progress for a series

kavitapy.Series("url","apikey").volumes(Series(Int))

Return content: Json

Return information about the given volume

kavitapy.Series("url","apikey").volume(Volume(Int))

Return content: Json

Versioning

This project aims to follow the PEP 440 specification versioning.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kavitapy-0.3.0a1.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kavitapy-0.3.0a1-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file kavitapy-0.3.0a1.tar.gz.

File metadata

  • Download URL: kavitapy-0.3.0a1.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.3

File hashes

Hashes for kavitapy-0.3.0a1.tar.gz
Algorithm Hash digest
SHA256 1d7b9a721356676a874ba9529ad5557b23045e319d138f88fd86eed099697054
MD5 2a6b26fe8446299f5ca46d7fda86effe
BLAKE2b-256 32a302949f097e8610ede2426c752fe64e60569988db794598cd131ac27689a2

See more details on using hashes here.

File details

Details for the file kavitapy-0.3.0a1-py3-none-any.whl.

File metadata

  • Download URL: kavitapy-0.3.0a1-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.3

File hashes

Hashes for kavitapy-0.3.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 788b592fea28795787b6cc67bf7e98102a91f520589d9aa58eba7d2bbd518d24
MD5 6763a0c1298043879e1011e70c8d7754
BLAKE2b-256 a28d1b3c3de7ccb42541ddf771f28261e6cc4d4b4eb81bc79a72825043d46cd7

See more details on using hashes here.

Supported by

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