beancount-gocardless 0.1.8__py3-none-any.whl → 0.1.9__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.
- beancount_gocardless/__init__.py +10 -2
- beancount_gocardless/cli.py +70 -44
- beancount_gocardless/client.py +323 -326
- beancount_gocardless/importer.py +246 -125
- beancount_gocardless/models.py +538 -0
- beancount_gocardless/openapi/swagger.json +5344 -0
- beancount_gocardless/tui.py +771 -0
- beancount_gocardless/tui2.py +17 -0
- beancount_gocardless-0.1.9.dist-info/METADATA +126 -0
- beancount_gocardless-0.1.9.dist-info/RECORD +13 -0
- {beancount_gocardless-0.1.8.dist-info → beancount_gocardless-0.1.9.dist-info}/WHEEL +1 -1
- beancount_gocardless-0.1.9.dist-info/entry_points.txt +3 -0
- beancount_gocardless-0.1.9.dist-info/licenses/LICENSE +24 -0
- beancount_gocardless-0.1.8.dist-info/LICENSE +0 -19
- beancount_gocardless-0.1.8.dist-info/METADATA +0 -92
- beancount_gocardless-0.1.8.dist-info/RECORD +0 -9
- beancount_gocardless-0.1.8.dist-info/entry_points.txt +0 -3
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from textual.app import App, ComposeResult
|
|
2
|
+
from textual.widgets import Header, Footer, Label
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
raise Exception
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class MinimalApp(App):
|
|
9
|
+
TITLE = "Minimal Test App"
|
|
10
|
+
|
|
11
|
+
def compose(self) -> ComposeResult:
|
|
12
|
+
yield Header()
|
|
13
|
+
yield Label("If you see this, MinimalApp from tui.py is running!")
|
|
14
|
+
yield Footer()
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
app = MinimalApp()
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: beancount-gocardless
|
|
3
|
+
Version: 0.1.9
|
|
4
|
+
License-Expression: Unlicense
|
|
5
|
+
License-File: LICENSE
|
|
6
|
+
Requires-Python: <4,>=3.12
|
|
7
|
+
Requires-Dist: beancount
|
|
8
|
+
Requires-Dist: beangulp
|
|
9
|
+
Requires-Dist: pre-commit>=4.5.1
|
|
10
|
+
Requires-Dist: pydantic>=2.0.0
|
|
11
|
+
Requires-Dist: pyyaml
|
|
12
|
+
Requires-Dist: requests
|
|
13
|
+
Requires-Dist: requests-cache
|
|
14
|
+
Requires-Dist: rich
|
|
15
|
+
Requires-Dist: textual-dev>=1.7.0
|
|
16
|
+
Requires-Dist: textual>=3.2.0
|
|
17
|
+
Provides-Extra: dev
|
|
18
|
+
Requires-Dist: myst-parser; extra == 'dev'
|
|
19
|
+
Requires-Dist: sphinx; extra == 'dev'
|
|
20
|
+
Requires-Dist: sphinx-rtd-theme; extra == 'dev'
|
|
21
|
+
Provides-Extra: lint
|
|
22
|
+
Requires-Dist: ruff>=0.9.8; extra == 'lint'
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
beancount-gocardless
|
|
26
|
+
====================
|
|
27
|
+
|
|
28
|
+
GoCardless API client with models manually recreated from swagger spec, plus Beancount importer.
|
|
29
|
+
|
|
30
|
+
Inspired by https://github.com/tarioch/beancounttools.
|
|
31
|
+
|
|
32
|
+
Full documentation at https://beancount-gocardless.readthedocs.io/en/latest/.
|
|
33
|
+
|
|
34
|
+
**Key Features:**
|
|
35
|
+
|
|
36
|
+
- **API Client:** Models based on swagger spec. Built-in caching via `requests-cache`.
|
|
37
|
+
- **GoCardLess CLI**\: A command-line interface to manage authorization with the GoCardless API:
|
|
38
|
+
|
|
39
|
+
- Listing available banks in a specified country (default: GB).
|
|
40
|
+
- Creating a link to a specific bank using its ID.
|
|
41
|
+
- Listing authorized accounts.
|
|
42
|
+
- Deleting an existing link.
|
|
43
|
+
- Uses environment variables (`GOCARDLESS_SECRET_ID`, `GOCARDLESS_SECRET_KEY`) or command-line arguments for API credentials.
|
|
44
|
+
- **Beancount Importer:** A `beangulp.Importer` implementation to easily import transactions fetched from the GoCardless API directly into your Beancount ledger.
|
|
45
|
+
|
|
46
|
+
You'll need to create a GoCardLess account on https://bankaccountdata.gocardless.com/overview/ to get your credentials.
|
|
47
|
+
|
|
48
|
+
## Development
|
|
49
|
+
|
|
50
|
+
### API Coverage
|
|
51
|
+
|
|
52
|
+
The GoCardless client provides **complete API coverage** with Pydantic models for all endpoints and data structures:
|
|
53
|
+
|
|
54
|
+
**🏦 Core Banking:**
|
|
55
|
+
- **Accounts**: Full account metadata, balances, details, and transactions
|
|
56
|
+
- **Institutions**: Bank/institution information and capabilities
|
|
57
|
+
- **Requisitions**: Bank link management with full lifecycle support
|
|
58
|
+
|
|
59
|
+
**📋 Agreements & Permissions:**
|
|
60
|
+
- **End User Agreements**: Complete agreement lifecycle management
|
|
61
|
+
- **Access Scopes**: Granular permission control
|
|
62
|
+
- **Reconfirmations**: Agreement renewal workflows
|
|
63
|
+
|
|
64
|
+
**🔧 Advanced Features:**
|
|
65
|
+
- **Integrations**: Institution capability discovery
|
|
66
|
+
- **Token Management**: JWT token handling (internal)
|
|
67
|
+
- **Pagination**: Full paginated response support
|
|
68
|
+
- **Error Handling**: Error response models
|
|
69
|
+
|
|
70
|
+
**📊 Rich Data Models:**
|
|
71
|
+
- **Transactions**: Complete transaction details with currency exchange, balances, and metadata
|
|
72
|
+
- **Balances**: Multi-currency balance information with transaction impact
|
|
73
|
+
- **Account Details**: Extensive account information including ownership and addresses
|
|
74
|
+
|
|
75
|
+
Models manually recreated from the swagger spec, providing type-safe access to every API feature.
|
|
76
|
+
|
|
77
|
+
**Installation:**
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
pip install beancount-gocardless
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Usage**
|
|
84
|
+
```yaml
|
|
85
|
+
#### gocardless.yaml
|
|
86
|
+
secret_id: $GOCARDLESS_SECRET_ID
|
|
87
|
+
secret_key: $GOCARDLESS_SECRET_KEY
|
|
88
|
+
|
|
89
|
+
cache_options: # by default, no caching if cache_options is not provided
|
|
90
|
+
cache_name: "gocardless"
|
|
91
|
+
backend: "sqlite"
|
|
92
|
+
expire_after: 3600
|
|
93
|
+
old_data_on_error: true
|
|
94
|
+
|
|
95
|
+
accounts:
|
|
96
|
+
- id: <REDACTED_UUID>
|
|
97
|
+
asset_account: "Assets:Banks:Revolut:Checking"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
#### my.import
|
|
102
|
+
#!/usr/bin/env python
|
|
103
|
+
|
|
104
|
+
import beangulp
|
|
105
|
+
from beancount_gocardless import GoCardLessImporter
|
|
106
|
+
from smart_importer import apply_hooks, PredictPostings, PredictPayees
|
|
107
|
+
|
|
108
|
+
importers = [
|
|
109
|
+
apply_hooks(
|
|
110
|
+
GoCardLessImporter(),
|
|
111
|
+
[
|
|
112
|
+
PredictPostings(),
|
|
113
|
+
PredictPayees(),
|
|
114
|
+
],
|
|
115
|
+
)
|
|
116
|
+
]
|
|
117
|
+
|
|
118
|
+
if __name__ == "__main__":
|
|
119
|
+
ingest = beangulp.Ingest(importers)
|
|
120
|
+
ingest()
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Import your data from GoCardLess's API
|
|
124
|
+
```bash
|
|
125
|
+
python my.import extract ./gocardless.yaml --existing ./ledger.bean
|
|
126
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
beancount_gocardless/__init__.py,sha256=HNLcqMQMk27W16-tkWfU31C_1lDfwRHj6PR1j1UYs_M,275
|
|
2
|
+
beancount_gocardless/cli.py,sha256=OLfpesyTQLIqhdtipoGW9gZ2sdC6_BuMvOIs8Zf5yvw,3358
|
|
3
|
+
beancount_gocardless/client.py,sha256=eBr3VVrnQIFMwRBmoIC8VN9JvtsDhGZge75nYW7Fyns,15402
|
|
4
|
+
beancount_gocardless/importer.py,sha256=JRkuc40ux49y3UKVx-HgwxGkbmxROSIXuiSwFT9Obi0,16621
|
|
5
|
+
beancount_gocardless/models.py,sha256=RlqUitg2kaykP4WQVhHkhtF187NFFOLjrxpC3ncWCB8,17661
|
|
6
|
+
beancount_gocardless/tui.py,sha256=qAPL9zSNF5lJ43PiBRWRJ7nyrRdtziSgVoDoXDsCsq8,29947
|
|
7
|
+
beancount_gocardless/tui2.py,sha256=eQWh-KbqsoiqgZKLvDDpPov1DX1w9aV2cdIHZzvrJck,350
|
|
8
|
+
beancount_gocardless/openapi/swagger.json,sha256=t8TLbt0l2UOyorZX8JyoG4XO2qtXDRYUlsllM3ckyG4,264957
|
|
9
|
+
beancount_gocardless-0.1.9.dist-info/METADATA,sha256=AuaDbJLfw0f1sXNtsXF4P79-ARlEtjnALxQFUedBrLg,3937
|
|
10
|
+
beancount_gocardless-0.1.9.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
11
|
+
beancount_gocardless-0.1.9.dist-info/entry_points.txt,sha256=_l8n11k9nGPaSDou4atu5NkV0Ojf-qjW2zIIGPzmmgA,128
|
|
12
|
+
beancount_gocardless-0.1.9.dist-info/licenses/LICENSE,sha256=awOCsWJ58m_2kBQwBUGWejVqZm6wuRtCL2hi9rfa0X4,1211
|
|
13
|
+
beancount_gocardless-0.1.9.dist-info/RECORD,,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
This is free and unencumbered software released into the public domain.
|
|
2
|
+
|
|
3
|
+
Anyone is free to copy, modify, publish, use, compile, sell, or
|
|
4
|
+
distribute this software, either in source code form or as a compiled
|
|
5
|
+
binary, for any purpose, commercial or non-commercial, and by any
|
|
6
|
+
means.
|
|
7
|
+
|
|
8
|
+
In jurisdictions that recognize copyright laws, the author or authors
|
|
9
|
+
of this software dedicate any and all copyright interest in the
|
|
10
|
+
software to the public domain. We make this dedication for the benefit
|
|
11
|
+
of the public at large and to the detriment of our heirs and
|
|
12
|
+
successors. We intend this dedication to be an overt act of
|
|
13
|
+
relinquishment in perpetuity of all present and future rights to this
|
|
14
|
+
software under copyright law.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
20
|
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
21
|
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
+
|
|
24
|
+
For more information, please refer to <https://unlicense.org>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2018 The Python Packaging Authority
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
-
in the Software without restriction, including without limitation the rights
|
|
6
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
-
furnished to do so, subject to the following conditions:
|
|
9
|
-
|
|
10
|
-
The above copyright notice and this permission notice shall be included in all
|
|
11
|
-
copies or substantial portions of the Software.
|
|
12
|
-
|
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
-
SOFTWARE.
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.3
|
|
2
|
-
Name: beancount-gocardless
|
|
3
|
-
Version: 0.1.8
|
|
4
|
-
Summary:
|
|
5
|
-
License: MIT
|
|
6
|
-
Requires-Python: >=3.12
|
|
7
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
|
9
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
11
|
-
Requires-Dist: beancount
|
|
12
|
-
Requires-Dist: beangulp
|
|
13
|
-
Requires-Dist: pyyaml
|
|
14
|
-
Requires-Dist: requests
|
|
15
|
-
Requires-Dist: requests-cache
|
|
16
|
-
Description-Content-Type: text/markdown
|
|
17
|
-
|
|
18
|
-
beancount-gocardless
|
|
19
|
-
====================
|
|
20
|
-
|
|
21
|
-
This package provides a basic client for interacting with the GoCardless API (formerly Nordigen) and importing your data into Beancount.
|
|
22
|
-
|
|
23
|
-
This project was inspired by https://github.com/tarioch/beancounttools
|
|
24
|
-
|
|
25
|
-
Full documentation available at https://beancount-gocardless.readthedocs.io/en/latest/
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
**Key Features:**
|
|
29
|
-
|
|
30
|
-
- **GoCardless API Client:** A client for interacting with the GoCardless API. The client has built-in caching via `requests-cache`.
|
|
31
|
-
- **GoCardLess CLI**\: A command-line interface to manage authorization with the GoCardless API:
|
|
32
|
-
|
|
33
|
-
- Listing available banks in a specified country (default: GB).
|
|
34
|
-
- Creating a link to a specific bank using its ID.
|
|
35
|
-
- Listing authorized accounts.
|
|
36
|
-
- Deleting an existing link.
|
|
37
|
-
- Uses environment variables (`NORDIGEN_SECRET_ID`, `NORDIGEN_SECRET_KEY`) or command-line arguments for API credentials.
|
|
38
|
-
- **Beancount Importer:** A `beangulp.Importer` implementation to easily import transactions fetched from the GoCardless API directly into your Beancount ledger.
|
|
39
|
-
|
|
40
|
-
You'll need to create a GoCardLess account on https://bankaccountdata.gocardless.com/overview/ to get your credentials.
|
|
41
|
-
|
|
42
|
-
**Installation:**
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
pip install beancount-gocardless
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
**Usage**
|
|
49
|
-
```yaml
|
|
50
|
-
#### nordigen.yaml
|
|
51
|
-
secret_id: $NORDIGEN_SECRET_ID
|
|
52
|
-
secret_key: $NORDIGEN_SECRET_KEY
|
|
53
|
-
|
|
54
|
-
cache_options: # by default, no caching if cache_options is not provided
|
|
55
|
-
cache_name: "nordigen"
|
|
56
|
-
backend: "sqlite"
|
|
57
|
-
expire_after: 3600
|
|
58
|
-
old_data_on_error: true
|
|
59
|
-
|
|
60
|
-
accounts:
|
|
61
|
-
- id: <REDACTED_UUID>
|
|
62
|
-
asset_account: "Assets:Banks:Revolut:Checking"
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
```python
|
|
66
|
-
#### my.import
|
|
67
|
-
#!/usr/bin/env python
|
|
68
|
-
|
|
69
|
-
import beangulp
|
|
70
|
-
from beancount_gocardless import NordigenImporter
|
|
71
|
-
from smart_importer import apply_hooks, PredictPostings, PredictPayees
|
|
72
|
-
|
|
73
|
-
importers = [
|
|
74
|
-
apply_hooks(
|
|
75
|
-
NordigenImporter(),
|
|
76
|
-
[
|
|
77
|
-
PredictPostings(),
|
|
78
|
-
PredictPayees(),
|
|
79
|
-
],
|
|
80
|
-
)
|
|
81
|
-
]
|
|
82
|
-
|
|
83
|
-
if __name__ == "__main__":
|
|
84
|
-
ingest = beangulp.Ingest(importers)
|
|
85
|
-
ingest()
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
Import your data from Nordigen's API
|
|
89
|
-
```bash
|
|
90
|
-
python my.import extract ./nordigen.yaml --existing ./ledger.bean
|
|
91
|
-
```
|
|
92
|
-
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
beancount_gocardless/__init__.py,sha256=Rf2-pfuaXaXPwBu3yEn2uXyOQ6uLyGxljJ5hoTCss5Y,100
|
|
2
|
-
beancount_gocardless/cli.py,sha256=ZdsdknScEOlUq_7rI0ixzN1UDh1dgUokzTzO_3WySqY,2407
|
|
3
|
-
beancount_gocardless/client.py,sha256=g2Px7mcM34ibEAVzbxUtCTVrGWO1sm_CmCL-PXySHro,15764
|
|
4
|
-
beancount_gocardless/importer.py,sha256=tjNKPCYFddR62YDAXm6rfLqcVNeiGKWbVAEyoPWPekg,11151
|
|
5
|
-
beancount_gocardless-0.1.8.dist-info/LICENSE,sha256=7EI8xVBu6h_7_JlVw-yPhhOZlpY9hP8wal7kHtqKT_E,1074
|
|
6
|
-
beancount_gocardless-0.1.8.dist-info/METADATA,sha256=-WXcAySDk-rankLsjnn9keWLVrrscByJdwl2n1h1bkw,2634
|
|
7
|
-
beancount_gocardless-0.1.8.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
|
8
|
-
beancount_gocardless-0.1.8.dist-info/entry_points.txt,sha256=fmhiRcNVrum0p30f5YNqvIYVEPXYsS5cP1xNkVmdn8k,70
|
|
9
|
-
beancount_gocardless-0.1.8.dist-info/RECORD,,
|