List¶
| CLASS | DESCRIPTION |
|---|---|
List |
Python interface for Planka Lists |
List
¶
List(schema: Schema, session: Planka)
Bases: PlankaModel[List]
Python interface for Planka Lists
- Plankapy v2 models
- Plankapy v2 models
| METHOD | DESCRIPTION |
|---|---|
archive_cards |
Move all cards in the List to the Board archive |
copy |
Create a deepcopy of the model and its associated schema. |
create_card |
Create a new card in the List |
delete |
Delete the List |
delete_cards |
Delete all Cards in the List (must be a trash list) |
diff |
Get a schema diff between two model schemas. |
filter |
Apply a filter to the list |
move_cards |
Move all Cards in this List to another List |
shuffle |
Shuffle the cards in the List (randomize position) |
sort |
Sort the list using a sort function |
sort_cards |
Sort all cards in the List and return the sorted Cards |
sync |
Sync the List with the Planka server |
update |
Update the List |
| ATTRIBUTE | DESCRIPTION |
|---|---|
__formatter__ |
Formatter func that allows overriding str behavior for models
TYPE:
|
attachments |
Attachments associated with the List
TYPE:
|
board |
The Board the List belongs to
TYPE:
|
card_labels |
CardLabels associated with the List |
card_memberships |
CardMemberships associated with the List
TYPE:
|
cards |
Cards associated with the List |
color |
Color for the List
TYPE:
|
created_at |
When the List was created
TYPE:
|
custom_field_groups |
CustomFieldGroups associated with the List
TYPE:
|
custom_field_values |
CustomFieldValues associated with the List
TYPE:
|
custom_fields |
CustomFields associated with the List
TYPE:
|
name |
Name/title of the List
TYPE:
|
position |
Position of the List within the Board
TYPE:
|
task_lists |
TaskLists associated with the List |
tasks |
Tasks associated with the List |
type |
Type/status of the list
|
updated_at |
When the List was last updated
TYPE:
|
users |
Users associated with the List |
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
card_memberships
property
¶
card_memberships: list[CardMembership]
CardMemberships associated with the List
custom_field_groups
property
¶
custom_field_groups: list[CustomFieldGroup]
CustomFieldGroups associated with the List
custom_field_values
property
¶
custom_field_values: list[CustomFieldValue]
CustomFieldValues associated with the List
archive_cards
¶
Move all cards in the List to the Board archive
Source code in src/plankapy/v2/models/list_.py
211 212 213 214 215 216 217 218 219 220 | |
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_card
¶
create_card(*, name: str, position: Position = 'bottom', type: CardType = 'project', description: str | None = None, due_date: datetime | None = None, due_date_completed: bool = False, stopwatch_duration: timedelta | None = None, stopwatch_started: datetime | Literal['now'] | None = None) -> Card
Create a new card in the List
| PARAMETER | DESCRIPTION |
|---|---|
|
The name of the Card
TYPE:
|
|
The position of the card within the List
TYPE:
|
|
The type of the card
TYPE:
|
|
An optional description to include
TYPE:
|
|
A due date for the card
TYPE:
|
|
If the card has been completed
TYPE:
|
|
The duration to include with the stopwatch
TYPE:
|
|
The start time for the runnung stopwatch (None is paused) |
Source code in src/plankapy/v2/models/list_.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | |
delete
¶
delete()
Delete the List
Source code in src/plankapy/v2/models/list_.py
148 149 150 | |
delete_cards
¶
delete_cards() -> None
Delete all Cards in the List (must be a trash list)
Source code in src/plankapy/v2/models/list_.py
222 223 224 | |
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 filter to the list
| 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/list_.py
273 274 275 276 277 278 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 304 305 306 307 308 309 310 311 312 313 314 315 | |
move_cards
¶
Move all Cards in this List to another List
Source code in src/plankapy/v2/models/list_.py
226 227 228 229 230 231 232 | |
shuffle
¶
Shuffle the cards in the List (randomize position)
Source code in src/plankapy/v2/models/list_.py
234 235 236 237 238 239 240 241 | |
sort
¶
Sort the list using a sort function
| PARAMETER | DESCRIPTION |
|---|---|
|
The sorting function to use (default is |
|
Reverse the sort order
TYPE:
|
Note
If sorting on fields that may have comparison errors (e.g. due_date)
make sure your sort key properly accounts for that:
>>> lst.sort(lambda c: c.due_date)
Exception ... # Can't compare NoneType and datetime
>>> lst.sort(lambda c: c.due_date or c.created_at+timedelta(days=10000))
[
Card(dueDate='2026-01-20...'),
Card(dueDate='2026-01-26...'),
...
]
Source code in src/plankapy/v2/models/list_.py
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 | |
sort_cards
¶
sort_cards(**kwargs: Unpack[Request_sortList]) -> list[Card]
Sort all cards in the List and return the sorted Cards
Source code in src/plankapy/v2/models/list_.py
206 207 208 209 | |
sync
¶
sync()
Sync the List with the Planka server
Source code in src/plankapy/v2/models/list_.py
140 141 142 | |
update
¶
update(**list: Unpack[Request_updateList])
Update the List
Source code in src/plankapy/v2/models/list_.py
144 145 146 | |