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,104 @@
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, StrictBool
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from lunchmoney.models.non_aligned_summary_category_object import NonAlignedSummaryCategoryObject
24
+ from lunchmoney.models.summary_totals_object import SummaryTotalsObject
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+
28
+ class NonAlignedSummaryResponseObject(BaseModel):
29
+ """
30
+ NonAlignedSummaryResponseObject
31
+ """ # noqa: E501
32
+ totals: Optional[SummaryTotalsObject] = None
33
+ aligned: StrictBool = Field(description="`true` if start_date and end_date are aligned with budget period setting")
34
+ categories: List[NonAlignedSummaryCategoryObject]
35
+ __properties: ClassVar[List[str]] = ["totals", "aligned", "categories"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
+ return json.dumps(self.to_dict())
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of NonAlignedSummaryResponseObject from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ """
68
+ excluded_fields: Set[str] = set([
69
+ ])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ # override the default output from pydantic by calling `to_dict()` of totals
77
+ if self.totals:
78
+ _dict['totals'] = self.totals.to_dict()
79
+ # override the default output from pydantic by calling `to_dict()` of each item in categories (list)
80
+ _items = []
81
+ if self.categories:
82
+ for _item_categories in self.categories:
83
+ if _item_categories:
84
+ _items.append(_item_categories.to_dict())
85
+ _dict['categories'] = _items
86
+ return _dict
87
+
88
+ @classmethod
89
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
90
+ """Create an instance of NonAlignedSummaryResponseObject from a dict"""
91
+ if obj is None:
92
+ return None
93
+
94
+ if not isinstance(obj, dict):
95
+ return cls.model_validate(obj)
96
+
97
+ _obj = cls.model_validate({
98
+ "totals": SummaryTotalsObject.from_dict(obj["totals"]) if obj.get("totals") is not None else None,
99
+ "aligned": obj.get("aligned"),
100
+ "categories": [NonAlignedSummaryCategoryObject.from_dict(_item) for _item in obj["categories"]] if obj.get("categories") is not None else None
101
+ })
102
+ return _obj
103
+
104
+
@@ -0,0 +1,168 @@
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 datetime import date, datetime
22
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator
23
+ from typing import Any, ClassVar, Dict, List, Optional, Union
24
+ from typing_extensions import Annotated
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+
28
+ class PlaidAccountObject(BaseModel):
29
+ """
30
+ An object containing information about an account synced via Plaid
31
+ """ # noqa: E501
32
+ id: StrictInt = Field(description="The unique identifier of this account")
33
+ date_linked: date = Field(description="Date account was first linked in ISO 8601 format")
34
+ name: StrictStr = Field(description="Name of the account. This field is set by Plaid and cannot be altered.")
35
+ display_name: Optional[StrictStr] = Field(description="Optional display name for the account set by the user. If not set, it will return a concatenated string of institution and account name.")
36
+ type: StrictStr = Field(description="Primary type of the account, such as `credit`, `depository`, etc. This field is set by Plaid and cannot be altered.")
37
+ subtype: StrictStr = Field(description="Optional account subtype. This field is set by Plaid and cannot be altered.")
38
+ mask: StrictStr = Field(description="Mask (last 3 to 4 digits of account) of account. This field is set by Plaid and cannot be altered.")
39
+ institution_name: StrictStr = Field(description="Name of institution holding the account. This field is set by Plaid and cannot be altered.")
40
+ status: StrictStr = Field(description="Denotes the current status of the account within Lunch Money. Must be one of<br> - `active`: Account is active and in good state<br> - `inactive`: Account marked inactive from user. Transaction imports and balance updates will not occur for this account.<br> - `relink`: Account needs to be relinked with Plaid.<br> - `syncing`: Account is awaiting first import of transactions. <br> - `not found`: Account cannot be found with Plaid<br> - `not supported`: Account is not supported with Plaid<br> - `error`: Account is in error with Plaid.<br>")
41
+ allow_transaction_modifications: StrictBool = Field(description="If `false`, transactions imported for this synced account can have their properties (such as amount and account) be modified by the user. This option is managed in the web app.")
42
+ limit: Optional[Union[StrictFloat, StrictInt]] = Field(description="Optional credit limit of the account. This field is set by Plaid and cannot be altered")
43
+ balance: StrictStr = Field(description="Current balance of the account in numeric format to 4 decimal places. This field is set by Plaid and cannot be altered.")
44
+ currency: Annotated[str, Field(min_length=3, strict=True, max_length=3)] = Field(description="Three-letter lowercase currency code of the account balance")
45
+ to_base: Union[StrictFloat, StrictInt] = Field(description="The account balance converted to the user's primary currency")
46
+ balance_last_update: Optional[datetime] = Field(description="Date balance was last updated in ISO 8601 extended format. This field is set by Plaid and cannot be altered.")
47
+ import_start_date: Optional[date] = Field(description="Date of earliest date allowed for importing transactions. Transactions earlier than this date are not imported.")
48
+ last_import: Optional[datetime] = Field(description="Timestamp in ISO 8601 extended format of the last time Lunch Money imported new data from Plaid for this account.")
49
+ last_fetch: Optional[datetime] = Field(description="Timestamp in ISO 8601 extended format of the last successful request from Lunch Money for updated data or timestamps from Plaid in ISO 8601 extended format (not necessarily date of last successful import)")
50
+ plaid_last_successful_update: Optional[datetime] = Field(description="Timestamp in ISO 8601 extended format of the last time Plaid successfully connected with institution for new transaction updates, regardless of whether any new data was available in the update.")
51
+ __properties: ClassVar[List[str]] = ["id", "date_linked", "name", "display_name", "type", "subtype", "mask", "institution_name", "status", "allow_transaction_modifications", "limit", "balance", "currency", "to_base", "balance_last_update", "import_start_date", "last_import", "last_fetch", "plaid_last_successful_update"]
52
+
53
+ @field_validator('status')
54
+ def status_validate_enum(cls, value):
55
+ """Validates the enum"""
56
+ if value not in set(['active', 'inactive', 'relink', 'syncing', 'not found', 'not supported', 'error']):
57
+ raise ValueError("must be one of enum values ('active', 'inactive', 'relink', 'syncing', 'not found', 'not supported', 'error')")
58
+ return value
59
+
60
+ model_config = ConfigDict(
61
+ populate_by_name=True,
62
+ validate_assignment=True,
63
+ protected_namespaces=(),
64
+ )
65
+
66
+
67
+ def to_str(self) -> str:
68
+ """Returns the string representation of the model using alias"""
69
+ return pprint.pformat(self.model_dump(by_alias=True))
70
+
71
+ def to_json(self) -> str:
72
+ """Returns the JSON representation of the model using alias"""
73
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
74
+ return json.dumps(self.to_dict())
75
+
76
+ @classmethod
77
+ def from_json(cls, json_str: str) -> Optional[Self]:
78
+ """Create an instance of PlaidAccountObject from a JSON string"""
79
+ return cls.from_dict(json.loads(json_str))
80
+
81
+ def to_dict(self) -> Dict[str, Any]:
82
+ """Return the dictionary representation of the model using alias.
83
+
84
+ This has the following differences from calling pydantic's
85
+ `self.model_dump(by_alias=True)`:
86
+
87
+ * `None` is only added to the output dict for nullable fields that
88
+ were set at model initialization. Other fields with value `None`
89
+ are ignored.
90
+ """
91
+ excluded_fields: Set[str] = set([
92
+ ])
93
+
94
+ _dict = self.model_dump(
95
+ by_alias=True,
96
+ exclude=excluded_fields,
97
+ exclude_none=True,
98
+ )
99
+ # set to None if display_name (nullable) is None
100
+ # and model_fields_set contains the field
101
+ if self.display_name is None and "display_name" in self.model_fields_set:
102
+ _dict['display_name'] = None
103
+
104
+ # set to None if limit (nullable) is None
105
+ # and model_fields_set contains the field
106
+ if self.limit is None and "limit" in self.model_fields_set:
107
+ _dict['limit'] = None
108
+
109
+ # set to None if balance_last_update (nullable) is None
110
+ # and model_fields_set contains the field
111
+ if self.balance_last_update is None and "balance_last_update" in self.model_fields_set:
112
+ _dict['balance_last_update'] = None
113
+
114
+ # set to None if import_start_date (nullable) is None
115
+ # and model_fields_set contains the field
116
+ if self.import_start_date is None and "import_start_date" in self.model_fields_set:
117
+ _dict['import_start_date'] = None
118
+
119
+ # set to None if last_import (nullable) is None
120
+ # and model_fields_set contains the field
121
+ if self.last_import is None and "last_import" in self.model_fields_set:
122
+ _dict['last_import'] = None
123
+
124
+ # set to None if last_fetch (nullable) is None
125
+ # and model_fields_set contains the field
126
+ if self.last_fetch is None and "last_fetch" in self.model_fields_set:
127
+ _dict['last_fetch'] = None
128
+
129
+ # set to None if plaid_last_successful_update (nullable) is None
130
+ # and model_fields_set contains the field
131
+ if self.plaid_last_successful_update is None and "plaid_last_successful_update" in self.model_fields_set:
132
+ _dict['plaid_last_successful_update'] = None
133
+
134
+ return _dict
135
+
136
+ @classmethod
137
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
138
+ """Create an instance of PlaidAccountObject from a dict"""
139
+ if obj is None:
140
+ return None
141
+
142
+ if not isinstance(obj, dict):
143
+ return cls.model_validate(obj)
144
+
145
+ _obj = cls.model_validate({
146
+ "id": obj.get("id"),
147
+ "date_linked": obj.get("date_linked"),
148
+ "name": obj.get("name"),
149
+ "display_name": obj.get("display_name"),
150
+ "type": obj.get("type"),
151
+ "subtype": obj.get("subtype"),
152
+ "mask": obj.get("mask"),
153
+ "institution_name": obj.get("institution_name"),
154
+ "status": obj.get("status"),
155
+ "allow_transaction_modifications": obj.get("allow_transaction_modifications"),
156
+ "limit": obj.get("limit"),
157
+ "balance": obj.get("balance"),
158
+ "currency": obj.get("currency"),
159
+ "to_base": obj.get("to_base"),
160
+ "balance_last_update": obj.get("balance_last_update"),
161
+ "import_start_date": obj.get("import_start_date"),
162
+ "last_import": obj.get("last_import"),
163
+ "last_fetch": obj.get("last_fetch"),
164
+ "plaid_last_successful_update": obj.get("plaid_last_successful_update")
165
+ })
166
+ return _obj
167
+
168
+
@@ -0,0 +1,143 @@
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 datetime import datetime
22
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
23
+ from typing import Any, ClassVar, Dict, List, Optional
24
+ from lunchmoney.models.recurring_object_matches import RecurringObjectMatches
25
+ from lunchmoney.models.recurring_object_overrides import RecurringObjectOverrides
26
+ from lunchmoney.models.recurring_object_transaction_criteria import RecurringObjectTransactionCriteria
27
+ from typing import Optional, Set
28
+ from typing_extensions import Self
29
+
30
+ class RecurringObject(BaseModel):
31
+ """
32
+ RecurringObject
33
+ """ # noqa: E501
34
+ id: StrictInt = Field(description="The unique identifier of this recurring item")
35
+ description: Optional[StrictStr] = Field(description="An optional description of this recurring item.")
36
+ status: StrictStr = Field(description="The status of this recurring item. `suggested` recurring items are generated by Lunch Money, but only `reviewed` recurring items will be applied to matching transactions.")
37
+ transaction_criteria: RecurringObjectTransactionCriteria
38
+ overrides: RecurringObjectOverrides
39
+ matches: Optional[RecurringObjectMatches]
40
+ created_by: StrictInt = Field(description="The ID of the user who created the recurring item.")
41
+ created_at: datetime = Field(description="Date/time the recurring item was created in ISO 8601 extended format.")
42
+ updated_at: datetime = Field(description="Date/time the recurring item was updated in ISO 8601 extended format.")
43
+ source: StrictStr = Field(description="This can be one of four values: - `manual`: User created this recurring item manually from the Recurring Items page - `transaction`: User created this by converting a transaction from the Transactions page - `system`: Recurring item was created by the system on transaction import - `null`: Some older recurring items may not have a source. ")
44
+ __properties: ClassVar[List[str]] = ["id", "description", "status", "transaction_criteria", "overrides", "matches", "created_by", "created_at", "updated_at", "source"]
45
+
46
+ @field_validator('status')
47
+ def status_validate_enum(cls, value):
48
+ """Validates the enum"""
49
+ if value not in set(['suggested', 'reviewed']):
50
+ raise ValueError("must be one of enum values ('suggested', 'reviewed')")
51
+ return value
52
+
53
+ @field_validator('source')
54
+ def source_validate_enum(cls, value):
55
+ """Validates the enum"""
56
+ if value not in set(['manual', 'transaction', 'system']):
57
+ raise ValueError("must be one of enum values ('manual', 'transaction', 'system')")
58
+ return value
59
+
60
+ model_config = ConfigDict(
61
+ populate_by_name=True,
62
+ validate_assignment=True,
63
+ protected_namespaces=(),
64
+ )
65
+
66
+
67
+ def to_str(self) -> str:
68
+ """Returns the string representation of the model using alias"""
69
+ return pprint.pformat(self.model_dump(by_alias=True))
70
+
71
+ def to_json(self) -> str:
72
+ """Returns the JSON representation of the model using alias"""
73
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
74
+ return json.dumps(self.to_dict())
75
+
76
+ @classmethod
77
+ def from_json(cls, json_str: str) -> Optional[Self]:
78
+ """Create an instance of RecurringObject from a JSON string"""
79
+ return cls.from_dict(json.loads(json_str))
80
+
81
+ def to_dict(self) -> Dict[str, Any]:
82
+ """Return the dictionary representation of the model using alias.
83
+
84
+ This has the following differences from calling pydantic's
85
+ `self.model_dump(by_alias=True)`:
86
+
87
+ * `None` is only added to the output dict for nullable fields that
88
+ were set at model initialization. Other fields with value `None`
89
+ are ignored.
90
+ """
91
+ excluded_fields: Set[str] = set([
92
+ ])
93
+
94
+ _dict = self.model_dump(
95
+ by_alias=True,
96
+ exclude=excluded_fields,
97
+ exclude_none=True,
98
+ )
99
+ # override the default output from pydantic by calling `to_dict()` of transaction_criteria
100
+ if self.transaction_criteria:
101
+ _dict['transaction_criteria'] = self.transaction_criteria.to_dict()
102
+ # override the default output from pydantic by calling `to_dict()` of overrides
103
+ if self.overrides:
104
+ _dict['overrides'] = self.overrides.to_dict()
105
+ # override the default output from pydantic by calling `to_dict()` of matches
106
+ if self.matches:
107
+ _dict['matches'] = self.matches.to_dict()
108
+ # set to None if description (nullable) is None
109
+ # and model_fields_set contains the field
110
+ if self.description is None and "description" in self.model_fields_set:
111
+ _dict['description'] = None
112
+
113
+ # set to None if matches (nullable) is None
114
+ # and model_fields_set contains the field
115
+ if self.matches is None and "matches" in self.model_fields_set:
116
+ _dict['matches'] = None
117
+
118
+ return _dict
119
+
120
+ @classmethod
121
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
122
+ """Create an instance of RecurringObject from a dict"""
123
+ if obj is None:
124
+ return None
125
+
126
+ if not isinstance(obj, dict):
127
+ return cls.model_validate(obj)
128
+
129
+ _obj = cls.model_validate({
130
+ "id": obj.get("id"),
131
+ "description": obj.get("description"),
132
+ "status": obj.get("status"),
133
+ "transaction_criteria": RecurringObjectTransactionCriteria.from_dict(obj["transaction_criteria"]) if obj.get("transaction_criteria") is not None else None,
134
+ "overrides": RecurringObjectOverrides.from_dict(obj["overrides"]) if obj.get("overrides") is not None else None,
135
+ "matches": RecurringObjectMatches.from_dict(obj["matches"]) if obj.get("matches") is not None else None,
136
+ "created_by": obj.get("created_by"),
137
+ "created_at": obj.get("created_at"),
138
+ "updated_at": obj.get("updated_at"),
139
+ "source": obj.get("source")
140
+ })
141
+ return _obj
142
+
143
+
@@ -0,0 +1,105 @@
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 datetime import date
22
+ from pydantic import BaseModel, ConfigDict, Field
23
+ from typing import Any, ClassVar, Dict, List, Optional
24
+ from lunchmoney.models.recurring_object_matches_found_transactions_inner import RecurringObjectMatchesFoundTransactionsInner
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+
28
+ class RecurringObjectMatches(BaseModel):
29
+ """
30
+ Details on expected, found and missing transactions for the specified range. This will be `null` for recurring items with a `status` of `suggested`.
31
+ """ # noqa: E501
32
+ request_start_date: Optional[date] = Field(default=None, description="The beginning of the date range that this request used to find matching transactions.")
33
+ request_end_date: Optional[date] = Field(default=None, description="The beginning of the date range that this request used to find matching transactions.")
34
+ expected_occurrence_dates: Optional[List[date]] = Field(default=None, description="A list of dates within the specified range where a recurring transactions is expected.")
35
+ found_transactions: Optional[List[RecurringObjectMatchesFoundTransactionsInner]] = Field(default=None, description="A list with the dates and IDs of matching transactions.")
36
+ missing_transaction_dates: Optional[List[date]] = Field(default=None, description="A list of dates within the range of where a recurring transaction was expected but none was found.")
37
+ __properties: ClassVar[List[str]] = ["request_start_date", "request_end_date", "expected_occurrence_dates", "found_transactions", "missing_transaction_dates"]
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 RecurringObjectMatches 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 each item in found_transactions (list)
79
+ _items = []
80
+ if self.found_transactions:
81
+ for _item_found_transactions in self.found_transactions:
82
+ if _item_found_transactions:
83
+ _items.append(_item_found_transactions.to_dict())
84
+ _dict['found_transactions'] = _items
85
+ return _dict
86
+
87
+ @classmethod
88
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
+ """Create an instance of RecurringObjectMatches from a dict"""
90
+ if obj is None:
91
+ return None
92
+
93
+ if not isinstance(obj, dict):
94
+ return cls.model_validate(obj)
95
+
96
+ _obj = cls.model_validate({
97
+ "request_start_date": obj.get("request_start_date"),
98
+ "request_end_date": obj.get("request_end_date"),
99
+ "expected_occurrence_dates": obj.get("expected_occurrence_dates"),
100
+ "found_transactions": [RecurringObjectMatchesFoundTransactionsInner.from_dict(_item) for _item in obj["found_transactions"]] if obj.get("found_transactions") is not None else None,
101
+ "missing_transaction_dates": obj.get("missing_transaction_dates")
102
+ })
103
+ return _obj
104
+
105
+
@@ -0,0 +1,91 @@
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 datetime import date
22
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt
23
+ from typing import Any, ClassVar, Dict, List, Optional
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class RecurringObjectMatchesFoundTransactionsInner(BaseModel):
28
+ """
29
+ RecurringObjectMatchesFoundTransactionsInner
30
+ """ # noqa: E501
31
+ var_date: Optional[date] = Field(default=None, description="The date for a matching transaction within the specified range.", alias="date")
32
+ transaction_id: Optional[StrictInt] = Field(default=None, description="The ID of a matching transaction within the specified range.")
33
+ __properties: ClassVar[List[str]] = ["date", "transaction_id"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of RecurringObjectMatchesFoundTransactionsInner from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ return _dict
75
+
76
+ @classmethod
77
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78
+ """Create an instance of RecurringObjectMatchesFoundTransactionsInner from a dict"""
79
+ if obj is None:
80
+ return None
81
+
82
+ if not isinstance(obj, dict):
83
+ return cls.model_validate(obj)
84
+
85
+ _obj = cls.model_validate({
86
+ "date": obj.get("date"),
87
+ "transaction_id": obj.get("transaction_id")
88
+ })
89
+ return _obj
90
+
91
+