banco 2.0.0 → 2.0.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.
- checksums.yaml +4 -4
- data/lib/banco/version.rb +1 -1
- metadata +3 -143
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2fff9d6e23f5a1f630f3366775e8b43caaf1206b190bccfc90122bc6e74b6f02
|
|
4
|
+
data.tar.gz: 0b65cc28746a9aa7a89cc0a495076e66c4e7155316c9f71c11b716d6a5dde962
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aa028b563ffa1112a8d95079099d313107f2eb4da4097b9ae18d0f53c7bba62b3f981b50b0fd0e9165725eb026fa9a768a6f3ed7f7efe79b3031346201d2c7d7
|
|
7
|
+
data.tar.gz: 9bb8bd7dd0e9c1baeb2ed20b77e4d35da9561e1bab8479ecd9a0f4c0fcd491e90abf3939669c2dc366beb497a55230b51a2701125c13e8eb82e90db8aca60c9d
|
data/lib/banco/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: banco
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- s33d
|
|
@@ -93,148 +93,8 @@ dependencies:
|
|
|
93
93
|
- - ">="
|
|
94
94
|
- !ruby/object:Gem::Version
|
|
95
95
|
version: '0'
|
|
96
|
-
description:
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
Summarise bank statement CSV files from the command line.
|
|
100
|
-
|
|
101
|
-
## Installation
|
|
102
|
-
|
|
103
|
-
```sh
|
|
104
|
-
gem install banco
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
Requires Ruby >= 3.3.
|
|
108
|
-
|
|
109
|
-
## Usage
|
|
110
|
-
|
|
111
|
-
Navigate to the directory containing your CSV file and run:
|
|
112
|
-
|
|
113
|
-
```sh
|
|
114
|
-
banco
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
Banco scans for CSV files, lets you pick one (or pass `--file`), then
|
|
118
|
-
presents an interactive menu:
|
|
119
|
-
|
|
120
|
-
| Key | Action |
|
|
121
|
-
|-----|--------|
|
|
122
|
-
| `a` | All transactions |
|
|
123
|
-
| `o` | Outgoing transactions |
|
|
124
|
-
| `i` | Incoming transactions |
|
|
125
|
-
| `m` | Money-out summary (grouped) |
|
|
126
|
-
| `n` | Money-in summary (grouped) |
|
|
127
|
-
| `b` | Bottom line (net position) |
|
|
128
|
-
| `s` | Save summary as CSV (prompts for path, default is `<filename>_summary.csv`) |
|
|
129
|
-
| `t` | Save transactions as CSV (prompts for path, default is `<filename>_transactions.csv`) |
|
|
130
|
-
| `l` | Load a new file |
|
|
131
|
-
| `+` | Merge another file into the current dataset |
|
|
132
|
-
| `q` | Quit |
|
|
133
|
-
|
|
134
|
-
Use `--format json` or `--format csv` for pipe-friendly output (no menu, exits after printing).
|
|
135
|
-
|
|
136
|
-
## CLI flags
|
|
137
|
-
|
|
138
|
-
| Flag | Default | Description |
|
|
139
|
-
|------|---------|-------------|
|
|
140
|
-
| `-f`, `--file FILE` | — | CSV file to analyse |
|
|
141
|
-
| `-F`, `--format FORMAT` | `text` | Output format: `text` / `json` / `csv` |
|
|
142
|
-
| `-b`, `--bank NAME` | `legacy` | Bank CSV format (see Bank formats below) |
|
|
143
|
-
| `-p`, `--prefix-length N` | `9` | Description prefix length for grouping |
|
|
144
|
-
| `-H`, `--header` | off | Skip first row as header (auto-detected when the first row is non-numeric) |
|
|
145
|
-
| `--from DATE` | — | Filter from date (format matches bank format) |
|
|
146
|
-
| `--to DATE` | — | Filter to date (format matches bank format) |
|
|
147
|
-
| `-v`, `--version` | — | Print version and exit |
|
|
148
|
-
| `-h`, `--help` | — | Show help and exit |
|
|
149
|
-
|
|
150
|
-
### Examples
|
|
151
|
-
|
|
152
|
-
```sh
|
|
153
|
-
# Summarise all transactions in statements.csv
|
|
154
|
-
banco --file statements.csv
|
|
155
|
-
|
|
156
|
-
# September only, JSON output
|
|
157
|
-
banco --file statements.csv --from 01/09/17 --to 30/09/17 --format json
|
|
158
|
-
|
|
159
|
-
# Skip header row, group by first 6 characters
|
|
160
|
-
banco --file export.csv --header --prefix-length 6
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
## Bank formats
|
|
164
|
-
|
|
165
|
-
| Name | Date format | Columns | Notes |
|
|
166
|
-
|------|-------------|---------|-------|
|
|
167
|
-
| `legacy` | `%d/%m/%y` | date, description, type, credit, debit | Default — Barclays-style, separate money-in / money-out columns |
|
|
168
|
-
| `split_columns` | `%d/%m/%Y` | date, description, type, credit, debit | Like `legacy` with a 4-digit year |
|
|
169
|
-
| `signed_amount` | `%Y-%m-%d` | date, description, amount | Single signed amount column, no type column |
|
|
170
|
-
| `date_description_amount` | `%d/%m/%Y` | date, description, amount, trailing | Signed amount at second-to-last position; trailing column (balance, reference, etc.) ignored. Tolerates unquoted commas in descriptions. |
|
|
171
|
-
|
|
172
|
-
### Column ordering
|
|
173
|
-
|
|
174
|
-
`date_description_amount` uses `Date | Description | Amount | trailing column`:
|
|
175
|
-
|
|
176
|
-
```
|
|
177
|
-
Date Description Amount Balance/Reference
|
|
178
|
-
07/10/2026 SAINSBURYS S/MKTS LEWES ROAD -22.05 72.73
|
|
179
|
-
07/10/2026 MARLEY EI Loan/rent 450.00 1093.70
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
The trailing column (Balance or Reference) is always ignored. The Amount column is read
|
|
183
|
-
from the **second-to-last** position, so unquoted commas inside a description (which
|
|
184
|
-
can appear in credit card exports) do not shift the Amount value.
|
|
185
|
-
|
|
186
|
-
`legacy` and `split_columns` use `Date | Description | Type | Credit | Debit`:
|
|
187
|
-
|
|
188
|
-
```
|
|
189
|
-
Date Description Type Credit Debit
|
|
190
|
-
21/09/17 Incoming Transaction credit 12.34
|
|
191
|
-
21/09/17 Outgoing Transaction Purchase 12.34
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
### Signed amount columns
|
|
195
|
-
|
|
196
|
-
When a format maps `credit_column` and `debit_column` to the **same** column
|
|
197
|
-
(as `signed_amount` and `date_description_amount` do), that column is read as a
|
|
198
|
-
single **signed** amount: positive values are money in (credit) and negative values
|
|
199
|
-
are money out (debit). Formats with separate columns (`legacy`, `split_columns`)
|
|
200
|
-
read each column directly.
|
|
201
|
-
|
|
202
|
-
### Custom formats
|
|
203
|
-
|
|
204
|
-
Define your own format in `~/.banco/formats.rb`:
|
|
205
|
-
|
|
206
|
-
```ruby
|
|
207
|
-
Banco::BankFormat.define(:my_bank) do
|
|
208
|
-
date_column 0
|
|
209
|
-
description_column 2
|
|
210
|
-
type_column 1
|
|
211
|
-
credit_column 3
|
|
212
|
-
debit_column 4
|
|
213
|
-
date_format '%Y-%m-%d'
|
|
214
|
-
end
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
Then use it with `banco --bank my_bank`.
|
|
218
|
-
|
|
219
|
-
## CSV format (legacy)
|
|
220
|
-
|
|
221
|
-
Banco's default (`--bank legacy`) expects columns in this order:
|
|
222
|
-
|
|
223
|
-
| # | Content |
|
|
224
|
-
|---|---------|
|
|
225
|
-
| 1 | Date (`dd/mm/yy`) |
|
|
226
|
-
| 2 | Description |
|
|
227
|
-
| 3 | Type |
|
|
228
|
-
| 4 | Money in |
|
|
229
|
-
| 5 | Money out |
|
|
230
|
-
|
|
231
|
-
Header rows are auto-detected and skipped. Pass `--header` explicitly to suppress the warning. Any columns beyond the fifth are ignored.
|
|
232
|
-
|
|
233
|
-
## Licence
|
|
234
|
-
|
|
235
|
-
MIT — see [LICENSE](LICENSE).
|
|
236
|
-
|
|
237
|
-
Hope your numbers are positive!
|
|
96
|
+
description: Summarise bank statement CSV files from the command line. Supports multiple
|
|
97
|
+
bank CSV formats, date filtering, and text/JSON/CSV output.
|
|
238
98
|
email: code@s33d.co
|
|
239
99
|
executables:
|
|
240
100
|
- banco
|