snip.api.books¶
Books API wrapper.
This module provides functions to interact with the books endpoints of the Snip API.
As reference see also the [official API documentation](https://snip.roentgen.physik.uni-goettingen.de/apidocs/books).
Functions
|
Create a new book. |
|
Retrieve a specific book by its ID. |
|
Retrieve all books the user has access to. |
|
Retrieve all collaborators for a specific book by its ID. |
|
Invite a new collaborator to a specific book by its ID. |
|
Remove a collaborator from a specific book by its ID. |
|
Update the collaborators for a specific book by its ID. |
Classes
Base permission structure with common fields for all permission types. |
|
Book entity with all its properties. |
|
Group-specific permission structure. |
|
User-specific permission structure. |
Module Functions
- snip.api.books.create_book(token: AccountToken, title: str, comment: str | None = None) BookTypedDict¶
Create a new book.
- snip.api.books.get_book(token: AccountToken | BookToken, book_id: int) BookTypedDict¶
Retrieve a specific book by its ID.
- snip.api.books.get_books(token: AccountToken) list[BookTypedDict]¶
Retrieve all books the user has access to.
- snip.api.books.get_collaborators(token: AccountToken | BookToken, book_id: int) list[UserPermissionTypedDict | GroupPermissionTypedDict]¶
Retrieve all collaborators for a specific book by its ID.
- snip.api.books.invite_collaborator(token: AccountToken | BookToken, book_id: int, email: str) dict¶
Invite a new collaborator to a specific book by its ID.
- snip.api.books.remove_collaborator(token: AccountToken | BookToken, book_id: int, collaborator_id: int, collaborator_type: Literal['user', 'group', 'invite'] = 'user') None¶
Remove a collaborator from a specific book by its ID.
- snip.api.books.update_collaborator(token: AccountToken | BookToken, book_id: int, collaborator: UserPermissionTypedDict | GroupPermissionTypedDict) None¶
Update the collaborators for a specific book by its ID.
This may also be used to add new collaborators.