beancount-tools-collection 1.0.0__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.
- beancount_tools_collection-1.0.0/LICENSE +21 -0
- beancount_tools_collection-1.0.0/PKG-INFO +275 -0
- beancount_tools_collection-1.0.0/README.md +228 -0
- beancount_tools_collection-1.0.0/pyproject.toml +71 -0
- beancount_tools_collection-1.0.0/setup.cfg +4 -0
- beancount_tools_collection-1.0.0/src/beancount_tools_collection/__init__.py +18 -0
- beancount_tools_collection-1.0.0/src/beancount_tools_collection/importers/__init__.py +58 -0
- beancount_tools_collection-1.0.0/src/beancount_tools_collection/importers/finpension.py +406 -0
- beancount_tools_collection-1.0.0/src/beancount_tools_collection/importers/firefly_iii.py +74 -0
- beancount_tools_collection-1.0.0/src/beancount_tools_collection/importers/ibkr.py +1465 -0
- beancount_tools_collection-1.0.0/src/beancount_tools_collection/importers/revolut.py +119 -0
- beancount_tools_collection-1.0.0/src/beancount_tools_collection/importers/viac.py +536 -0
- beancount_tools_collection-1.0.0/src/beancount_tools_collection/importers/viseca.py +183 -0
- beancount_tools_collection-1.0.0/src/beancount_tools_collection/importers/yuh.py +371 -0
- beancount_tools_collection-1.0.0/src/beancount_tools_collection/plugins/__init__.py +8 -0
- beancount_tools_collection-1.0.0/src/beancount_tools_collection/prices/__init__.py +19 -0
- beancount_tools_collection-1.0.0/src/beancount_tools_collection/prices/ibkr.py +56 -0
- beancount_tools_collection-1.0.0/src/beancount_tools_collection/scripts/__init__.py +8 -0
- beancount_tools_collection-1.0.0/src/beancount_tools_collection/utils/__init__.py +0 -0
- beancount_tools_collection-1.0.0/src/beancount_tools_collection/utils/adapter.py +21 -0
- beancount_tools_collection-1.0.0/src/beancount_tools_collection/utils/example_basic.py +108 -0
- beancount_tools_collection-1.0.0/src/beancount_tools_collection/utils/transactionInspector.py +80 -0
- beancount_tools_collection-1.0.0/src/beancount_tools_collection.egg-info/PKG-INFO +275 -0
- beancount_tools_collection-1.0.0/src/beancount_tools_collection.egg-info/SOURCES.txt +26 -0
- beancount_tools_collection-1.0.0/src/beancount_tools_collection.egg-info/dependency_links.txt +1 -0
- beancount_tools_collection-1.0.0/src/beancount_tools_collection.egg-info/requires.txt +23 -0
- beancount_tools_collection-1.0.0/src/beancount_tools_collection.egg-info/top_level.txt +1 -0
- beancount_tools_collection-1.0.0/tests/test_ibkr_live.py +141 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Beancount Tools Collection Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: beancount-tools-collection
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A comprehensive collection of beancount tools: importers, price fetchers, plugins, and utilities
|
|
5
|
+
Author-email: Alexandre Joly <alexandre.joly@mekanics.ch>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/mekanics/beancount-tools-collection
|
|
8
|
+
Project-URL: Repository, https://github.com/mekanics/beancount-tools-collection
|
|
9
|
+
Project-URL: Documentation, https://github.com/mekanics/beancount-tools-collection#readme
|
|
10
|
+
Project-URL: Bug Tracker, https://github.com/mekanics/beancount-tools-collection/issues
|
|
11
|
+
Keywords: beancount,accounting,finance,importers,prices,plugins,tools,banks,trading,investment
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Office/Business :: Financial :: Accounting
|
|
22
|
+
Requires-Python: >=3.9
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: beancount>=3.1.0
|
|
26
|
+
Requires-Dist: beangulp>=0.2.0
|
|
27
|
+
Requires-Dist: pandas>=1.3.0
|
|
28
|
+
Requires-Dist: python-dateutil>=2.8.0
|
|
29
|
+
Requires-Dist: loguru>=0.7.3
|
|
30
|
+
Requires-Dist: pyyaml>=5.4.0
|
|
31
|
+
Requires-Dist: ibflex>=0.15
|
|
32
|
+
Requires-Dist: requests>=2.32.4
|
|
33
|
+
Requires-Dist: beanquery>=0.2.0
|
|
34
|
+
Provides-Extra: dev
|
|
35
|
+
Requires-Dist: pytest>=6.0; extra == "dev"
|
|
36
|
+
Requires-Dist: pytest-cov>=2.12; extra == "dev"
|
|
37
|
+
Requires-Dist: black>=21.0; extra == "dev"
|
|
38
|
+
Requires-Dist: isort>=5.9; extra == "dev"
|
|
39
|
+
Requires-Dist: flake8>=3.9; extra == "dev"
|
|
40
|
+
Requires-Dist: mypy>=0.910; extra == "dev"
|
|
41
|
+
Requires-Dist: beangulp; extra == "dev"
|
|
42
|
+
Requires-Dist: beancount; extra == "dev"
|
|
43
|
+
Provides-Extra: test
|
|
44
|
+
Requires-Dist: pytest>=6.0; extra == "test"
|
|
45
|
+
Requires-Dist: pytest-cov>=2.12; extra == "test"
|
|
46
|
+
Dynamic: license-file
|
|
47
|
+
|
|
48
|
+
# Beancount Tools Collection
|
|
49
|
+
|
|
50
|
+
🧮 My personal collection of beancount tools including importers, price fetchers, plugins, and utilities for various financial institutions.
|
|
51
|
+
|
|
52
|
+
[](https://www.python.org/downloads/)
|
|
53
|
+
[](https://opensource.org/licenses/MIT)
|
|
54
|
+
[](https://github.com/mekanics/beancount-tools-collection/issues)
|
|
55
|
+
|
|
56
|
+
## Features
|
|
57
|
+
|
|
58
|
+
### 📥 Data Importers
|
|
59
|
+
|
|
60
|
+
**Swiss Institutions:**
|
|
61
|
+
|
|
62
|
+
- **Yuh** - CSV exports
|
|
63
|
+
- **Viseca** - JSON transaction exports (including Migros Cumulus Credit Card)
|
|
64
|
+
- **VIAC** - JSON transaction exports (pillar 2 & 3a)
|
|
65
|
+
- **Finpension** - CSV transaction reports (pillar 3a)
|
|
66
|
+
|
|
67
|
+
**International Institutions:**
|
|
68
|
+
|
|
69
|
+
- **Interactive Brokers** - FlexQuery XML reports (global)
|
|
70
|
+
- **Revolut** - CSV exports (multi-country)
|
|
71
|
+
|
|
72
|
+
**Other Formats:**
|
|
73
|
+
|
|
74
|
+
- **Firefly III** - CSV exports
|
|
75
|
+
|
|
76
|
+
### 💰 Price Fetchers
|
|
77
|
+
|
|
78
|
+
- **Interactive Brokers** - Real-time prices from FlexQuery
|
|
79
|
+
|
|
80
|
+
### 🔌 Beancount Plugins
|
|
81
|
+
|
|
82
|
+
- _Crickets chirping_ 🦗 - This section is as empty as my wallet after buying crypto at the peak
|
|
83
|
+
|
|
84
|
+
### 🛠️ Utility Scripts
|
|
85
|
+
|
|
86
|
+
- **Transaction Processor** - Example transaction processing with ImporterProtocolAdapter and TransactionInspector for automatic categorization and payee standardization
|
|
87
|
+
|
|
88
|
+
## Installation
|
|
89
|
+
|
|
90
|
+
### From PyPI
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
pip install beancount-tools-collection
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### From Source
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
git clone https://github.com/mekanics/beancount-tools-collection.git
|
|
100
|
+
cd beancount-tools-collection
|
|
101
|
+
pip install -e .
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Quick Start
|
|
105
|
+
|
|
106
|
+
### Basic Importer Configuration
|
|
107
|
+
|
|
108
|
+
```python
|
|
109
|
+
from beancount_tools_collection.importers import (
|
|
110
|
+
finpension, ibkr, revolut,
|
|
111
|
+
viac, viseca, yuh
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
# Example configuration
|
|
115
|
+
CONFIG = [
|
|
116
|
+
# Swiss institutions
|
|
117
|
+
finpension.FinpensionImporter(
|
|
118
|
+
root_account="Assets:Pension:S3:Finpension:Portfolio1",
|
|
119
|
+
deposit_account="Assets:Checking",
|
|
120
|
+
isin_lookup={
|
|
121
|
+
"CH0132501898": "CH0132501898", # Example ISIN mapping
|
|
122
|
+
# ... more ISINs
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
|
|
126
|
+
viac.ViacImporter(
|
|
127
|
+
root_account="Assets:Pension:S3a:Viac:Portfolio1",
|
|
128
|
+
deposit_account="Assets:Checking",
|
|
129
|
+
share_lookup={
|
|
130
|
+
"UBS SMI": {"isin": "CH0033782431", "symbol": "CH0033782431"},
|
|
131
|
+
# ... more share mappings
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
|
|
135
|
+
yuh.YuhImporter(
|
|
136
|
+
account="Assets:Cash:Yuh:CHF",
|
|
137
|
+
goals_base_account="Assets:Savings:Yuh"
|
|
138
|
+
),
|
|
139
|
+
|
|
140
|
+
# International institutions
|
|
141
|
+
ibkr.IBKRImporter(
|
|
142
|
+
Mainaccount="Assets:Invest:InteractiveBrokers",
|
|
143
|
+
DivAccount="Income:Dividends:InteractiveBrokers",
|
|
144
|
+
WHTAccount="Expenses:Taxes:WithholdingTax",
|
|
145
|
+
PnLAccount="Income:Invest:Gains",
|
|
146
|
+
FeesAccount="Expenses:Invest:Fees",
|
|
147
|
+
configFile="ibkr.yaml" # Your IBKR FlexQuery config
|
|
148
|
+
),
|
|
149
|
+
|
|
150
|
+
revolut.RevolutImporter(
|
|
151
|
+
"revolut_chf",
|
|
152
|
+
"Assets:Cash:Revolut:CHF",
|
|
153
|
+
"CHF"
|
|
154
|
+
),
|
|
155
|
+
]
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Price Fetcher Configuration
|
|
159
|
+
|
|
160
|
+
```python
|
|
161
|
+
# In your beancount price configuration
|
|
162
|
+
from beancount_tools_collection.prices import ibkr
|
|
163
|
+
|
|
164
|
+
# The IBKR price source will be available for bean-price
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Documentation
|
|
168
|
+
|
|
169
|
+
### Importer-Specific Setup
|
|
170
|
+
|
|
171
|
+
Each importer has specific requirements and configuration options:
|
|
172
|
+
|
|
173
|
+
- **[Finpension](docs/importers/finpension.md)** - CSV transaction reports
|
|
174
|
+
- **[Interactive Brokers](docs/importers/ibkr.md)** - FlexQuery configuration
|
|
175
|
+
- **[VIAC](docs/importers/viac.md)** - JSON export setup
|
|
176
|
+
- **[Yuh](docs/importers/yuh.md)** - CSV export configuration
|
|
177
|
+
|
|
178
|
+
### Account Structure Examples
|
|
179
|
+
|
|
180
|
+
The importers work best with structured account hierarchies:
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
Assets:
|
|
184
|
+
Cash:
|
|
185
|
+
Yuh:
|
|
186
|
+
CHF
|
|
187
|
+
USD
|
|
188
|
+
Revolut:
|
|
189
|
+
CHF
|
|
190
|
+
EUR
|
|
191
|
+
Invest:
|
|
192
|
+
InteractiveBrokers:
|
|
193
|
+
Long-Term:
|
|
194
|
+
VTI
|
|
195
|
+
VXUS
|
|
196
|
+
USD
|
|
197
|
+
Pension:
|
|
198
|
+
S3a:
|
|
199
|
+
Finpension:
|
|
200
|
+
Portfolio1:
|
|
201
|
+
CHF
|
|
202
|
+
Viac:
|
|
203
|
+
Portfolio1:
|
|
204
|
+
CH0132501898
|
|
205
|
+
|
|
206
|
+
Income:
|
|
207
|
+
Dividends:
|
|
208
|
+
InteractiveBrokers:
|
|
209
|
+
Long-Term:
|
|
210
|
+
USD
|
|
211
|
+
Pension:
|
|
212
|
+
S3a:
|
|
213
|
+
Finpension:
|
|
214
|
+
Portfolio1:
|
|
215
|
+
Interest:
|
|
216
|
+
CHF
|
|
217
|
+
|
|
218
|
+
Expenses:
|
|
219
|
+
Invest:
|
|
220
|
+
Fees:
|
|
221
|
+
CHF
|
|
222
|
+
USD
|
|
223
|
+
Taxes:
|
|
224
|
+
WithholdingTax
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## Contributing
|
|
228
|
+
|
|
229
|
+
We welcome contributions! Here's how you can help:
|
|
230
|
+
|
|
231
|
+
1. **Add new importers** for financial institutions
|
|
232
|
+
2. **Improve existing importers** with bug fixes and features
|
|
233
|
+
3. **Add price fetchers** for different data sources
|
|
234
|
+
4. **Create plugins** for common beancount workflows
|
|
235
|
+
5. **Improve documentation** and examples
|
|
236
|
+
|
|
237
|
+
### Development Setup
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
git clone https://github.com/mekanics/beancount-tools-collection.git
|
|
241
|
+
cd beancount-tools-collection
|
|
242
|
+
pip install -e ".[dev]"
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Running Tests
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
pytest
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Code Formatting
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
black src/
|
|
255
|
+
isort src/
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
## License
|
|
259
|
+
|
|
260
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
261
|
+
|
|
262
|
+
## Acknowledgments
|
|
263
|
+
|
|
264
|
+
- The [beancount](https://github.com/beancount/beancount) project for the excellent accounting framework
|
|
265
|
+
- Various open-source beancount importers that served as inspiration
|
|
266
|
+
|
|
267
|
+
## Support
|
|
268
|
+
|
|
269
|
+
- 📖 [Documentation](https://github.com/mekanics/beancount-tools-collection#readme)
|
|
270
|
+
- 🐛 [Bug Reports](https://github.com/mekanics/beancount-tools-collection/issues)
|
|
271
|
+
- 💬 [Discussions](https://github.com/mekanics/beancount-tools-collection/discussions)
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
**Made with ❤️ for personal finance tracking**
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
# Beancount Tools Collection
|
|
2
|
+
|
|
3
|
+
🧮 My personal collection of beancount tools including importers, price fetchers, plugins, and utilities for various financial institutions.
|
|
4
|
+
|
|
5
|
+
[](https://www.python.org/downloads/)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://github.com/mekanics/beancount-tools-collection/issues)
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
### 📥 Data Importers
|
|
12
|
+
|
|
13
|
+
**Swiss Institutions:**
|
|
14
|
+
|
|
15
|
+
- **Yuh** - CSV exports
|
|
16
|
+
- **Viseca** - JSON transaction exports (including Migros Cumulus Credit Card)
|
|
17
|
+
- **VIAC** - JSON transaction exports (pillar 2 & 3a)
|
|
18
|
+
- **Finpension** - CSV transaction reports (pillar 3a)
|
|
19
|
+
|
|
20
|
+
**International Institutions:**
|
|
21
|
+
|
|
22
|
+
- **Interactive Brokers** - FlexQuery XML reports (global)
|
|
23
|
+
- **Revolut** - CSV exports (multi-country)
|
|
24
|
+
|
|
25
|
+
**Other Formats:**
|
|
26
|
+
|
|
27
|
+
- **Firefly III** - CSV exports
|
|
28
|
+
|
|
29
|
+
### 💰 Price Fetchers
|
|
30
|
+
|
|
31
|
+
- **Interactive Brokers** - Real-time prices from FlexQuery
|
|
32
|
+
|
|
33
|
+
### 🔌 Beancount Plugins
|
|
34
|
+
|
|
35
|
+
- _Crickets chirping_ 🦗 - This section is as empty as my wallet after buying crypto at the peak
|
|
36
|
+
|
|
37
|
+
### 🛠️ Utility Scripts
|
|
38
|
+
|
|
39
|
+
- **Transaction Processor** - Example transaction processing with ImporterProtocolAdapter and TransactionInspector for automatic categorization and payee standardization
|
|
40
|
+
|
|
41
|
+
## Installation
|
|
42
|
+
|
|
43
|
+
### From PyPI
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pip install beancount-tools-collection
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### From Source
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
git clone https://github.com/mekanics/beancount-tools-collection.git
|
|
53
|
+
cd beancount-tools-collection
|
|
54
|
+
pip install -e .
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Quick Start
|
|
58
|
+
|
|
59
|
+
### Basic Importer Configuration
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
from beancount_tools_collection.importers import (
|
|
63
|
+
finpension, ibkr, revolut,
|
|
64
|
+
viac, viseca, yuh
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
# Example configuration
|
|
68
|
+
CONFIG = [
|
|
69
|
+
# Swiss institutions
|
|
70
|
+
finpension.FinpensionImporter(
|
|
71
|
+
root_account="Assets:Pension:S3:Finpension:Portfolio1",
|
|
72
|
+
deposit_account="Assets:Checking",
|
|
73
|
+
isin_lookup={
|
|
74
|
+
"CH0132501898": "CH0132501898", # Example ISIN mapping
|
|
75
|
+
# ... more ISINs
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
|
|
79
|
+
viac.ViacImporter(
|
|
80
|
+
root_account="Assets:Pension:S3a:Viac:Portfolio1",
|
|
81
|
+
deposit_account="Assets:Checking",
|
|
82
|
+
share_lookup={
|
|
83
|
+
"UBS SMI": {"isin": "CH0033782431", "symbol": "CH0033782431"},
|
|
84
|
+
# ... more share mappings
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
|
|
88
|
+
yuh.YuhImporter(
|
|
89
|
+
account="Assets:Cash:Yuh:CHF",
|
|
90
|
+
goals_base_account="Assets:Savings:Yuh"
|
|
91
|
+
),
|
|
92
|
+
|
|
93
|
+
# International institutions
|
|
94
|
+
ibkr.IBKRImporter(
|
|
95
|
+
Mainaccount="Assets:Invest:InteractiveBrokers",
|
|
96
|
+
DivAccount="Income:Dividends:InteractiveBrokers",
|
|
97
|
+
WHTAccount="Expenses:Taxes:WithholdingTax",
|
|
98
|
+
PnLAccount="Income:Invest:Gains",
|
|
99
|
+
FeesAccount="Expenses:Invest:Fees",
|
|
100
|
+
configFile="ibkr.yaml" # Your IBKR FlexQuery config
|
|
101
|
+
),
|
|
102
|
+
|
|
103
|
+
revolut.RevolutImporter(
|
|
104
|
+
"revolut_chf",
|
|
105
|
+
"Assets:Cash:Revolut:CHF",
|
|
106
|
+
"CHF"
|
|
107
|
+
),
|
|
108
|
+
]
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Price Fetcher Configuration
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
# In your beancount price configuration
|
|
115
|
+
from beancount_tools_collection.prices import ibkr
|
|
116
|
+
|
|
117
|
+
# The IBKR price source will be available for bean-price
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Documentation
|
|
121
|
+
|
|
122
|
+
### Importer-Specific Setup
|
|
123
|
+
|
|
124
|
+
Each importer has specific requirements and configuration options:
|
|
125
|
+
|
|
126
|
+
- **[Finpension](docs/importers/finpension.md)** - CSV transaction reports
|
|
127
|
+
- **[Interactive Brokers](docs/importers/ibkr.md)** - FlexQuery configuration
|
|
128
|
+
- **[VIAC](docs/importers/viac.md)** - JSON export setup
|
|
129
|
+
- **[Yuh](docs/importers/yuh.md)** - CSV export configuration
|
|
130
|
+
|
|
131
|
+
### Account Structure Examples
|
|
132
|
+
|
|
133
|
+
The importers work best with structured account hierarchies:
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
Assets:
|
|
137
|
+
Cash:
|
|
138
|
+
Yuh:
|
|
139
|
+
CHF
|
|
140
|
+
USD
|
|
141
|
+
Revolut:
|
|
142
|
+
CHF
|
|
143
|
+
EUR
|
|
144
|
+
Invest:
|
|
145
|
+
InteractiveBrokers:
|
|
146
|
+
Long-Term:
|
|
147
|
+
VTI
|
|
148
|
+
VXUS
|
|
149
|
+
USD
|
|
150
|
+
Pension:
|
|
151
|
+
S3a:
|
|
152
|
+
Finpension:
|
|
153
|
+
Portfolio1:
|
|
154
|
+
CHF
|
|
155
|
+
Viac:
|
|
156
|
+
Portfolio1:
|
|
157
|
+
CH0132501898
|
|
158
|
+
|
|
159
|
+
Income:
|
|
160
|
+
Dividends:
|
|
161
|
+
InteractiveBrokers:
|
|
162
|
+
Long-Term:
|
|
163
|
+
USD
|
|
164
|
+
Pension:
|
|
165
|
+
S3a:
|
|
166
|
+
Finpension:
|
|
167
|
+
Portfolio1:
|
|
168
|
+
Interest:
|
|
169
|
+
CHF
|
|
170
|
+
|
|
171
|
+
Expenses:
|
|
172
|
+
Invest:
|
|
173
|
+
Fees:
|
|
174
|
+
CHF
|
|
175
|
+
USD
|
|
176
|
+
Taxes:
|
|
177
|
+
WithholdingTax
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## Contributing
|
|
181
|
+
|
|
182
|
+
We welcome contributions! Here's how you can help:
|
|
183
|
+
|
|
184
|
+
1. **Add new importers** for financial institutions
|
|
185
|
+
2. **Improve existing importers** with bug fixes and features
|
|
186
|
+
3. **Add price fetchers** for different data sources
|
|
187
|
+
4. **Create plugins** for common beancount workflows
|
|
188
|
+
5. **Improve documentation** and examples
|
|
189
|
+
|
|
190
|
+
### Development Setup
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
git clone https://github.com/mekanics/beancount-tools-collection.git
|
|
194
|
+
cd beancount-tools-collection
|
|
195
|
+
pip install -e ".[dev]"
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Running Tests
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
pytest
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Code Formatting
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
black src/
|
|
208
|
+
isort src/
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## License
|
|
212
|
+
|
|
213
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
214
|
+
|
|
215
|
+
## Acknowledgments
|
|
216
|
+
|
|
217
|
+
- The [beancount](https://github.com/beancount/beancount) project for the excellent accounting framework
|
|
218
|
+
- Various open-source beancount importers that served as inspiration
|
|
219
|
+
|
|
220
|
+
## Support
|
|
221
|
+
|
|
222
|
+
- 📖 [Documentation](https://github.com/mekanics/beancount-tools-collection#readme)
|
|
223
|
+
- 🐛 [Bug Reports](https://github.com/mekanics/beancount-tools-collection/issues)
|
|
224
|
+
- 💬 [Discussions](https://github.com/mekanics/beancount-tools-collection/discussions)
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
**Made with ❤️ for personal finance tracking**
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "beancount-tools-collection"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "A comprehensive collection of beancount tools: importers, price fetchers, plugins, and utilities"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = {text = "MIT"}
|
|
11
|
+
authors = [
|
|
12
|
+
{name = "Alexandre Joly", email = "alexandre.joly@mekanics.ch"}
|
|
13
|
+
]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"Intended Audience :: End Users/Desktop",
|
|
17
|
+
"License :: OSI Approved :: MIT License",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3.9",
|
|
20
|
+
"Programming Language :: Python :: 3.10",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
"Topic :: Office/Business :: Financial :: Accounting",
|
|
25
|
+
]
|
|
26
|
+
keywords = ["beancount", "accounting", "finance", "importers", "prices", "plugins", "tools", "banks", "trading", "investment"]
|
|
27
|
+
requires-python = ">=3.9"
|
|
28
|
+
dependencies = [
|
|
29
|
+
"beancount>=3.1.0",
|
|
30
|
+
"beangulp>=0.2.0",
|
|
31
|
+
"pandas>=1.3.0",
|
|
32
|
+
"python-dateutil>=2.8.0",
|
|
33
|
+
"loguru>=0.7.3",
|
|
34
|
+
"pyyaml>=5.4.0",
|
|
35
|
+
"ibflex>=0.15", # for IBKR importer
|
|
36
|
+
"requests>=2.32.4", # for price fetchers
|
|
37
|
+
"beanquery>=0.2.0",
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
[project.optional-dependencies]
|
|
41
|
+
dev = [
|
|
42
|
+
"pytest>=6.0",
|
|
43
|
+
"pytest-cov>=2.12",
|
|
44
|
+
"black>=21.0",
|
|
45
|
+
"isort>=5.9",
|
|
46
|
+
"flake8>=3.9",
|
|
47
|
+
"mypy>=0.910",
|
|
48
|
+
"beangulp",
|
|
49
|
+
"beancount"
|
|
50
|
+
]
|
|
51
|
+
test = [
|
|
52
|
+
"pytest>=6.0",
|
|
53
|
+
"pytest-cov>=2.12",
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
[project.urls]
|
|
57
|
+
Homepage = "https://github.com/mekanics/beancount-tools-collection"
|
|
58
|
+
Repository = "https://github.com/mekanics/beancount-tools-collection"
|
|
59
|
+
Documentation = "https://github.com/mekanics/beancount-tools-collection#readme"
|
|
60
|
+
"Bug Tracker" = "https://github.com/mekanics/beancount-tools-collection/issues"
|
|
61
|
+
|
|
62
|
+
[tool.setuptools.packages.find]
|
|
63
|
+
where = ["src"]
|
|
64
|
+
|
|
65
|
+
[tool.black]
|
|
66
|
+
line-length = 88
|
|
67
|
+
target-version = ['py39']
|
|
68
|
+
|
|
69
|
+
[tool.isort]
|
|
70
|
+
profile = "black"
|
|
71
|
+
line_length = 88
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Beancount Tools Collection
|
|
3
|
+
|
|
4
|
+
A comprehensive collection of beancount tools including importers, price fetchers,
|
|
5
|
+
plugins, and utilities for financial institutions worldwide.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
__version__ = "1.0.0"
|
|
9
|
+
__author__ = "Beancount Tools Collection Contributors"
|
|
10
|
+
|
|
11
|
+
# Make main modules easily accessible
|
|
12
|
+
from . import importers
|
|
13
|
+
from . import prices
|
|
14
|
+
from . import plugins
|
|
15
|
+
from . import scripts
|
|
16
|
+
from . import utils
|
|
17
|
+
|
|
18
|
+
__all__ = ["importers", "prices", "plugins", "scripts", "utils"]
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Beancount importers for various financial institutions.
|
|
3
|
+
|
|
4
|
+
This module contains importers for Swiss and international financial institutions.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
# Import all available importers
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
try:
|
|
11
|
+
from . import finpension
|
|
12
|
+
except ImportError:
|
|
13
|
+
finpension = None
|
|
14
|
+
|
|
15
|
+
try:
|
|
16
|
+
from . import ibkr
|
|
17
|
+
except ImportError:
|
|
18
|
+
ibkr = None
|
|
19
|
+
|
|
20
|
+
try:
|
|
21
|
+
from . import revolut
|
|
22
|
+
except ImportError:
|
|
23
|
+
revolut = None
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
try:
|
|
28
|
+
from . import viac
|
|
29
|
+
except ImportError:
|
|
30
|
+
viac = None
|
|
31
|
+
|
|
32
|
+
try:
|
|
33
|
+
from . import viseca
|
|
34
|
+
except ImportError:
|
|
35
|
+
viseca = None
|
|
36
|
+
|
|
37
|
+
try:
|
|
38
|
+
from . import yuh
|
|
39
|
+
except ImportError:
|
|
40
|
+
yuh = None
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
try:
|
|
45
|
+
from . import firefly_iii
|
|
46
|
+
except ImportError:
|
|
47
|
+
firefly_iii = None
|
|
48
|
+
|
|
49
|
+
# List of available importers (only those that imported successfully)
|
|
50
|
+
__all__ = [name for name, module in locals().items()
|
|
51
|
+
if module is not None and not name.startswith('_')]
|
|
52
|
+
|
|
53
|
+
# Metadata
|
|
54
|
+
SUPPORTED_INSTITUTIONS = {
|
|
55
|
+
'swiss': ['finpension', 'viac', 'viseca', 'yuh'],
|
|
56
|
+
'international': ['ibkr', 'revolut'],
|
|
57
|
+
'other': ['firefly_iii']
|
|
58
|
+
}
|