Board¶
| CLASS | DESCRIPTION |
|---|---|
Board |
Python interface for Planka Boards |
Board
¶
Board(schema: Schema, session: Planka)
Bases: PlankaModel[Board]
Python interface for Planka Boards
- Plankapy v2 models
- Plankapy v2
| METHOD | DESCRIPTION |
|---|---|
add_editor |
Add a Board editor |
add_editors |
Add Board editors |
add_member |
Add a User to the Board |
add_members |
Add a Users to the Board |
add_viewer |
Add a Board viewer |
add_viewers |
Add a Board viewer |
copy |
Create a deepcopy of the model and its associated schema. |
create_field_group |
Create a new CustomFieldGroup on the Board |
create_label |
Create a new Label on the Board |
create_list |
Create a new List on the Board |
delete |
Delete the Board |
diff |
Get a schema diff between two model schemas. |
filter |
Apply a card filter to the board (apply the filter to all lists and agregate the cards) |
remove_label |
Remove a Label from the Board |
remove_list |
Remove a List from the Board |
remove_user |
Remove a User from the Board |
remove_users |
Remove Users from the Board |
sync |
Sync the Board with the Planka Server |
update |
Update the Board |
| ATTRIBUTE | DESCRIPTION |
|---|---|
__formatter__ |
Formatter func that allows overriding str behavior for models
TYPE:
|
active_lists |
Get all active Lists for the Board |
all_lists |
Get all Lists associated with the Board (including archive and trash) |
always_display_card_creator |
Whether to always display the Card creator
TYPE:
|
archive_list |
Get the archive List for the Board (archive List is not a normal List!)
TYPE:
|
archived_cards |
Get all Cards in the Board archive list |
attachments |
Get all Attachments associated with the Board
TYPE:
|
board_memberships |
Get all BoardMemberships for the Board
TYPE:
|
card_labels |
Get all CardLabels associated with the Board |
card_memberships |
Get all CardMemberships associated with the Board
TYPE:
|
cards |
Get all active Cards on the Board (use archived_cards and trashed_cards for archived/trashed Card lists) |
closed_lists |
Get all closed Lists for the Board |
created_at |
When the Board was created
TYPE:
|
custom_field_groups |
Get all CustomFieldGroups associated with the Board
TYPE:
|
custom_field_values |
Get all CustomFieldValues associated with the Board
TYPE:
|
custom_fields |
Get all CustomFields associated with the Board
TYPE:
|
default_card_type |
Default Card type for new Cards
TYPE:
|
default_view |
Default view for the board
TYPE:
|
editors |
Get all editor Users for the Board |
expand_task_lists_by_default |
Whether to expand TaskLists by default
TYPE:
|
formal_name |
Get the formal name of the board in the format
TYPE:
|
labels |
Get all Labels on the Board |
limit_card_types_to_default_one |
Whether to limit Card types to default one
TYPE:
|
lists |
Get all active/closed lists in the board (this is the one you most likely want) |
name |
Name/title of the Board
TYPE:
|
position |
Position of the Board within the Project
TYPE:
|
project |
TheProject the Board belongs to
TYPE:
|
projects |
Get all Projects that the Board is associated with (use |
subscribed |
Whether the current user is subscribed to the Board
TYPE:
|
subscribed_cards |
Get all Cards on the Board that the current User is subscribed to |
task_lists |
Get all TaskLists associated with the Board |
tasks |
Get all Tasks associated with the Board |
trash_list |
Get the trash List for the Board (trash List is not a normal List!)
TYPE:
|
trashed_cards |
Get all Cards in the Board trash list |
updated_at |
When the Board was last updated
TYPE:
|
users |
Get all Users on the Board |
viewers |
Get all viewer Users for the Board |
Source code in src/plankapy/v2/models/_base.py
30 31 32 33 34 35 36 | |
__formatter__
class-attribute
instance-attribute
¶
__formatter__: ModelFormatter[Self] = DEFAULT_FORMATTER
Formatter func that allows overriding str behavior for models
all_lists
property
¶
Get all Lists associated with the Board (including archive and trash)
always_display_card_creator
property
writable
¶
always_display_card_creator: bool
Whether to always display the Card creator
archive_list
property
¶
archive_list: List
Get the archive List for the Board (archive List is not a normal List!)
board_memberships
property
¶
board_memberships: list[BoardMembership]
Get all BoardMemberships for the Board
card_memberships
property
¶
card_memberships: list[CardMembership]
Get all CardMemberships associated with the Board
cards
property
¶
Get all active Cards on the Board (use archived_cards and trashed_cards for archived/trashed Card lists)
custom_field_groups
property
¶
custom_field_groups: list[CustomFieldGroup]
Get all CustomFieldGroups associated with the Board
custom_field_values
property
¶
custom_field_values: list[CustomFieldValue]
Get all CustomFieldValues associated with the Board
custom_fields
property
¶
custom_fields: list[CustomField]
Get all CustomFields associated with the Board
expand_task_lists_by_default
property
writable
¶
expand_task_lists_by_default: bool
Whether to expand TaskLists by default
formal_name
property
¶
formal_name: str
Get the formal name of the board in the format {Project}->{Board}
limit_card_types_to_default_one
property
writable
¶
limit_card_types_to_default_one: bool
Whether to limit Card types to default one
lists
property
¶
Get all active/closed lists in the board (this is the one you most likely want)
projects
property
¶
Get all Projects that the Board is associated with (use Board.Project instead, this is always one item)
subscribed_cards
property
¶
Get all Cards on the Board that the current User is subscribed to
trash_list
property
¶
trash_list: List
Get the trash List for the Board (trash List is not a normal List!)
add_editor
¶
add_editor(user: User) -> BoardMembership
Add a Board editor
| PARAMETER | DESCRIPTION |
|---|---|
|
The User to add as an editor
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
BoardMembership
|
BoardMembership |
Source code in src/plankapy/v2/models/board.py
423 424 425 426 427 428 429 430 431 432 | |
add_editors
¶
add_editors(users: Sequence[User]) -> list[BoardMembership]
Add Board editors
| PARAMETER | DESCRIPTION |
|---|---|
|
The Users to add as editors |
| RETURNS | DESCRIPTION |
|---|---|
list[BoardMembership]
|
list[BoardMembership] |
Source code in src/plankapy/v2/models/board.py
434 435 436 437 438 439 440 441 442 443 444 | |
add_member
¶
add_member(user: User, *, role: BoardRole = 'viewer', can_comment: bool = False) -> BoardMembership
Add a User to the Board
| PARAMETER | DESCRIPTION |
|---|---|
|
The User to add
TYPE:
|
|
The Role to assign to the user (default:
TYPE:
|
|
If role is
TYPE:
|
Source code in src/plankapy/v2/models/board.py
369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 | |
add_members
¶
add_members(users: Sequence[User], *, role: BoardRole = 'viewer', can_comment: bool = False) -> list[BoardMembership]
Add a Users to the Board
| PARAMETER | DESCRIPTION |
|---|---|
|
The Users to add |
|
The Role to assign to the user (default:
TYPE:
|
|
If role is
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[BoardMembership]
|
list[BoardMembership] |
Source code in src/plankapy/v2/models/board.py
399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 | |
add_viewer
¶
add_viewer(user: User, *, can_comment: bool = False) -> BoardMembership
Add a Board viewer
| PARAMETER | DESCRIPTION |
|---|---|
|
The User to add as a viewer
TYPE:
|
|
Whether the viewer User can comment on cards
TYPE:
|
Source code in src/plankapy/v2/models/board.py
446 447 448 449 450 451 452 453 | |
add_viewers
¶
add_viewers(users: Sequence[User], *, can_comment: bool = False) -> list[BoardMembership]
Add a Board viewer
| PARAMETER | DESCRIPTION |
|---|---|
|
The Users to add as viewers |
|
Whether the viewer Users can comment on cards
TYPE:
|
Source code in src/plankapy/v2/models/board.py
455 456 457 458 459 460 461 462 463 | |
copy
¶
copy() -> Self
Create a deepcopy of the model and its associated schema.
Note
Since the endpoints for both instances of the Model are the same, any calls to update will restore the state and bring both copies into sync. copies like this are meant more for comparing changes when running a sync or update/assignemnt operation.
Example:
>>> card_copy = card.copy()
>>> card.name = 'Updated Name'
>>> card_copy.name
'Original Name'
>>> card.name
'Updated Name'
>>> # This update may have had side effects
>>> print(card_copy.diff(card))
{'name': ('Original Name', 'Updated Name'), 'updatedAt': ('...2:00pm', '...2:45pm'), ...}
Source code in src/plankapy/v2/models/_base.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | |
create_field_group
¶
create_field_group(name: str | None = None, *, position: Position = 'top', base_group: BaseCustomFieldGroup | None = None) -> CustomFieldGroup
Create a new CustomFieldGroup on the Board
| PARAMETER | DESCRIPTION |
|---|---|
|
The name of the Custom Field Group
TYPE:
|
|
The position of the field group within the board
TYPE:
|
|
An optional BaseCustomFieldGroup to use as a template
TYPE:
|
Source code in src/plankapy/v2/models/board.py
345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 | |
create_label
¶
create_label(*, name: str, position: Position = 'top', color: LabelColor | Literal['random'] = 'random') -> Label
Create a new Label on the Board
| PARAMETER | DESCRIPTION |
|---|---|
|
The name of the Label
TYPE:
|
|
The position of the label in the label list
|
|
An optional color for the label (a random unused color by default)
TYPE:
|
Source code in src/plankapy/v2/models/board.py
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 | |
create_list
¶
create_list(*, name: str, type: Literal['active', 'closed'] = 'active', position: Position = 'top', color: ListColor | Literal['random'] | None = None) -> List
Create a new List on the Board
| PARAMETER | DESCRIPTION |
|---|---|
|
Name/title of the List
TYPE:
|
|
Type/status of the List
TYPE:
|
|
Position of the List within the Board
TYPE:
|
|
An optional color to set the list to (
TYPE:
|
Source code in src/plankapy/v2/models/board.py
279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 | |
delete
¶
delete()
Delete the Board
Source code in src/plankapy/v2/models/board.py
275 276 277 | |
diff
¶
diff(other: PlankaModel[Schema]) -> Diff
Get a schema diff between two model schemas.
Note
Only matching keys are diffed. Any schema keys that are not in the source schema will not be checked in the target schema
Source code in src/plankapy/v2/models/_base.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |
filter
¶
filter(*, search: str | None = None, users: User | Sequence[User] | None = None, labels: Label | Sequence[Label] | None = None, card_before: Card | None = None, changed_before: datetime | None = None) -> list[Card]
Apply a card filter to the board (apply the filter to all lists and agregate the cards)
| PARAMETER | DESCRIPTION |
|---|---|
|
A search term to apply to the cards
TYPE:
|
|
A list of Users to filter the cards by |
|
A list of Labels to filter the cards by |
|
Limit filter to only cards before this card
TYPE:
|
|
A time filter that filters on
TYPE:
|
Source code in src/plankapy/v2/models/board.py
485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 | |
remove_label
¶
Remove a Label from the Board
| PARAMETER | DESCRIPTION |
|---|---|
|
The Label to remove (must be associated with the board)
TYPE:
|
Source code in src/plankapy/v2/models/board.py
336 337 338 339 340 341 342 343 | |
remove_list
¶
Remove a List from the Board
| PARAMETER | DESCRIPTION |
|---|---|
|
The list to remove (must be associated with the Board and not
TYPE:
|
Source code in src/plankapy/v2/models/board.py
305 306 307 308 309 310 311 312 | |
remove_user
¶
Remove a User from the Board
Note
If the User is not a member, no change will be made and None will be returned
Source code in src/plankapy/v2/models/board.py
465 466 467 468 469 470 471 472 473 | |
remove_users
¶
Remove Users from the Board
Note
If a User is not a member, no change will be made and they will be excluded from the returned user list
Source code in src/plankapy/v2/models/board.py
475 476 477 478 479 480 481 482 483 | |
sync
¶
sync() -> None
Sync the Board with the Planka Server
Source code in src/plankapy/v2/models/board.py
267 268 269 | |
update
¶
update(**board: Unpack[Request_updateBoard]) -> None
Update the Board
Source code in src/plankapy/v2/models/board.py
271 272 273 | |