Skip to content

Volumes#

bookshelf.Volume #

Volume(client: BookshelfClient, cache: ContentCache, detail: models.VolumeDetailResponse, *, book_ttl: float)

Bases: _VolumeBase

A volume indexed by version, resolving each into a published Book.

metadata instance-attribute #

metadata = detail

The volume's record as the platform lists it.

name instance-attribute #

name = name

The volume's name.

versions property #

versions: tuple[str, ...]

Every version this volume has published, oldest first.

latest property #

latest: str | None

The newest published version, or None for a volume that has published nothing.

editions #

editions(version: str) -> tuple[int, ...]

The published editions of one version, oldest first.

__iter__ #

__iter__() -> Iterator[str]

Iterate over versions, oldest first.

__len__ #

__len__() -> int

Count the published versions.

__contains__ #

__contains__(version: str) -> bool

Whether this volume has published the version.

book #

book(version: str | None = None, *, edition: int | None = None) -> Book

Resolve one published Book, defaulting to the newest version and edition.

__getitem__ #

__getitem__(version: str) -> Book

Resolve the newest edition of one version, the same as book(version).

bookshelf.AsyncVolume #

AsyncVolume(client: BookshelfClient, cache: ContentCache, detail: models.VolumeDetailResponse, *, book_ttl: float)

Bases: _VolumeBase

The asynchronous twin of Volume.

metadata instance-attribute #

metadata = detail

The volume's record as the platform lists it.

name instance-attribute #

name = name

The volume's name.

versions property #

versions: tuple[str, ...]

Every version this volume has published, oldest first.

latest property #

latest: str | None

The newest published version, or None for a volume that has published nothing.

editions #

editions(version: str) -> tuple[int, ...]

The published editions of one version, oldest first.

__iter__ #

__iter__() -> Iterator[str]

Iterate over versions, oldest first.

__len__ #

__len__() -> int

Count the published versions.

__contains__ #

__contains__(version: str) -> bool

Whether this volume has published the version.

book async #

book(version: str | None = None, *, edition: int | None = None) -> AsyncBook

Resolve one published Book, defaulting to the newest version and edition.