User¶
| CLASS | DESCRIPTION |
|---|---|
User |
Python interface for Planka Users |
User
¶
User(schema: Schema, session: Planka)
Bases: PlankaModel[User]
Python interface for Planka Users
-
Plankapy v2
-
models
-
Action
Actionuser -
Attachment
Attachmentcreator -
Board
Board -
Board Membership
BoardMembershipuser -
Card
Card -
Card Membership
CardMembershipuser -
Comment
Commentuser -
List
Listusers -
Notification
Notification -
Notification Service
NotificationServiceuser -
Project
Project -
Project Manager
ProjectManageruser -
Task
Taskassignee -
User
Userupdate_avatar
-
Action
-
interface
Planka Interface
interfacePlanka
-
models
| METHOD | DESCRIPTION |
|---|---|
add_notification_service |
Add/Copy an existing NotificationService to this User |
add_to_board |
Add the User to a board |
add_to_card |
Add the User to a Card |
copy |
Create a deepcopy of the model and its associated schema. |
create_notification_service |
Create a NEW Notification Service |
delete |
Delete the User |
delete_notification_service |
Deletes a NotificationService for a User |
diff |
Get a schema diff between two model schemas. |
remove_from_board |
Remove the User from a Board |
remove_from_card |
Remove the User from a Card |
sync |
Sync the User with the Planka server (Can only sync your own User) |
update |
Update the User |
update_avatar |
Update the User avatar |
update_email |
Update the current User's email |
update_password |
Update the User's password |
| ATTRIBUTE | DESCRIPTION |
|---|---|
__formatter__ |
Formatter func that allows overriding str behavior for models
TYPE:
|
avatar |
Avatar information for the user with generated URLs |
created_at |
When the user was created
TYPE:
|
default_editor_mode |
Default markdown editor mode (personal field)
TYPE:
|
default_home_view |
Default view mode for the home page (personal field)
TYPE:
|
default_projects_order |
Default sort order for projects display (personal field)
TYPE:
|
email |
Email address for login and notifications (private field)
TYPE:
|
enable_favorites_by_default |
Whether favorites are enabled by default (personal field)
TYPE:
|
gravatar_url |
Gravatar URL for the user (conditionally added if configured)
TYPE:
|
is_deactivated |
Whether the user account is deactivated and cannot log in
TYPE:
|
is_default_admin |
Whether the user is the default admin (visible only to current user or admin)
TYPE:
|
is_sso_user |
Whether the user is SSO user (private field)
TYPE:
|
language |
Preferred language for user interface and notifications (personal field)
TYPE:
|
locked_field_names |
List of fields locked from editing (visible only to current user or admin)
TYPE:
|
name |
Full display name of the user
TYPE:
|
notification_services |
Get all User NotificationServices
TYPE:
|
organization |
Organization or company name
TYPE:
|
phone |
Contact phone number
TYPE:
|
role |
User role defining access permissions
|
subscribe_to_card_when_commenting |
Whether the user subscribes to cards when commenting (personal field)
TYPE:
|
subscribe_to_own_cards |
Whether the user subscribes to their own cards (personal field)
TYPE:
|
terms_type |
Type of terms applicable to the user based on role
TYPE:
|
turn_off_recent_card_highlighting |
Whether recent card highlighting is disabled (personal field)
TYPE:
|
updated_at |
When the user was last updated
TYPE:
|
username |
Unique username for user identification
TYPE:
|
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
avatar
property
writable
¶
Avatar information for the user with generated URLs
default_editor_mode
property
writable
¶
default_editor_mode: EditorMode
Default markdown editor mode (personal field)
default_home_view
property
writable
¶
default_home_view: HomeView | None
Default view mode for the home page (personal field)
default_projects_order
property
writable
¶
default_projects_order: ProjectOrdering | None
Default sort order for projects display (personal field)
email
property
writable
¶
email: str | None
Email address for login and notifications (private field)
enable_favorites_by_default
property
writable
¶
enable_favorites_by_default: bool
Whether favorites are enabled by default (personal field)
gravatar_url
property
¶
gravatar_url: str | None
Gravatar URL for the user (conditionally added if configured)
is_deactivated
property
¶
is_deactivated: bool
Whether the user account is deactivated and cannot log in
is_default_admin
property
¶
is_default_admin: bool
Whether the user is the default admin (visible only to current user or admin)
language
property
writable
¶
language: Language | None
Preferred language for user interface and notifications (personal field)
locked_field_names
property
¶
locked_field_names: list[LockableField]
List of fields locked from editing (visible only to current user or admin)
notification_services
property
¶
notification_services: list[NotificationService]
Get all User NotificationServices
subscribe_to_card_when_commenting
property
writable
¶
subscribe_to_card_when_commenting: bool
Whether the user subscribes to cards when commenting (personal field)
subscribe_to_own_cards
property
writable
¶
subscribe_to_own_cards: bool
Whether the user subscribes to their own cards (personal field)
turn_off_recent_card_highlighting
property
writable
¶
turn_off_recent_card_highlighting: bool
Whether recent card highlighting is disabled (personal field)
add_notification_service
¶
add_notification_service(notification_service: NotificationService, *, url: str | None = None, format: NotificationServiceFormat | None = None) -> NotificationService
Add/Copy an existing NotificationService to this User
| PARAMETER | DESCRIPTION |
|---|---|
|
The NotificaitonService to add
TYPE:
|
|
Optional url override (default: from notification_service)
TYPE:
|
|
Optional format override (default: from notification_service)
TYPE:
|
Source code in src/plankapy/v2/models/user.py
402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 | |
add_to_board
¶
add_to_board(board: Board, *, role: BoardRole = 'viewer', can_comment: bool = False) -> None
Add the User to a board
| PARAMETER | DESCRIPTION |
|---|---|
|
The role of the User in the Board (default:
TYPE:
|
|
The comment permission for the user if
TYPE:
|
Note
If the User is already a Board member, but the role or comment permission are different, the User role and comment permission will be updated
Source code in src/plankapy/v2/models/user.py
377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 | |
add_to_card
¶
Add the User to a Card
| PARAMETER | DESCRIPTION |
|---|---|
|
The Card to add the user to (must be a member of the Card's Board)
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
PermissionError
|
If the User is not a member of the Card's Board |
Note
If the User is already a Card member, no changes will be made
Source code in src/plankapy/v2/models/user.py
346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 | |
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_notification_service
¶
create_notification_service(**kwargs: Unpack[Request_createUserNotificationService]) -> NotificationService
Create a NEW Notification Service
| PARAMETER | DESCRIPTION |
|---|---|
|
The webhook URL for the NotificationService
TYPE:
|
|
The format of the NotificationService (default:
TYPE:
|
Source code in src/plankapy/v2/models/user.py
420 421 422 423 424 425 426 427 | |
delete
¶
delete()
Delete the User
Source code in src/plankapy/v2/models/user.py
231 232 233 | |
delete_notification_service
¶
delete_notification_service(notification_service: NotificationService) -> None
Deletes a NotificationService for a User
| PARAMETER | DESCRIPTION |
|---|---|
|
The NotificaitonService to delete
TYPE:
|
Source code in src/plankapy/v2/models/user.py
429 430 431 432 433 434 435 436 | |
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 | |
remove_from_board
¶
remove_from_board(board: Board) -> None
Remove the User from a Board
Note
If the User is not a Board member, no change will be made
Source code in src/plankapy/v2/models/user.py
393 394 395 396 397 398 399 400 | |
remove_from_card
¶
Remove the User from a Card
| PARAMETER | DESCRIPTION |
|---|---|
|
The Card to remove the User from
TYPE:
|
Note
if the User is not a member of the Card, no change will be made
Source code in src/plankapy/v2/models/user.py
365 366 367 368 369 370 371 372 373 374 375 | |
sync
¶
sync()
Sync the User with the Planka server (Can only sync your own User)
Source code in src/plankapy/v2/models/user.py
222 223 224 225 | |
update
¶
update(**kwargs: Unpack[Request_updateUser])
Update the User
Source code in src/plankapy/v2/models/user.py
227 228 229 | |
update_avatar
¶
Update the User avatar
You can pass a filepath, URL, raw bytes, or None to the avatar argument. Only Admins can update other User's avatars
| PARAMETER | DESCRIPTION |
|---|---|
|
filepath/URL or file bytes or None to clear |
| RETURNS | DESCRIPTION |
|---|---|
User
|
The updated User
TYPE:
|
Source code in src/plankapy/v2/models/user.py
235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 | |
update_email
¶
Update the current User's email
| PARAMETER | DESCRIPTION |
|---|---|
|
The User's password (required if not admin)
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
PermissionError
|
If the current user is not admin and attempts to set another user's password |
PermissionError
|
If the current user is not admin and the |
HTTPStatusError
|
If the password is wrong or the update operation fails |
Source code in src/plankapy/v2/models/user.py
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 | |
update_password
¶
update_password(*, new_password: str, current_password: str | None = None) -> None
Update the User's password
| PARAMETER | DESCRIPTION |
|---|---|
|
The new password to use
TYPE:
|
|
The User's current password (required for non-admin)
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
PermissionError
|
If a non-admin attempts to update another user's password |
PermissionError
|
If a user attempts to update their own password without passing a |
HTTPStatusError
|
If the password is wrong or the update operation fails |
Source code in src/plankapy/v2/models/user.py
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 | |