Skip to content

API Reference

Book

Represents a book with various metadata attributes.

title instance-attribute

title: str

The title of the book.

digital instance-attribute

digital: bool

Indicates if the book is in digital format or not.

edited instance-attribute

edited: bool

Indicates if this version of the book has been edited.

compilation instance-attribute

compilation: bool

Indicates if this book is a compilation.

pre instance-attribute

pre: bool

Indicates if the book is a pre-publication version or an official version with known issues or considered preliminary for other reasons.

revision instance-attribute

revision: int

The revision number of the book.

volume instance-attribute

volume: str | None

The volume identifier, if applicable (e.g., 1, 1.5, 1-2, 43.5-45).

chapter instance-attribute

chapter: str | None

The chapter identifier, if applicable (e.g., 1, 15, 100.5, 10-12, 55.5-60).

group instance-attribute

group: str | None

The group identifier.

year instance-attribute

year: int | None

The publication year of the specific volume or chapter.

edition instance-attribute

edition: str | None

The specific edition of the book.

extension instance-attribute

extension: str | None

The file extension.

publisher instance-attribute

publisher: str | None

The publisher of the book.

parse staticmethod

parse(filename: str) -> Book

Parse a light novel or manga filename into a Book object.

Parameters:

Name Type Description Default
filename str

The light novel or manga filename to parse.

required

Returns:

Type Description
Book

A Book object populated with data extracted from the filename.

from_json staticmethod

from_json(data: str) -> Book

Deserialize a Book instance from a JSON string.

Parameters:

Name Type Description Default
data str

A JSON string representing a Book object.

required

Returns:

Type Description
Self

A new Book object deserialized from the JSON string.

Raises:

Type Description
ValueError

If the input string is not valid JSON or does not match the expected structure for a Book object.

to_json

to_json() -> str

Serialize the Book instance to a JSON string.

Returns:

Type Description
str

A JSON string representation of the Book object.