beancount-gocardless 0.1.7__tar.gz → 0.1.9__tar.gz

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 (32) hide show
  1. beancount_gocardless-0.1.9/.github/workflows/publish.yml +39 -0
  2. beancount_gocardless-0.1.9/.gitignore +182 -0
  3. beancount_gocardless-0.1.9/.pre-commit-config.yaml +13 -0
  4. beancount_gocardless-0.1.9/.readthedocs.yaml +15 -0
  5. beancount_gocardless-0.1.9/LICENSE +24 -0
  6. beancount_gocardless-0.1.9/PKG-INFO +126 -0
  7. beancount_gocardless-0.1.9/README.md +102 -0
  8. beancount_gocardless-0.1.9/docs/Makefile +20 -0
  9. beancount_gocardless-0.1.9/docs/cli.rst +43 -0
  10. beancount_gocardless-0.1.9/docs/client.rst +43 -0
  11. beancount_gocardless-0.1.9/docs/conf.py +69 -0
  12. beancount_gocardless-0.1.9/docs/importer.rst +88 -0
  13. beancount_gocardless-0.1.9/docs/index.rst +77 -0
  14. beancount_gocardless-0.1.9/docs/make.bat +35 -0
  15. beancount_gocardless-0.1.9/pyproject.toml +39 -0
  16. beancount_gocardless-0.1.9/src/beancount_gocardless/__init__.py +10 -0
  17. beancount_gocardless-0.1.9/src/beancount_gocardless/cli.py +108 -0
  18. beancount_gocardless-0.1.9/src/beancount_gocardless/client.py +424 -0
  19. beancount_gocardless-0.1.9/src/beancount_gocardless/importer.py +460 -0
  20. beancount_gocardless-0.1.9/src/beancount_gocardless/models.py +538 -0
  21. beancount_gocardless-0.1.9/src/beancount_gocardless/openapi/swagger.json +5344 -0
  22. beancount_gocardless-0.1.9/src/beancount_gocardless/tui.py +771 -0
  23. beancount_gocardless-0.1.9/src/beancount_gocardless/tui2.py +17 -0
  24. beancount_gocardless-0.1.9/tests/__init__.py +0 -0
  25. beancount_gocardless-0.1.7/LICENSE +0 -19
  26. beancount_gocardless-0.1.7/PKG-INFO +0 -92
  27. beancount_gocardless-0.1.7/README.md +0 -74
  28. beancount_gocardless-0.1.7/pyproject.toml +0 -37
  29. beancount_gocardless-0.1.7/src/beancount_gocardless/__init__.py +0 -2
  30. beancount_gocardless-0.1.7/src/beancount_gocardless/cli.py +0 -82
  31. beancount_gocardless-0.1.7/src/beancount_gocardless/client.py +0 -368
  32. beancount_gocardless-0.1.7/src/beancount_gocardless/importer.py +0 -339
@@ -0,0 +1,39 @@
1
+ name: Upload Python Package to PyPI when a Release is Created
2
+
3
+ on:
4
+ release:
5
+ types: [created]
6
+
7
+ jobs:
8
+ pypi-publish:
9
+ name: Publish release to PyPI
10
+ runs-on: ubuntu-latest
11
+ environment:
12
+ name: pypi
13
+ url: https://pypi.org/p/beancount-gocardless
14
+ permissions:
15
+ id-token: write
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - name: Install uv
19
+ uses: astral-sh/setup-uv@v4
20
+ with:
21
+ version: "latest"
22
+ - name: Set up Python
23
+ uses: actions/setup-python@v4
24
+ with:
25
+ python-version: "3.12"
26
+ - name: Install dependencies
27
+ run: uv sync --extra dev
28
+ - name: Build package
29
+ run: uv build
30
+ - name: Publish package to PyPI
31
+ run: uv publish --token ${{ secrets.PYPI_API_TOKEN }}
32
+ - name: Build Sphinx documentation
33
+ run: |
34
+ uv run sphinx-build -b html docs/ docs/_build
35
+ - name: Upload documentation artifact
36
+ uses: actions/upload-artifact@v4
37
+ with:
38
+ name: sphinx-docs
39
+ path: docs/_build
@@ -0,0 +1,182 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+
110
+ # pdm
111
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112
+ #pdm.lock
113
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114
+ # in version control.
115
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116
+ .pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121
+ __pypackages__/
122
+
123
+ # Celery stuff
124
+ celerybeat-schedule
125
+ celerybeat.pid
126
+
127
+ # SageMath parsed files
128
+ *.sage.py
129
+
130
+ # Environments
131
+ .env
132
+ .venv
133
+ env/
134
+ venv/
135
+ ENV/
136
+ env.bak/
137
+ venv.bak/
138
+
139
+ # Spyder project settings
140
+ .spyderproject
141
+ .spyproject
142
+
143
+ # Rope project settings
144
+ .ropeproject
145
+
146
+ # mkdocs documentation
147
+ /site
148
+
149
+ # mypy
150
+ .mypy_cache/
151
+ .dmypy.json
152
+ dmypy.json
153
+
154
+ # Pyre type checker
155
+ .pyre/⚠️
156
+
157
+ # pytype static type analyzer
158
+ .pytype/
159
+
160
+ # Cython debug symbols
161
+ cython_debug/
162
+
163
+ # PyCharm
164
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
167
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
168
+ #.idea/
169
+
170
+ # Ruff stuff:
171
+ .ruff_cache/
172
+
173
+ # PyPI configuration file
174
+ .pypirc
175
+ **/.DS_Store
176
+
177
+ # GoCardless cache files and temp data
178
+ *.sqlite
179
+ *.bean
180
+
181
+ # API spec files (regenerate from swagger.json)
182
+ openapi.yaml
@@ -0,0 +1,13 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: v0.9.8
4
+ hooks:
5
+ - id: ruff-format
6
+
7
+ - repo: https://github.com/pre-commit/pre-commit-hooks
8
+ rev: v4.5.0
9
+ hooks:
10
+ - id: trailing-whitespace
11
+ - id: end-of-file-fixer
12
+ - id: check-yaml
13
+ - id: check-added-large-files
@@ -0,0 +1,15 @@
1
+ version: 2
2
+
3
+ build:
4
+ os: ubuntu-22.04
5
+ tools:
6
+ python: "3.12"
7
+ jobs:
8
+ post_create_environment:
9
+ - python -m pip install poetry
10
+ post_install:
11
+ - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --with dev
12
+
13
+ sphinx:
14
+ configuration: docs/conf.py
15
+ builder: dirhtml
@@ -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>
@@ -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,102 @@
1
+ beancount-gocardless
2
+ ====================
3
+
4
+ GoCardless API client with models manually recreated from swagger spec, plus Beancount importer.
5
+
6
+ Inspired by https://github.com/tarioch/beancounttools.
7
+
8
+ Full documentation at https://beancount-gocardless.readthedocs.io/en/latest/.
9
+
10
+ **Key Features:**
11
+
12
+ - **API Client:** Models based on swagger spec. Built-in caching via `requests-cache`.
13
+ - **GoCardLess CLI**\: A command-line interface to manage authorization with the GoCardless API:
14
+
15
+ - Listing available banks in a specified country (default: GB).
16
+ - Creating a link to a specific bank using its ID.
17
+ - Listing authorized accounts.
18
+ - Deleting an existing link.
19
+ - Uses environment variables (`GOCARDLESS_SECRET_ID`, `GOCARDLESS_SECRET_KEY`) or command-line arguments for API credentials.
20
+ - **Beancount Importer:** A `beangulp.Importer` implementation to easily import transactions fetched from the GoCardless API directly into your Beancount ledger.
21
+
22
+ You'll need to create a GoCardLess account on https://bankaccountdata.gocardless.com/overview/ to get your credentials.
23
+
24
+ ## Development
25
+
26
+ ### API Coverage
27
+
28
+ The GoCardless client provides **complete API coverage** with Pydantic models for all endpoints and data structures:
29
+
30
+ **🏦 Core Banking:**
31
+ - **Accounts**: Full account metadata, balances, details, and transactions
32
+ - **Institutions**: Bank/institution information and capabilities
33
+ - **Requisitions**: Bank link management with full lifecycle support
34
+
35
+ **📋 Agreements & Permissions:**
36
+ - **End User Agreements**: Complete agreement lifecycle management
37
+ - **Access Scopes**: Granular permission control
38
+ - **Reconfirmations**: Agreement renewal workflows
39
+
40
+ **🔧 Advanced Features:**
41
+ - **Integrations**: Institution capability discovery
42
+ - **Token Management**: JWT token handling (internal)
43
+ - **Pagination**: Full paginated response support
44
+ - **Error Handling**: Error response models
45
+
46
+ **📊 Rich Data Models:**
47
+ - **Transactions**: Complete transaction details with currency exchange, balances, and metadata
48
+ - **Balances**: Multi-currency balance information with transaction impact
49
+ - **Account Details**: Extensive account information including ownership and addresses
50
+
51
+ Models manually recreated from the swagger spec, providing type-safe access to every API feature.
52
+
53
+ **Installation:**
54
+
55
+ ```bash
56
+ pip install beancount-gocardless
57
+ ```
58
+
59
+ **Usage**
60
+ ```yaml
61
+ #### gocardless.yaml
62
+ secret_id: $GOCARDLESS_SECRET_ID
63
+ secret_key: $GOCARDLESS_SECRET_KEY
64
+
65
+ cache_options: # by default, no caching if cache_options is not provided
66
+ cache_name: "gocardless"
67
+ backend: "sqlite"
68
+ expire_after: 3600
69
+ old_data_on_error: true
70
+
71
+ accounts:
72
+ - id: <REDACTED_UUID>
73
+ asset_account: "Assets:Banks:Revolut:Checking"
74
+ ```
75
+
76
+ ```python
77
+ #### my.import
78
+ #!/usr/bin/env python
79
+
80
+ import beangulp
81
+ from beancount_gocardless import GoCardLessImporter
82
+ from smart_importer import apply_hooks, PredictPostings, PredictPayees
83
+
84
+ importers = [
85
+ apply_hooks(
86
+ GoCardLessImporter(),
87
+ [
88
+ PredictPostings(),
89
+ PredictPayees(),
90
+ ],
91
+ )
92
+ ]
93
+
94
+ if __name__ == "__main__":
95
+ ingest = beangulp.Ingest(importers)
96
+ ingest()
97
+ ```
98
+
99
+ Import your data from GoCardLess's API
100
+ ```bash
101
+ python my.import extract ./gocardless.yaml --existing ./ledger.bean
102
+ ```
@@ -0,0 +1,20 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line, and also
5
+ # from the environment for the first two.
6
+ SPHINXOPTS ?=
7
+ SPHINXBUILD ?= sphinx-build
8
+ SOURCEDIR = .
9
+ BUILDDIR = _build
10
+
11
+ # Put it first so that "make" without argument is like "make help".
12
+ help:
13
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
+
15
+ .PHONY: help Makefile
16
+
17
+ # Catch-all target: route all unknown targets to Sphinx using the new
18
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
+ %: Makefile
20
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -0,0 +1,43 @@
1
+ GoCardless CLI
2
+ ===============
3
+
4
+ Commands: list banks, create/delete links, list accounts, check balances. Uses GoCardlessClient. Args or env vars.
5
+
6
+ Usage
7
+ -----
8
+
9
+ .. code-block:: console
10
+
11
+ beancount-gocardless <mode> [options]
12
+
13
+ Modes
14
+ -----
15
+
16
+ - list_banks: Banks by country
17
+ - create_link: Create bank link
18
+ - list_accounts: Connected accounts
19
+ - delete_link: Delete link
20
+ - balance: Account balance
21
+
22
+ Options
23
+ -------
24
+
25
+ - --secret_id: Secret ID (env: GOCARDLESS_SECRET_ID)
26
+ - --secret_key: Secret key (env: GOCARDLESS_SECRET_KEY)
27
+ - --country: Country code, default "GB" (list_banks)
28
+ - --reference: Reference, default "beancount" (create_link/delete_link)
29
+ - --bank: Bank ID (create_link)
30
+ - --account: Account ID (balance)
31
+ - --cache: Enable caching
32
+ - --cache_backend: Backend, default "sqlite"
33
+ - --cache_expire: Expiry secs, default 0
34
+ - --cache_name: Name, default "gocardless"
35
+
36
+ Examples
37
+ --------
38
+
39
+ - List UK banks: beancount-gocardless list_banks --country GB
40
+ - Create link: beancount-gocardless create_link --bank MY_BANK_ID --reference myref
41
+ - List accounts: beancount-gocardless list_accounts
42
+ - Delete link: beancount-gocardless delete_link --reference myref
43
+ - Check balance: beancount-gocardless balance --account MY_ACCOUNT_ID
@@ -0,0 +1,43 @@
1
+ GoCardless Client
2
+ =================
3
+
4
+ Auto-generated from swagger.json. Typed with Pydantic. Full caching support. Header stripping. Token refresh. Cache status check.
5
+
6
+ Features
7
+ --------
8
+
9
+ - Typed responses via Pydantic models
10
+ - Convenience methods: list_banks(), create_bank_link(), get_all_accounts()
11
+ - All 14 API endpoints
12
+ - Error handling with token refresh
13
+ - Caching: sqlite, configurable expiry
14
+ - Header stripping for privacy
15
+ - Cache debugging via check_cache_status()
16
+
17
+ Usage
18
+ -----
19
+
20
+ .. code-block:: python
21
+
22
+ from beancount_gocardless import GoCardlessClient
23
+
24
+ client = GoCardlessClient("secret_id", "secret_key", cache_options={
25
+ "cache_name": "my_cache",
26
+ "expire_after": 3600
27
+ })
28
+
29
+ banks = client.list_banks("GB")
30
+ accounts = client.get_all_accounts()
31
+
32
+ CLI
33
+ ---
34
+
35
+ .. code-block:: bash
36
+
37
+ beancount-gocardless list_banks --country GB --cache --cache_expire 3600
38
+ beancount-gocardless create_link --reference mybank --bank SANDBOXFINANCE_SFIN0000 --cache
39
+
40
+ Regeneration
41
+ ------------
42
+
43
+ Update API: cd openapi; ./regen_simple_client.sh
@@ -0,0 +1,69 @@
1
+ import os
2
+ import sys
3
+
4
+ sys.path.insert(0, os.path.abspath("../src")) # Correct path to your source
5
+
6
+ print()
7
+
8
+ # Configuration file for the Sphinx documentation builder.
9
+ #
10
+ # For the full list of built-in configuration values, see the documentation:
11
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html
12
+
13
+ # -- Project information -----------------------------------------------------
14
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
15
+
16
+ project = "beancount-gocardless"
17
+ copyright = "2025, forgx1"
18
+ author = "forgx1"
19
+ release = "0.1.0"
20
+
21
+ # -- General configuration ---------------------------------------------------
22
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
23
+
24
+ extensions = [
25
+ "myst_parser",
26
+ "sphinx.ext.autodoc",
27
+ "sphinx.ext.napoleon",
28
+ "sphinx.ext.viewcode",
29
+ "sphinx.ext.autodoc.typehints",
30
+ ]
31
+ # Add this to enable Markdown in docstrings:
32
+ autodoc_mock_imports = ["requests", "requests-cache", "beancount", "beangulp", "pyyaml"]
33
+ autodoc_default_options = {
34
+ "members": True,
35
+ "undoc-members": True,
36
+ "show-inheritance": True,
37
+ "special-members": "__init__",
38
+ }
39
+ autodoc_typehints = "description"
40
+
41
+ # Napoleon settings for Google and NumPy style docstrings
42
+ napoleon_google_docstring = True
43
+ napoleon_numpy_docstring = True
44
+ napoleon_use_param = True
45
+ napoleon_use_rtype = True
46
+ napoleon_use_ivar = True
47
+ templates_path = ["_templates"]
48
+
49
+ exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
50
+
51
+ # Enable proper parsing of markdown in docstrings
52
+ source_suffix = {
53
+ ".rst": "restructuredtext",
54
+ ".md": "markdown",
55
+ }
56
+
57
+ # MyST parser settings for markdown support
58
+ myst_parse_docstrings = True
59
+ myst_enable_extensions = [
60
+ "colon_fence",
61
+ "deflist",
62
+ ]
63
+
64
+
65
+ # -- Options for HTML output -------------------------------------------------
66
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
67
+
68
+ html_theme = "sphinx_rtd_theme"
69
+ html_static_path = ["_static"]