lunchmoney-python 2.9.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. lunchmoney/__init__.py +205 -0
  2. lunchmoney/api/__init__.py +16 -0
  3. lunchmoney/api/categories_api.py +1499 -0
  4. lunchmoney/api/manual_accounts_api.py +1479 -0
  5. lunchmoney/api/me_api.py +293 -0
  6. lunchmoney/api/plaid_accounts_api.py +909 -0
  7. lunchmoney/api/recurring_items_api.py +702 -0
  8. lunchmoney/api/summary_api.py +434 -0
  9. lunchmoney/api/tags_api.py +1465 -0
  10. lunchmoney/api/transactions_api.py +914 -0
  11. lunchmoney/api/transactions_bulk_api.py +1527 -0
  12. lunchmoney/api/transactions_files_api.py +891 -0
  13. lunchmoney/api/transactions_group_api.py +601 -0
  14. lunchmoney/api/transactions_split_api.py +616 -0
  15. lunchmoney/api_client.py +805 -0
  16. lunchmoney/api_response.py +21 -0
  17. lunchmoney/configuration.py +620 -0
  18. lunchmoney/exceptions.py +217 -0
  19. lunchmoney/models/__init__.py +84 -0
  20. lunchmoney/models/account_type_enum.py +46 -0
  21. lunchmoney/models/aligned_category_totals_object.py +108 -0
  22. lunchmoney/models/aligned_summary_category_object.py +110 -0
  23. lunchmoney/models/aligned_summary_response_object.py +104 -0
  24. lunchmoney/models/category_object.py +146 -0
  25. lunchmoney/models/child_category_object.py +141 -0
  26. lunchmoney/models/child_transaction_object.py +219 -0
  27. lunchmoney/models/create_category_request_object.py +137 -0
  28. lunchmoney/models/create_category_request_object_children_inner.py +159 -0
  29. lunchmoney/models/create_manual_account_request_object.py +138 -0
  30. lunchmoney/models/create_manual_account_request_object_balance.py +145 -0
  31. lunchmoney/models/create_new_transactions_request.py +103 -0
  32. lunchmoney/models/create_tag_request_object.py +112 -0
  33. lunchmoney/models/currency_enum.py +198 -0
  34. lunchmoney/models/delete_category_response_with_dependencies.py +94 -0
  35. lunchmoney/models/delete_category_response_with_dependencies_dependents.py +98 -0
  36. lunchmoney/models/delete_tag_response_with_dependencies.py +94 -0
  37. lunchmoney/models/delete_tag_response_with_dependencies_dependents.py +90 -0
  38. lunchmoney/models/delete_transactions_request.py +89 -0
  39. lunchmoney/models/error_response_object.py +98 -0
  40. lunchmoney/models/error_response_object_errors_inner.py +101 -0
  41. lunchmoney/models/get_all_categories200_response.py +96 -0
  42. lunchmoney/models/get_all_manual_accounts200_response.py +96 -0
  43. lunchmoney/models/get_all_plaid_accounts200_response.py +96 -0
  44. lunchmoney/models/get_all_recurring200_response.py +96 -0
  45. lunchmoney/models/get_all_tags200_response.py +96 -0
  46. lunchmoney/models/get_all_transactions200_response.py +100 -0
  47. lunchmoney/models/get_all_transactions_created_since_parameter.py +145 -0
  48. lunchmoney/models/get_budget_summary200_response.py +138 -0
  49. lunchmoney/models/get_transaction_attachment_url200_response.py +91 -0
  50. lunchmoney/models/group_transactions_request.py +122 -0
  51. lunchmoney/models/insert_transaction_object.py +164 -0
  52. lunchmoney/models/insert_transaction_object_amount.py +145 -0
  53. lunchmoney/models/insert_transactions_response_object.py +106 -0
  54. lunchmoney/models/manual_account_object.py +158 -0
  55. lunchmoney/models/non_aligned_category_totals_object.py +94 -0
  56. lunchmoney/models/non_aligned_summary_category_object.py +94 -0
  57. lunchmoney/models/non_aligned_summary_response_object.py +104 -0
  58. lunchmoney/models/plaid_account_object.py +168 -0
  59. lunchmoney/models/recurring_object.py +143 -0
  60. lunchmoney/models/recurring_object_matches.py +105 -0
  61. lunchmoney/models/recurring_object_matches_found_transactions_inner.py +91 -0
  62. lunchmoney/models/recurring_object_overrides.py +92 -0
  63. lunchmoney/models/recurring_object_transaction_criteria.py +149 -0
  64. lunchmoney/models/skipped_existing_external_id_object.py +108 -0
  65. lunchmoney/models/split_transaction_object.py +102 -0
  66. lunchmoney/models/split_transaction_object_amount.py +145 -0
  67. lunchmoney/models/split_transaction_request.py +97 -0
  68. lunchmoney/models/summary_category_occurrence_object.py +126 -0
  69. lunchmoney/models/summary_recurring_transaction_object.py +100 -0
  70. lunchmoney/models/summary_rollover_pool_adjustment_object.py +98 -0
  71. lunchmoney/models/summary_rollover_pool_object.py +98 -0
  72. lunchmoney/models/summary_totals_breakdown_object.py +98 -0
  73. lunchmoney/models/summary_totals_object.py +97 -0
  74. lunchmoney/models/tag_object.py +125 -0
  75. lunchmoney/models/transaction_attachment_object.py +106 -0
  76. lunchmoney/models/transaction_object.py +229 -0
  77. lunchmoney/models/update_category_request_object.py +156 -0
  78. lunchmoney/models/update_manual_account_request_object.py +156 -0
  79. lunchmoney/models/update_manual_account_request_object_balance.py +145 -0
  80. lunchmoney/models/update_tag_request_object.py +126 -0
  81. lunchmoney/models/update_transaction_object.py +228 -0
  82. lunchmoney/models/update_transaction_object_amount.py +145 -0
  83. lunchmoney/models/update_transactions200_response.py +96 -0
  84. lunchmoney/models/update_transactions_request.py +97 -0
  85. lunchmoney/models/update_transactions_request_transactions_inner.py +228 -0
  86. lunchmoney/models/user_object.py +106 -0
  87. lunchmoney/py.typed +0 -0
  88. lunchmoney/rest.py +259 -0
  89. lunchmoney_python-2.9.0.dist-info/METADATA +285 -0
  90. lunchmoney_python-2.9.0.dist-info/RECORD +92 -0
  91. lunchmoney_python-2.9.0.dist-info/WHEEL +5 -0
  92. lunchmoney_python-2.9.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,217 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Lunch Money API - v2
5
+
6
+ Welcome to the Lunch Money v2 API. A working version of this API is now available through these docs, or directly at: `https://api.lunchmoney.dev/v2` <span class=\"red-text\"><strong>This is in alpha launch of a major API update. It is still subject to change during this alpha review period and bugs may still exist. Users are strongly encouraged to use the mock service or to create a test budget with example data as the first step to interacting with the v2 API.</strong></span> See the [Getting Started Guide](https://alpha.lunchmoney.dev/v2/getting-started) for more information on using a test budget.<br<br> If you are new to the v2 API, you may wish to review the [v2 API Overview of Changes](https://alpha.lunchmoney.dev/v2/changelog). ### Static Mock Server You may also use these docs to explore the API using a static mock server endpoint.<p> This enables users to become familiar with the API without having to create an access token, and eliminates the possibility of modifying real data. <p> To access this endpoint select the second endpoint in the the \"Server\" dropdown to the right. When selected you should see \"Static Mock v2 Lunch Money API Server\".<br> When using this server, set your Bearer token to any string with 11 or more characters. ### Migrating from V1 The v2 API is NOT backwards compatible with the v1 API. Developers are encouraged to review the [Migration Guide](https://alpha.lunchmoney.dev/v2/migration-guide) to understand the changes and plan their migration. ### Acknowledgments If you have been providing feedback on the API during our iterative design process, **THANK YOU**. We are happy to provide the opportunity to finally interact with the working API that was built based on your feedback. ### Useful links: - [Getting Started](https://alpha.lunchmoney.dev/v2/getting-started) - [v2 API Changelog](https://alpha.lunchmoney.dev/v2/changelog) - [Migration Guide](https://alpha.lunchmoney.dev/v2/migration-guide) - [Rate Limits](https://alpha.lunchmoney.dev/v2/rate-limits) - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [Awesome Lunch Money Projects](https://github.com/lunch-money/awesome-lunchmoney?tab=readme-ov-file)
7
+
8
+ The version of the OpenAPI document: 2.8.4
9
+ Contact: devsupport@lunchmoney.app
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+ from typing import Any, Optional
16
+ from typing_extensions import Self
17
+
18
+ class OpenApiException(Exception):
19
+ """The base exception class for all OpenAPIExceptions"""
20
+
21
+
22
+ class ApiTypeError(OpenApiException, TypeError):
23
+ def __init__(self, msg, path_to_item=None, valid_classes=None,
24
+ key_type=None) -> None:
25
+ """ Raises an exception for TypeErrors
26
+
27
+ Args:
28
+ msg (str): the exception message
29
+
30
+ Keyword Args:
31
+ path_to_item (list): a list of keys an indices to get to the
32
+ current_item
33
+ None if unset
34
+ valid_classes (tuple): the primitive classes that current item
35
+ should be an instance of
36
+ None if unset
37
+ key_type (bool): False if our value is a value in a dict
38
+ True if it is a key in a dict
39
+ False if our item is an item in a list
40
+ None if unset
41
+ """
42
+ self.path_to_item = path_to_item
43
+ self.valid_classes = valid_classes
44
+ self.key_type = key_type
45
+ full_msg = msg
46
+ if path_to_item:
47
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
48
+ super(ApiTypeError, self).__init__(full_msg)
49
+
50
+
51
+ class ApiValueError(OpenApiException, ValueError):
52
+ def __init__(self, msg, path_to_item=None) -> None:
53
+ """
54
+ Args:
55
+ msg (str): the exception message
56
+
57
+ Keyword Args:
58
+ path_to_item (list) the path to the exception in the
59
+ received_data dict. None if unset
60
+ """
61
+
62
+ self.path_to_item = path_to_item
63
+ full_msg = msg
64
+ if path_to_item:
65
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
66
+ super(ApiValueError, self).__init__(full_msg)
67
+
68
+
69
+ class ApiAttributeError(OpenApiException, AttributeError):
70
+ def __init__(self, msg, path_to_item=None) -> None:
71
+ """
72
+ Raised when an attribute reference or assignment fails.
73
+
74
+ Args:
75
+ msg (str): the exception message
76
+
77
+ Keyword Args:
78
+ path_to_item (None/list) the path to the exception in the
79
+ received_data dict
80
+ """
81
+ self.path_to_item = path_to_item
82
+ full_msg = msg
83
+ if path_to_item:
84
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
85
+ super(ApiAttributeError, self).__init__(full_msg)
86
+
87
+
88
+ class ApiKeyError(OpenApiException, KeyError):
89
+ def __init__(self, msg, path_to_item=None) -> None:
90
+ """
91
+ Args:
92
+ msg (str): the exception message
93
+
94
+ Keyword Args:
95
+ path_to_item (None/list) the path to the exception in the
96
+ received_data dict
97
+ """
98
+ self.path_to_item = path_to_item
99
+ full_msg = msg
100
+ if path_to_item:
101
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
102
+ super(ApiKeyError, self).__init__(full_msg)
103
+
104
+
105
+ class ApiException(OpenApiException):
106
+
107
+ def __init__(
108
+ self,
109
+ status=None,
110
+ reason=None,
111
+ http_resp=None,
112
+ *,
113
+ body: Optional[str] = None,
114
+ data: Optional[Any] = None,
115
+ ) -> None:
116
+ self.status = status
117
+ self.reason = reason
118
+ self.body = body
119
+ self.data = data
120
+ self.headers = None
121
+
122
+ if http_resp:
123
+ if self.status is None:
124
+ self.status = http_resp.status
125
+ if self.reason is None:
126
+ self.reason = http_resp.reason
127
+ if self.body is None:
128
+ try:
129
+ self.body = http_resp.data.decode('utf-8')
130
+ except Exception:
131
+ pass
132
+ self.headers = http_resp.getheaders()
133
+
134
+ @classmethod
135
+ def from_response(
136
+ cls,
137
+ *,
138
+ http_resp,
139
+ body: Optional[str],
140
+ data: Optional[Any],
141
+ ) -> Self:
142
+ if http_resp.status == 400:
143
+ raise BadRequestException(http_resp=http_resp, body=body, data=data)
144
+
145
+ if http_resp.status == 401:
146
+ raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
147
+
148
+ if http_resp.status == 403:
149
+ raise ForbiddenException(http_resp=http_resp, body=body, data=data)
150
+
151
+ if http_resp.status == 404:
152
+ raise NotFoundException(http_resp=http_resp, body=body, data=data)
153
+
154
+ # Added new conditions for 409 and 422
155
+ if http_resp.status == 409:
156
+ raise ConflictException(http_resp=http_resp, body=body, data=data)
157
+
158
+ if http_resp.status == 422:
159
+ raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
160
+
161
+ if 500 <= http_resp.status <= 599:
162
+ raise ServiceException(http_resp=http_resp, body=body, data=data)
163
+ raise ApiException(http_resp=http_resp, body=body, data=data)
164
+
165
+ def __str__(self):
166
+ """Custom error messages for exception"""
167
+ error_message = "({0})\n"\
168
+ "Reason: {1}\n".format(self.status, self.reason)
169
+ if self.headers:
170
+ error_message += "HTTP response headers: {0}\n".format(
171
+ self.headers)
172
+
173
+ if self.data or self.body:
174
+ error_message += "HTTP response body: {0}\n".format(self.data or self.body)
175
+
176
+ return error_message
177
+
178
+
179
+ class BadRequestException(ApiException):
180
+ pass
181
+
182
+
183
+ class NotFoundException(ApiException):
184
+ pass
185
+
186
+
187
+ class UnauthorizedException(ApiException):
188
+ pass
189
+
190
+
191
+ class ForbiddenException(ApiException):
192
+ pass
193
+
194
+
195
+ class ServiceException(ApiException):
196
+ pass
197
+
198
+
199
+ class ConflictException(ApiException):
200
+ """Exception for HTTP 409 Conflict."""
201
+ pass
202
+
203
+
204
+ class UnprocessableEntityException(ApiException):
205
+ """Exception for HTTP 422 Unprocessable Entity."""
206
+ pass
207
+
208
+
209
+ def render_path(path_to_item):
210
+ """Returns a string representation of a path"""
211
+ result = ""
212
+ for pth in path_to_item:
213
+ if isinstance(pth, int):
214
+ result += "[{0}]".format(pth)
215
+ else:
216
+ result += "['{0}']".format(pth)
217
+ return result
@@ -0,0 +1,84 @@
1
+ # coding: utf-8
2
+
3
+ # flake8: noqa
4
+ """
5
+ Lunch Money API - v2
6
+
7
+ Welcome to the Lunch Money v2 API. A working version of this API is now available through these docs, or directly at: `https://api.lunchmoney.dev/v2` <span class=\"red-text\"><strong>This is in alpha launch of a major API update. It is still subject to change during this alpha review period and bugs may still exist. Users are strongly encouraged to use the mock service or to create a test budget with example data as the first step to interacting with the v2 API.</strong></span> See the [Getting Started Guide](https://alpha.lunchmoney.dev/v2/getting-started) for more information on using a test budget.<br<br> If you are new to the v2 API, you may wish to review the [v2 API Overview of Changes](https://alpha.lunchmoney.dev/v2/changelog). ### Static Mock Server You may also use these docs to explore the API using a static mock server endpoint.<p> This enables users to become familiar with the API without having to create an access token, and eliminates the possibility of modifying real data. <p> To access this endpoint select the second endpoint in the the \"Server\" dropdown to the right. When selected you should see \"Static Mock v2 Lunch Money API Server\".<br> When using this server, set your Bearer token to any string with 11 or more characters. ### Migrating from V1 The v2 API is NOT backwards compatible with the v1 API. Developers are encouraged to review the [Migration Guide](https://alpha.lunchmoney.dev/v2/migration-guide) to understand the changes and plan their migration. ### Acknowledgments If you have been providing feedback on the API during our iterative design process, **THANK YOU**. We are happy to provide the opportunity to finally interact with the working API that was built based on your feedback. ### Useful links: - [Getting Started](https://alpha.lunchmoney.dev/v2/getting-started) - [v2 API Changelog](https://alpha.lunchmoney.dev/v2/changelog) - [Migration Guide](https://alpha.lunchmoney.dev/v2/migration-guide) - [Rate Limits](https://alpha.lunchmoney.dev/v2/rate-limits) - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [Awesome Lunch Money Projects](https://github.com/lunch-money/awesome-lunchmoney?tab=readme-ov-file)
8
+
9
+ The version of the OpenAPI document: 2.8.4
10
+ Contact: devsupport@lunchmoney.app
11
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
12
+
13
+ Do not edit the class manually.
14
+ """ # noqa: E501
15
+
16
+ # import models into model package
17
+ from lunchmoney.models.account_type_enum import AccountTypeEnum
18
+ from lunchmoney.models.aligned_category_totals_object import AlignedCategoryTotalsObject
19
+ from lunchmoney.models.aligned_summary_category_object import AlignedSummaryCategoryObject
20
+ from lunchmoney.models.aligned_summary_response_object import AlignedSummaryResponseObject
21
+ from lunchmoney.models.category_object import CategoryObject
22
+ from lunchmoney.models.child_category_object import ChildCategoryObject
23
+ from lunchmoney.models.child_transaction_object import ChildTransactionObject
24
+ from lunchmoney.models.create_category_request_object import CreateCategoryRequestObject
25
+ from lunchmoney.models.create_category_request_object_children_inner import CreateCategoryRequestObjectChildrenInner
26
+ from lunchmoney.models.create_manual_account_request_object import CreateManualAccountRequestObject
27
+ from lunchmoney.models.create_manual_account_request_object_balance import CreateManualAccountRequestObjectBalance
28
+ from lunchmoney.models.create_new_transactions_request import CreateNewTransactionsRequest
29
+ from lunchmoney.models.create_tag_request_object import CreateTagRequestObject
30
+ from lunchmoney.models.currency_enum import CurrencyEnum
31
+ from lunchmoney.models.delete_category_response_with_dependencies import DeleteCategoryResponseWithDependencies
32
+ from lunchmoney.models.delete_category_response_with_dependencies_dependents import DeleteCategoryResponseWithDependenciesDependents
33
+ from lunchmoney.models.delete_tag_response_with_dependencies import DeleteTagResponseWithDependencies
34
+ from lunchmoney.models.delete_tag_response_with_dependencies_dependents import DeleteTagResponseWithDependenciesDependents
35
+ from lunchmoney.models.delete_transactions_request import DeleteTransactionsRequest
36
+ from lunchmoney.models.error_response_object import ErrorResponseObject
37
+ from lunchmoney.models.error_response_object_errors_inner import ErrorResponseObjectErrorsInner
38
+ from lunchmoney.models.get_all_categories200_response import GetAllCategories200Response
39
+ from lunchmoney.models.get_all_manual_accounts200_response import GetAllManualAccounts200Response
40
+ from lunchmoney.models.get_all_plaid_accounts200_response import GetAllPlaidAccounts200Response
41
+ from lunchmoney.models.get_all_recurring200_response import GetAllRecurring200Response
42
+ from lunchmoney.models.get_all_tags200_response import GetAllTags200Response
43
+ from lunchmoney.models.get_all_transactions200_response import GetAllTransactions200Response
44
+ from lunchmoney.models.get_all_transactions_created_since_parameter import GetAllTransactionsCreatedSinceParameter
45
+ from lunchmoney.models.get_budget_summary200_response import GetBudgetSummary200Response
46
+ from lunchmoney.models.get_transaction_attachment_url200_response import GetTransactionAttachmentUrl200Response
47
+ from lunchmoney.models.group_transactions_request import GroupTransactionsRequest
48
+ from lunchmoney.models.insert_transaction_object import InsertTransactionObject
49
+ from lunchmoney.models.insert_transaction_object_amount import InsertTransactionObjectAmount
50
+ from lunchmoney.models.insert_transactions_response_object import InsertTransactionsResponseObject
51
+ from lunchmoney.models.manual_account_object import ManualAccountObject
52
+ from lunchmoney.models.non_aligned_category_totals_object import NonAlignedCategoryTotalsObject
53
+ from lunchmoney.models.non_aligned_summary_category_object import NonAlignedSummaryCategoryObject
54
+ from lunchmoney.models.non_aligned_summary_response_object import NonAlignedSummaryResponseObject
55
+ from lunchmoney.models.plaid_account_object import PlaidAccountObject
56
+ from lunchmoney.models.recurring_object import RecurringObject
57
+ from lunchmoney.models.recurring_object_matches import RecurringObjectMatches
58
+ from lunchmoney.models.recurring_object_matches_found_transactions_inner import RecurringObjectMatchesFoundTransactionsInner
59
+ from lunchmoney.models.recurring_object_overrides import RecurringObjectOverrides
60
+ from lunchmoney.models.recurring_object_transaction_criteria import RecurringObjectTransactionCriteria
61
+ from lunchmoney.models.skipped_existing_external_id_object import SkippedExistingExternalIdObject
62
+ from lunchmoney.models.split_transaction_object import SplitTransactionObject
63
+ from lunchmoney.models.split_transaction_object_amount import SplitTransactionObjectAmount
64
+ from lunchmoney.models.split_transaction_request import SplitTransactionRequest
65
+ from lunchmoney.models.summary_category_occurrence_object import SummaryCategoryOccurrenceObject
66
+ from lunchmoney.models.summary_recurring_transaction_object import SummaryRecurringTransactionObject
67
+ from lunchmoney.models.summary_rollover_pool_adjustment_object import SummaryRolloverPoolAdjustmentObject
68
+ from lunchmoney.models.summary_rollover_pool_object import SummaryRolloverPoolObject
69
+ from lunchmoney.models.summary_totals_breakdown_object import SummaryTotalsBreakdownObject
70
+ from lunchmoney.models.summary_totals_object import SummaryTotalsObject
71
+ from lunchmoney.models.tag_object import TagObject
72
+ from lunchmoney.models.transaction_attachment_object import TransactionAttachmentObject
73
+ from lunchmoney.models.transaction_object import TransactionObject
74
+ from lunchmoney.models.update_category_request_object import UpdateCategoryRequestObject
75
+ from lunchmoney.models.update_manual_account_request_object import UpdateManualAccountRequestObject
76
+ from lunchmoney.models.update_manual_account_request_object_balance import UpdateManualAccountRequestObjectBalance
77
+ from lunchmoney.models.update_tag_request_object import UpdateTagRequestObject
78
+ from lunchmoney.models.update_transaction_object import UpdateTransactionObject
79
+ from lunchmoney.models.update_transaction_object_amount import UpdateTransactionObjectAmount
80
+ from lunchmoney.models.update_transactions200_response import UpdateTransactions200Response
81
+ from lunchmoney.models.update_transactions_request import UpdateTransactionsRequest
82
+ from lunchmoney.models.update_transactions_request_transactions_inner import UpdateTransactionsRequestTransactionsInner
83
+ from lunchmoney.models.user_object import UserObject
84
+
@@ -0,0 +1,46 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Lunch Money API - v2
5
+
6
+ Welcome to the Lunch Money v2 API. A working version of this API is now available through these docs, or directly at: `https://api.lunchmoney.dev/v2` <span class=\"red-text\"><strong>This is in alpha launch of a major API update. It is still subject to change during this alpha review period and bugs may still exist. Users are strongly encouraged to use the mock service or to create a test budget with example data as the first step to interacting with the v2 API.</strong></span> See the [Getting Started Guide](https://alpha.lunchmoney.dev/v2/getting-started) for more information on using a test budget.<br<br> If you are new to the v2 API, you may wish to review the [v2 API Overview of Changes](https://alpha.lunchmoney.dev/v2/changelog). ### Static Mock Server You may also use these docs to explore the API using a static mock server endpoint.<p> This enables users to become familiar with the API without having to create an access token, and eliminates the possibility of modifying real data. <p> To access this endpoint select the second endpoint in the the \"Server\" dropdown to the right. When selected you should see \"Static Mock v2 Lunch Money API Server\".<br> When using this server, set your Bearer token to any string with 11 or more characters. ### Migrating from V1 The v2 API is NOT backwards compatible with the v1 API. Developers are encouraged to review the [Migration Guide](https://alpha.lunchmoney.dev/v2/migration-guide) to understand the changes and plan their migration. ### Acknowledgments If you have been providing feedback on the API during our iterative design process, **THANK YOU**. We are happy to provide the opportunity to finally interact with the working API that was built based on your feedback. ### Useful links: - [Getting Started](https://alpha.lunchmoney.dev/v2/getting-started) - [v2 API Changelog](https://alpha.lunchmoney.dev/v2/changelog) - [Migration Guide](https://alpha.lunchmoney.dev/v2/migration-guide) - [Rate Limits](https://alpha.lunchmoney.dev/v2/rate-limits) - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [Awesome Lunch Money Projects](https://github.com/lunch-money/awesome-lunchmoney?tab=readme-ov-file)
7
+
8
+ The version of the OpenAPI document: 2.8.4
9
+ Contact: devsupport@lunchmoney.app
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import json
18
+ from enum import Enum
19
+ from typing_extensions import Self
20
+
21
+
22
+ class AccountTypeEnum(str, Enum):
23
+ """
24
+ AccountTypeEnum
25
+ """
26
+
27
+ """
28
+ allowed enum values
29
+ """
30
+ CASH = 'cash'
31
+ CREDIT = 'credit'
32
+ CRYPTOCURRENCY = 'cryptocurrency'
33
+ EMPLOYEE_COMPENSATION = 'employee compensation'
34
+ INVESTMENT = 'investment'
35
+ LOAN = 'loan'
36
+ OTHER_LIABILITY = 'other liability'
37
+ OTHER_ASSET = 'other asset'
38
+ REAL_ESTATE = 'real estate'
39
+ VEHICLE = 'vehicle'
40
+
41
+ @classmethod
42
+ def from_json(cls, json_str: str) -> Self:
43
+ """Create an instance of AccountTypeEnum from a JSON string"""
44
+ return cls(json.loads(json_str))
45
+
46
+
@@ -0,0 +1,108 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Lunch Money API - v2
5
+
6
+ Welcome to the Lunch Money v2 API. A working version of this API is now available through these docs, or directly at: `https://api.lunchmoney.dev/v2` <span class=\"red-text\"><strong>This is in alpha launch of a major API update. It is still subject to change during this alpha review period and bugs may still exist. Users are strongly encouraged to use the mock service or to create a test budget with example data as the first step to interacting with the v2 API.</strong></span> See the [Getting Started Guide](https://alpha.lunchmoney.dev/v2/getting-started) for more information on using a test budget.<br<br> If you are new to the v2 API, you may wish to review the [v2 API Overview of Changes](https://alpha.lunchmoney.dev/v2/changelog). ### Static Mock Server You may also use these docs to explore the API using a static mock server endpoint.<p> This enables users to become familiar with the API without having to create an access token, and eliminates the possibility of modifying real data. <p> To access this endpoint select the second endpoint in the the \"Server\" dropdown to the right. When selected you should see \"Static Mock v2 Lunch Money API Server\".<br> When using this server, set your Bearer token to any string with 11 or more characters. ### Migrating from V1 The v2 API is NOT backwards compatible with the v1 API. Developers are encouraged to review the [Migration Guide](https://alpha.lunchmoney.dev/v2/migration-guide) to understand the changes and plan their migration. ### Acknowledgments If you have been providing feedback on the API during our iterative design process, **THANK YOU**. We are happy to provide the opportunity to finally interact with the working API that was built based on your feedback. ### Useful links: - [Getting Started](https://alpha.lunchmoney.dev/v2/getting-started) - [v2 API Changelog](https://alpha.lunchmoney.dev/v2/changelog) - [Migration Guide](https://alpha.lunchmoney.dev/v2/migration-guide) - [Rate Limits](https://alpha.lunchmoney.dev/v2/rate-limits) - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [Awesome Lunch Money Projects](https://github.com/lunch-money/awesome-lunchmoney?tab=readme-ov-file)
7
+
8
+ The version of the OpenAPI document: 2.8.4
9
+ Contact: devsupport@lunchmoney.app
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt
22
+ from typing import Any, ClassVar, Dict, List, Optional, Union
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class AlignedCategoryTotalsObject(BaseModel):
27
+ """
28
+ Total activity for the given category within the given date range which is aligned with budget period setting.
29
+ """ # noqa: E501
30
+ other_activity: Union[StrictFloat, StrictInt] = Field(description="Total non recurring activity, in the user's default currency, for the category within the given date range.<br> The total activity for the category is the sum of this and the recurring_activity.")
31
+ recurring_activity: Union[StrictFloat, StrictInt] = Field(description="Total recurring activity, in the user's default currency, for the category within the given date range.<br> The total activity for the category is the sum of this and the other_activity.")
32
+ budgeted: Optional[Union[StrictFloat, StrictInt]] = Field(description="Total budgeted amount, in the user's default currency, for the category within the given date range or null if the category is not budgeted.")
33
+ available: Optional[Union[StrictFloat, StrictInt]] = Field(description="Total amount of funds available, in the user's default currency, for the category within the given date range.")
34
+ recurring_remaining: Union[StrictFloat, StrictInt] = Field(description="Total expected recurring activity, in the user's default currency, that has not yet occurred for the category within the given date range.")
35
+ recurring_expected: Union[StrictFloat, StrictInt] = Field(description="Total expected recurring activity for the category within the given date range.")
36
+ __properties: ClassVar[List[str]] = ["other_activity", "recurring_activity", "budgeted", "available", "recurring_remaining", "recurring_expected"]
37
+
38
+ model_config = ConfigDict(
39
+ populate_by_name=True,
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+
45
+ def to_str(self) -> str:
46
+ """Returns the string representation of the model using alias"""
47
+ return pprint.pformat(self.model_dump(by_alias=True))
48
+
49
+ def to_json(self) -> str:
50
+ """Returns the JSON representation of the model using alias"""
51
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
+ return json.dumps(self.to_dict())
53
+
54
+ @classmethod
55
+ def from_json(cls, json_str: str) -> Optional[Self]:
56
+ """Create an instance of AlignedCategoryTotalsObject from a JSON string"""
57
+ return cls.from_dict(json.loads(json_str))
58
+
59
+ def to_dict(self) -> Dict[str, Any]:
60
+ """Return the dictionary representation of the model using alias.
61
+
62
+ This has the following differences from calling pydantic's
63
+ `self.model_dump(by_alias=True)`:
64
+
65
+ * `None` is only added to the output dict for nullable fields that
66
+ were set at model initialization. Other fields with value `None`
67
+ are ignored.
68
+ """
69
+ excluded_fields: Set[str] = set([
70
+ ])
71
+
72
+ _dict = self.model_dump(
73
+ by_alias=True,
74
+ exclude=excluded_fields,
75
+ exclude_none=True,
76
+ )
77
+ # set to None if budgeted (nullable) is None
78
+ # and model_fields_set contains the field
79
+ if self.budgeted is None and "budgeted" in self.model_fields_set:
80
+ _dict['budgeted'] = None
81
+
82
+ # set to None if available (nullable) is None
83
+ # and model_fields_set contains the field
84
+ if self.available is None and "available" in self.model_fields_set:
85
+ _dict['available'] = None
86
+
87
+ return _dict
88
+
89
+ @classmethod
90
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
91
+ """Create an instance of AlignedCategoryTotalsObject from a dict"""
92
+ if obj is None:
93
+ return None
94
+
95
+ if not isinstance(obj, dict):
96
+ return cls.model_validate(obj)
97
+
98
+ _obj = cls.model_validate({
99
+ "other_activity": obj.get("other_activity"),
100
+ "recurring_activity": obj.get("recurring_activity"),
101
+ "budgeted": obj.get("budgeted"),
102
+ "available": obj.get("available"),
103
+ "recurring_remaining": obj.get("recurring_remaining"),
104
+ "recurring_expected": obj.get("recurring_expected")
105
+ })
106
+ return _obj
107
+
108
+
@@ -0,0 +1,110 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Lunch Money API - v2
5
+
6
+ Welcome to the Lunch Money v2 API. A working version of this API is now available through these docs, or directly at: `https://api.lunchmoney.dev/v2` <span class=\"red-text\"><strong>This is in alpha launch of a major API update. It is still subject to change during this alpha review period and bugs may still exist. Users are strongly encouraged to use the mock service or to create a test budget with example data as the first step to interacting with the v2 API.</strong></span> See the [Getting Started Guide](https://alpha.lunchmoney.dev/v2/getting-started) for more information on using a test budget.<br<br> If you are new to the v2 API, you may wish to review the [v2 API Overview of Changes](https://alpha.lunchmoney.dev/v2/changelog). ### Static Mock Server You may also use these docs to explore the API using a static mock server endpoint.<p> This enables users to become familiar with the API without having to create an access token, and eliminates the possibility of modifying real data. <p> To access this endpoint select the second endpoint in the the \"Server\" dropdown to the right. When selected you should see \"Static Mock v2 Lunch Money API Server\".<br> When using this server, set your Bearer token to any string with 11 or more characters. ### Migrating from V1 The v2 API is NOT backwards compatible with the v1 API. Developers are encouraged to review the [Migration Guide](https://alpha.lunchmoney.dev/v2/migration-guide) to understand the changes and plan their migration. ### Acknowledgments If you have been providing feedback on the API during our iterative design process, **THANK YOU**. We are happy to provide the opportunity to finally interact with the working API that was built based on your feedback. ### Useful links: - [Getting Started](https://alpha.lunchmoney.dev/v2/getting-started) - [v2 API Changelog](https://alpha.lunchmoney.dev/v2/changelog) - [Migration Guide](https://alpha.lunchmoney.dev/v2/migration-guide) - [Rate Limits](https://alpha.lunchmoney.dev/v2/rate-limits) - [Current v1 Lunch Money API Documentation](https://lunchmoney.dev) - [Awesome Lunch Money Projects](https://github.com/lunch-money/awesome-lunchmoney?tab=readme-ov-file)
7
+
8
+ The version of the OpenAPI document: 2.8.4
9
+ Contact: devsupport@lunchmoney.app
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from lunchmoney.models.aligned_category_totals_object import AlignedCategoryTotalsObject
24
+ from lunchmoney.models.summary_category_occurrence_object import SummaryCategoryOccurrenceObject
25
+ from lunchmoney.models.summary_rollover_pool_object import SummaryRolloverPoolObject
26
+ from typing import Optional, Set
27
+ from typing_extensions import Self
28
+
29
+ class AlignedSummaryCategoryObject(BaseModel):
30
+ """
31
+ List of each category's budget configuration and activity for the given date range.
32
+ """ # noqa: E501
33
+ category_id: StrictInt = Field(description="ID of the category associated with the totals.")
34
+ totals: AlignedCategoryTotalsObject
35
+ occurrences: Optional[List[SummaryCategoryOccurrenceObject]] = None
36
+ rollover_pool: Optional[SummaryRolloverPoolObject] = None
37
+ __properties: ClassVar[List[str]] = ["category_id", "totals", "occurrences", "rollover_pool"]
38
+
39
+ model_config = ConfigDict(
40
+ populate_by_name=True,
41
+ validate_assignment=True,
42
+ protected_namespaces=(),
43
+ )
44
+
45
+
46
+ def to_str(self) -> str:
47
+ """Returns the string representation of the model using alias"""
48
+ return pprint.pformat(self.model_dump(by_alias=True))
49
+
50
+ def to_json(self) -> str:
51
+ """Returns the JSON representation of the model using alias"""
52
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
53
+ return json.dumps(self.to_dict())
54
+
55
+ @classmethod
56
+ def from_json(cls, json_str: str) -> Optional[Self]:
57
+ """Create an instance of AlignedSummaryCategoryObject from a JSON string"""
58
+ return cls.from_dict(json.loads(json_str))
59
+
60
+ def to_dict(self) -> Dict[str, Any]:
61
+ """Return the dictionary representation of the model using alias.
62
+
63
+ This has the following differences from calling pydantic's
64
+ `self.model_dump(by_alias=True)`:
65
+
66
+ * `None` is only added to the output dict for nullable fields that
67
+ were set at model initialization. Other fields with value `None`
68
+ are ignored.
69
+ """
70
+ excluded_fields: Set[str] = set([
71
+ ])
72
+
73
+ _dict = self.model_dump(
74
+ by_alias=True,
75
+ exclude=excluded_fields,
76
+ exclude_none=True,
77
+ )
78
+ # override the default output from pydantic by calling `to_dict()` of totals
79
+ if self.totals:
80
+ _dict['totals'] = self.totals.to_dict()
81
+ # override the default output from pydantic by calling `to_dict()` of each item in occurrences (list)
82
+ _items = []
83
+ if self.occurrences:
84
+ for _item_occurrences in self.occurrences:
85
+ if _item_occurrences:
86
+ _items.append(_item_occurrences.to_dict())
87
+ _dict['occurrences'] = _items
88
+ # override the default output from pydantic by calling `to_dict()` of rollover_pool
89
+ if self.rollover_pool:
90
+ _dict['rollover_pool'] = self.rollover_pool.to_dict()
91
+ return _dict
92
+
93
+ @classmethod
94
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
95
+ """Create an instance of AlignedSummaryCategoryObject from a dict"""
96
+ if obj is None:
97
+ return None
98
+
99
+ if not isinstance(obj, dict):
100
+ return cls.model_validate(obj)
101
+
102
+ _obj = cls.model_validate({
103
+ "category_id": obj.get("category_id"),
104
+ "totals": AlignedCategoryTotalsObject.from_dict(obj["totals"]) if obj.get("totals") is not None else None,
105
+ "occurrences": [SummaryCategoryOccurrenceObject.from_dict(_item) for _item in obj["occurrences"]] if obj.get("occurrences") is not None else None,
106
+ "rollover_pool": SummaryRolloverPoolObject.from_dict(obj["rollover_pool"]) if obj.get("rollover_pool") is not None else None
107
+ })
108
+ return _obj
109
+
110
+