Skip to content

Publisher Service

The PublisherService fetches information about publishers and their releases on Skoob.

Example

from pyskoob import SkoobClient

with SkoobClient() as client:
    publisher = client.publishers.get_by_id(21)  # replace with a real id
    print(publisher.name)

Retrieve publisher information, books and authors from Skoob.

AsyncPublisherService

Bases: _PublisherServiceMixin, AsyncBaseSkoobService

Asynchronous variant of :class:PublisherService.

Source code in pyskoob/publishers.py
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
class AsyncPublisherService(_PublisherServiceMixin, AsyncBaseSkoobService):  # pragma: no cover - thin async wrapper
    """Asynchronous variant of :class:`PublisherService`."""

    def __init__(self, client: AsyncHTTPClient):
        super().__init__(client)

    async def get_by_id(self, publisher_id: int) -> Publisher:
        """Asynchronous wrapper around :meth:`_get_by_id`."""

        return await self._get_by_id(publisher_id)

    async def get_authors(self, publisher_id: int, page: int = 1) -> Pagination[PublisherAuthor]:
        """Asynchronous wrapper around :meth:`_get_authors`."""

        return await self._get_authors(publisher_id, page)

    async def get_books(self, publisher_id: int, page: int = 1) -> Pagination[PublisherItem]:
        """Asynchronous wrapper around :meth:`_get_books`."""

        return await self._get_books(publisher_id, page)

get_authors(publisher_id, page=1) async

Asynchronous wrapper around :meth:_get_authors.

Source code in pyskoob/publishers.py
169
170
171
172
async def get_authors(self, publisher_id: int, page: int = 1) -> Pagination[PublisherAuthor]:
    """Asynchronous wrapper around :meth:`_get_authors`."""

    return await self._get_authors(publisher_id, page)

get_books(publisher_id, page=1) async

Asynchronous wrapper around :meth:_get_books.

Source code in pyskoob/publishers.py
174
175
176
177
async def get_books(self, publisher_id: int, page: int = 1) -> Pagination[PublisherItem]:
    """Asynchronous wrapper around :meth:`_get_books`."""

    return await self._get_books(publisher_id, page)

get_by_id(publisher_id) async

Asynchronous wrapper around :meth:_get_by_id.

Source code in pyskoob/publishers.py
164
165
166
167
async def get_by_id(self, publisher_id: int) -> Publisher:
    """Asynchronous wrapper around :meth:`_get_by_id`."""

    return await self._get_by_id(publisher_id)

PublisherService

Bases: _PublisherServiceMixin, BaseSkoobService

High level operations for retrieving publishers.

Source code in pyskoob/publishers.py
142
143
144
145
146
147
148
149
150
151
152
153
154
155
class PublisherService(_PublisherServiceMixin, BaseSkoobService):
    """High level operations for retrieving publishers."""

    def get_by_id(self, publisher_id: int) -> Publisher:
        """Synchronous wrapper around :meth:`_get_by_id`."""
        return run_sync(self._get_by_id(publisher_id))

    def get_authors(self, publisher_id: int, page: int = 1) -> Pagination[PublisherAuthor]:
        """Synchronous wrapper around :meth:`_get_authors`."""
        return run_sync(self._get_authors(publisher_id, page))

    def get_books(self, publisher_id: int, page: int = 1) -> Pagination[PublisherItem]:
        """Synchronous wrapper around :meth:`_get_books`."""
        return run_sync(self._get_books(publisher_id, page))

get_authors(publisher_id, page=1)

Synchronous wrapper around :meth:_get_authors.

Source code in pyskoob/publishers.py
149
150
151
def get_authors(self, publisher_id: int, page: int = 1) -> Pagination[PublisherAuthor]:
    """Synchronous wrapper around :meth:`_get_authors`."""
    return run_sync(self._get_authors(publisher_id, page))

get_books(publisher_id, page=1)

Synchronous wrapper around :meth:_get_books.

Source code in pyskoob/publishers.py
153
154
155
def get_books(self, publisher_id: int, page: int = 1) -> Pagination[PublisherItem]:
    """Synchronous wrapper around :meth:`_get_books`."""
    return run_sync(self._get_books(publisher_id, page))

get_by_id(publisher_id)

Synchronous wrapper around :meth:_get_by_id.

Source code in pyskoob/publishers.py
145
146
147
def get_by_id(self, publisher_id: int) -> Publisher:
    """Synchronous wrapper around :meth:`_get_by_id`."""
    return run_sync(self._get_by_id(publisher_id))