categories
#
Lunch Money - Categories
https://lunchmoney.dev/#categories
CategoriesClient
#
Bases: LunchMoneyAPIClient
Lunch Money Categories Interactions
Source code in lunchable/models/categories.py
147 148 149 150 151 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 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 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 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 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 |
|
get_categories(format=None)
#
Get Spending categories
Use this endpoint to get a list of all categories associated with the user's account. https://lunchmoney.dev/#get-all-categories
Parameters:
Name | Type | Description | Default |
---|---|---|---|
format |
str | CategoriesFormatEnum | None
|
Can either |
None
|
Returns:
Type | Description |
---|---|
List[CategoriesObject]
|
|
Source code in lunchable/models/categories.py
get_category(category_id)
#
Get single category
Use this endpoint to get hydrated details on a single category. Note that if this category is part of a category group, its properties (is_income, exclude_from_budget, exclude_from_totals) will inherit from the category group.
https://lunchmoney.dev/#get-single-category
Parameters:
Name | Type | Description | Default |
---|---|---|---|
category_id |
int
|
Id of the Lunch Money Category |
required |
Returns:
Type | Description |
---|---|
CategoriesObject
|
|
Source code in lunchable/models/categories.py
insert_category(name, description=None, is_income=None, exclude_from_budget=None, exclude_from_totals=None, archived=None, group_id=None)
#
Create a Spending Category
Use this to create a single category https://lunchmoney.dev/#create-category
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Name of category. Must be between 1 and 40 characters. |
required |
description |
Optional[str]
|
Description of category. Must be less than 140 categories. Defaults to None. |
None
|
is_income |
Optional[bool]
|
Whether or not transactions in this category should be treated as income. Defaults to False. |
None
|
exclude_from_budget |
Optional[bool]
|
Whether or not transactions in this category should be excluded from budgets. Defaults to False. |
None
|
exclude_from_totals |
Optional[bool]
|
Whether or not transactions in this category should be excluded from calculated totals. Defaults to False. |
None
|
archived |
Optional[bool]
|
Whether or not category should be archived. |
None
|
group_id |
Optional[int]
|
Assigns the newly-created category to an existing category group. |
None
|
Returns:
Type | Description |
---|---|
int
|
ID of the newly created category |
Source code in lunchable/models/categories.py
insert_category_group(name, description=None, is_income=None, exclude_from_budget=None, exclude_from_totals=None, category_ids=None, new_categories=None)
#
Create a Spending Category Group
Use this endpoint to create a single category group https://lunchmoney.dev/#create-category-group
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Name of category. Must be between 1 and 40 characters. |
required |
description |
Optional[str]
|
Description of category. Must be less than 140 categories. Defaults to None. |
None
|
is_income |
Optional[bool]
|
Whether or not transactions in this category should be treated as income. Defaults to False. |
None
|
exclude_from_budget |
Optional[bool]
|
Whether or not transactions in this category should be excluded from budgets. Defaults to False. |
None
|
exclude_from_totals |
Optional[bool]
|
Whether or not transactions in this category should be excluded from calculated totals. Defaults to False. |
None
|
category_ids |
Optional[List[int]]
|
Array of category_id to include in the category group. |
None
|
new_categories |
Optional[List[str]]
|
Array of strings representing new categories to create and subsequently include in the category group. |
None
|
Returns:
Type | Description |
---|---|
int
|
ID of the newly created category group |
Source code in lunchable/models/categories.py
insert_into_category_group(category_group_id, category_ids=None, new_categories=None)
#
Add to a Category Group
Use this endpoint to add categories (either existing or new) to a single category group
https://lunchmoney.dev/#add-to-category-group
Parameters:
Name | Type | Description | Default |
---|---|---|---|
category_group_id |
int
|
Id of the Lunch Money Category Group |
required |
category_ids |
Optional[List[int]]
|
Array of category_id to include in the category group. |
None
|
new_categories |
Optional[List[str]]
|
Array of strings representing new categories to create and subsequently include in the category group. |
None
|
Returns:
Type | Description |
---|---|
CategoriesObject
|
|
Source code in lunchable/models/categories.py
remove_category(category_id)
#
Delete a single category
Use this endpoint to delete a single category or category group. This will only work if there are no dependencies, such as existing budgets for the category, categorized transactions, categorized recurring items, etc. If there are dependents, this endpoint will return what the dependents are and how many there are.
https://lunchmoney.dev/#delete-category
Parameters:
Name | Type | Description | Default |
---|---|---|---|
category_id |
int
|
Id of the Lunch Money Category |
required |
Returns:
Type | Description |
---|---|
bool
|
|
Source code in lunchable/models/categories.py
remove_category_force(category_id)
#
Forcefully delete a single category
Use this endpoint to force delete a single category or category group and along with it, disassociate the category from any transactions, recurring items, budgets, etc.
Note: it is best practice to first try the Delete Category endpoint to ensure you don't accidentally delete any data. Disassociation/deletion of the data arising from this endpoint is irreversible!
https://lunchmoney.dev/#force-delete-category
Parameters:
Name | Type | Description | Default |
---|---|---|---|
category_id |
int
|
Id of the Lunch Money Category |
required |
Returns:
Type | Description |
---|---|
bool
|
|
Source code in lunchable/models/categories.py
update_category(category_id, name=None, description=None, is_income=None, exclude_from_budget=None, exclude_from_totals=None, group_id=None, archived=None)
#
Update a single category
Use this endpoint to update the properties for a single category or category group
https://lunchmoney.dev/#update-category
Parameters:
Name | Type | Description | Default |
---|---|---|---|
category_id |
int
|
Id of the Lunch Money Category |
required |
name |
Optional[str]
|
Name of category. Must be between 1 and 40 characters. |
None
|
description |
Optional[str]
|
Description of category. Must be less than 140 categories. Defaults to None. |
None
|
is_income |
Optional[bool]
|
Whether or not transactions in this category should be treated as income. Defaults to False. |
None
|
exclude_from_budget |
Optional[bool]
|
Whether or not transactions in this category should be excluded from budgets. Defaults to False. |
None
|
exclude_from_totals |
Optional[bool]
|
Whether or not transactions in this category should be excluded from calculated totals. Defaults to False. |
None
|
group_id |
Optional[int]
|
For a category, set the group_id to include it in a category group |
None
|
archived |
Optional[bool]
|
Whether or not category should be archived. |
None
|
Returns:
Type | Description |
---|---|
bool
|
|
Source code in lunchable/models/categories.py
CategoriesFormatEnum
#
CategoriesObject
#
Bases: LunchableModel
Lunch Money Spending Categories
https://lunchmoney.dev/#categories-object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id |
int
|
A unique identifier for the category. |
required |
name |
str
|
The name of the category. Must be between 1 and 40 characters. |
required |
description |
str | None
|
The description of the category. Must not exceed 140 characters. |
None
|
is_income |
bool
|
If true, the transactions in this category will be treated as income. |
required |
exclude_from_budget |
bool
|
If true, the transactions in this category will be excluded from the budget. |
required |
exclude_from_totals |
bool
|
If true, the transactions in this category will be excluded from totals. |
required |
archived |
bool
|
If true, the category is archived and not displayed in relevant areas of the Lunch Money app. |
False
|
archived_on |
datetime | None
|
The date and time of when the category was last archived (in the ISO 8601 extended format). |
None
|
updated_at |
datetime | None
|
The date and time of when the category was last updated (in the ISO 8601 extended format). |
None
|
created_at |
datetime | None
|
The date and time of when the category was created (in the ISO 8601 extended format). |
None
|
is_group |
bool
|
If true, the category is a group that can be a parent to other categories. |
required |
group_id |
int | None
|
The ID of a category group (or null if the category doesn't belong to a category group). |
None
|
order |
int | None
|
Numerical ordering of categories |
None
|
children |
List[Union[CategoriesObject, CategoryChild]] | None
|
For category groups, this will populate with the categories nested within and include id, name, description and created_at fields. |
None
|
Source code in lunchable/models/categories.py
CategoryChild
#
Bases: LunchableModel
Child Entry on the Category Object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id |
int
|
|
required |
name |
str
|
|
required |
description |
str | None
|
|
None
|
created_at |
datetime | None
|
|
None
|
Source code in lunchable/models/categories.py
ModelCreateCategory
#
Bases: LunchableModel
https://lunchmoney.dev/#create-category
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
|
required |
description |
str | None
|
|
None
|
is_income |
bool | None
|
|
None
|
exclude_from_budget |
bool | None
|
|
None
|
exclude_from_totals |
bool | None
|
|
None
|
archived |
bool | None
|
|
None
|
group_id |
int | None
|
|
None
|