API Reference
Book
Represents a book with various metadata attributes.
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.
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
).
parse
staticmethod
from_json
staticmethod
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. |