Books Service
The BookService allows searching for books and retrieving detailed information.
Example
from pyskoob import SkoobClient
from pyskoob.models.enums import BookSearch
with SkoobClient() as client:
results = client.books.search("Duna", BookSearch.TITLE)
for book in results.results:
print(book.title, book.book_id)
Bases: _BookServiceMixin, BaseSkoobService
High level operations for retrieving and searching books.
Source code in pyskoob/books.py
282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 | |
get_by_id(edition_id)
Retrieve a book by its edition ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
edition_id
|
int
|
Edition identifier from Skoob. |
required |
Returns:
| Type | Description |
|---|---|
Book
|
Fully parsed book information. |
Source code in pyskoob/books.py
315 316 317 318 319 320 321 322 323 324 325 326 327 328 | |
get_reviews(book_id, edition_id=None, page=1)
Retrieve reviews for a book.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
book_id
|
int
|
Identifier of the book whose reviews will be retrieved. |
required |
edition_id
|
int
|
Specific edition identifier. When |
None
|
page
|
int
|
Review page number, by default |
1
|
Returns:
| Type | Description |
|---|---|
Pagination[BookReview]
|
Paginated list of book reviews. |
Source code in pyskoob/books.py
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 | |
get_users_by_status(book_id, status, edition_id=None, limit=500, page=1)
Retrieve users who have a book with a specific status.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
book_id
|
int
|
Identifier of the book to inspect. |
required |
status
|
BookUserStatus
|
Desired user status for the book. |
required |
edition_id
|
int
|
Specific edition identifier to filter by. |
None
|
limit
|
int
|
Maximum number of IDs per page, by default |
500
|
page
|
int
|
Page number to retrieve, by default |
1
|
Returns:
| Type | Description |
|---|---|
Pagination[int]
|
Paginated list of user IDs. |
Source code in pyskoob/books.py
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 | |
search(query, search_by=BookSearch.TITLE, page=1)
Search for books by query and type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
Text to search for in book titles, ISBNs or authors depending on
|
required |
search_by
|
BookSearch
|
Criteria used for searching, by default |
TITLE
|
page
|
int
|
Result page number, by default |
1
|
Returns:
| Type | Description |
|---|---|
Pagination[BookSearchResult]
|
Paginated collection of matching books. |
Examples:
>>> service.search("Duna").results[0].title
'Duna'
Source code in pyskoob/books.py
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 | |