@fuzzle/opencode-accountant 0.0.6 → 0.0.7-next.1
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.
- package/README.md +77 -0
- package/agent/accountant.md +1 -0
- package/dist/index.js +1641 -3
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -87,6 +87,83 @@ The `source` field accepts any source supported by [pricehist](https://github.co
|
|
|
87
87
|
- `ecb` - European Central Bank exchange rates
|
|
88
88
|
- `yahoo` - Yahoo Finance (use `fmt_base` for proper formatting)
|
|
89
89
|
|
|
90
|
+
### Statement Classification Configuration
|
|
91
|
+
|
|
92
|
+
The `classify-statements` tool classifies bank statement CSV files by provider and currency, moving them to the appropriate directories for import processing. Create a `config/import/providers.yaml` file:
|
|
93
|
+
|
|
94
|
+
```yaml
|
|
95
|
+
paths:
|
|
96
|
+
imports: statements/imports
|
|
97
|
+
pending: doc/agent/todo/import
|
|
98
|
+
done: doc/agent/done/import
|
|
99
|
+
unrecognized: statements/imports/unrecognized
|
|
100
|
+
|
|
101
|
+
providers:
|
|
102
|
+
revolut:
|
|
103
|
+
detect:
|
|
104
|
+
- filenamePattern: '^account-statement_'
|
|
105
|
+
header: 'Type,Product,Started Date,Completed Date,Description,Amount,Fee,Currency,State,Balance'
|
|
106
|
+
currencyField: Currency
|
|
107
|
+
- filenamePattern: '^crypto-account-statement_'
|
|
108
|
+
header: 'Symbol,Type,Quantity,Price,Value,Fees,Date'
|
|
109
|
+
currencyField: Symbol
|
|
110
|
+
currencies:
|
|
111
|
+
CHF: chf
|
|
112
|
+
EUR: eur
|
|
113
|
+
USD: usd
|
|
114
|
+
BTC: btc
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
#### Configuration Options
|
|
118
|
+
|
|
119
|
+
**Paths:**
|
|
120
|
+
|
|
121
|
+
| Field | Description |
|
|
122
|
+
| -------------- | ----------------------------------------------- |
|
|
123
|
+
| `imports` | Drop zone for new CSV files |
|
|
124
|
+
| `pending` | Base path for classified files awaiting import |
|
|
125
|
+
| `done` | Base path for archived files after import |
|
|
126
|
+
| `unrecognized` | Directory for files that couldn't be classified |
|
|
127
|
+
|
|
128
|
+
**Provider Detection Rules:**
|
|
129
|
+
|
|
130
|
+
| Field | Description |
|
|
131
|
+
| ----------------- | ----------------------------------------------------- |
|
|
132
|
+
| `filenamePattern` | Regex pattern to match against filename |
|
|
133
|
+
| `header` | Expected CSV header row (exact match) |
|
|
134
|
+
| `currencyField` | Column name containing the currency/symbol |
|
|
135
|
+
| `currencies` | Map of raw currency values to normalized folder names |
|
|
136
|
+
|
|
137
|
+
#### Directory Structure
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
your-project/
|
|
141
|
+
├── config/
|
|
142
|
+
│ └── import/
|
|
143
|
+
│ └── providers.yaml
|
|
144
|
+
├── statements/
|
|
145
|
+
│ └── import/ # Drop CSV files here
|
|
146
|
+
│ └── unrecognized/ # Unclassified files moved here
|
|
147
|
+
└── doc/
|
|
148
|
+
└── agent/
|
|
149
|
+
├── todo/
|
|
150
|
+
│ └── import/
|
|
151
|
+
│ └── <provider>/ # e.g. revolut
|
|
152
|
+
│ └── <currency>/ # e.g. chf, eur, usd, btc
|
|
153
|
+
└── done/
|
|
154
|
+
└── import/
|
|
155
|
+
└── <provider>/
|
|
156
|
+
└── <currency>/
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
#### Workflow
|
|
160
|
+
|
|
161
|
+
1. Drop CSV files into `statements/import/`
|
|
162
|
+
2. Run `classify-statements` tool
|
|
163
|
+
3. Files are moved to `doc/agent/todo/import/<provider>/<currency>/`
|
|
164
|
+
4. Unrecognized files are moved to `statements/import/unrecognized/`
|
|
165
|
+
5. After successful import, files should be moved to `doc/agent/done/import/`
|
|
166
|
+
|
|
90
167
|
## Development
|
|
91
168
|
|
|
92
169
|
- `mise run build` - Build the module
|
package/agent/accountant.md
CHANGED