Skip to content

Commit 289ebca

Browse files
committed
Describe Importer mode in README #latest #dockerpush
1 parent 38b1398 commit 289ebca

File tree

3 files changed

+45
-9
lines changed

3 files changed

+45
-9
lines changed

README.md

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ Ukrainian digital bank [Monobank](https://www.monobank.ua/) into one of the budg
99
### Features
1010

1111
- Creates transactions in the budgeting app as they happen (via Monobank
12-
API [webHook](https://api.monobank.ua/docs/#tag/Kliyentski-personalni-dani/paths/~1personal~1webhook/post)).
13-
- Supports multiple monobank accounts and links transactions to the corresponding accounts created in the budgeting app.
14-
- Tries to guess transaction's category using [MCC](https://en.wikipedia.org/wiki/Merchant_category_code) codes.
15-
- Automatically recognizes transfers between monobank accounts and creates transfers in the budgeting app.
16-
- Uses Telegram bot to notify about created transactions in the budgeting app.
17-
- Telegram bot allows to change incorrectly assigned or empty category directly in Telegram messenger.
12+
API [webHook](https://api.monobank.ua/docs/#tag/Kliyentski-personalni-dani/paths/~1personal~1webhook/post))
13+
- Supports multiple monobank accounts and links transactions to the corresponding accounts created in the budgeting app
14+
- Tries to guess transaction's category using [MCC](https://en.wikipedia.org/wiki/Merchant_category_code) codes
15+
- Automatically recognizes transfers between monobank accounts and creates transfers in the budgeting app
16+
- Uses Telegram bot to notify about created transactions in the budgeting app
17+
- Telegram bot allows to change incorrectly assigned or empty category directly in Telegram messenger
1818
- Automatic retries in case of budgeting provider API errors
19+
- **NEW** [Importer mode](#Importer-mode) for importing transactions from CSV statement files obtained from Monobank
20+
app
1921

2022
### Preparations
2123

@@ -96,9 +98,41 @@ There are a couple of environment variables you must set:
9698
call [Monobank API](https://api.monobank.ua/docs/#tag/Kliyentski-personalni-dani/paths/~1personal~1webhook/post)
9799
setting webhook at application startup or skip this step (i.e. webhook was set previously and URL hasn't changed)
98100

101+
### Importer mode
102+
103+
Application downtime can occur for various reasons like a scheduled maintenance at the Lunchmoney API
104+
side (happens frequently, once in a couple of months). And you may end up with a bunch of transactions that were not
105+
synced to the budgeting app. To avoid manual labour of adding those transactions in the budgeting app, monobudget can be
106+
run from the command line in a special `Importer` mode.
107+
108+
You use your regular `settings.yml` file, but also create a new `import-config.yml` file, which may look like
109+
this:
110+
111+
```yaml
112+
imports:
113+
"Personal account UAH": "/Users/user/Documents/report_13-08-2024_19-36-25.csv"
114+
"Personal account EUR": "/Users/user/Documents/report_10-08-2024_08-57-01.csv"
115+
"Other account": "/some/other/full/path/to/the/csv/monobank/statement.csv"
116+
```
117+
118+
It's a map from account `alias` from the `settings.yml` to the full path of the Monobank statement report for that
119+
account.
120+
Multiple accounts may be specified and if transfers between those account occurred they would be created as during
121+
normal application operation.
122+
Then you must `cd` into application repository folder and build and run it like this:
123+
124+
```bash
125+
./gradlew build -x test
126+
java -jar build/libs/monobudget-fat.jar importer
127+
```
128+
129+
`settings.yml` and `importer-config.yml` must reside in the root repository folder
130+
99131
### About YNAB support
100132

101-
Previously this app supported only YNAB as this was my preferred financial manager. Then I switched to Lunchmoney and refactored the app to support both, but I only tested YNAB support with the minimal effort after that, and I am not confident it works reliably.
133+
Previously this app supported only YNAB as this was my preferred financial manager. Then I switched to Lunchmoney and
134+
refactored the app to support both, but I only tested YNAB support with the minimal effort after that, and I am not
135+
confident it works reliably.
102136

103137
Last commit where YNAB support was working reliably (and I was personally using it)
104138
is [3a7da7af](https://github.com/smaugfm/monobudget/commit/3a7da7afd85bffa310f54a322c46d626d24f488c) (May 2022)

build.gradle.kts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ ktlint {
9191
version.set("1.0.1")
9292
enableExperimentalRules.set(true)
9393
filter {
94-
exclude("**/generated/**")
94+
exclude("**/build")
95+
exclude("**/build/**")
96+
exclude("build/***")
9597
}
9698
reporters {
9799
reporter(ReporterType.HTML)

src/test/kotlin/io/github/smaugfm/monobudget/common/misc/Playground.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import java.nio.file.Paths
2323
import kotlin.io.path.readText
2424

2525
@OptIn(DelicateCoroutinesApi::class)
26+
@Disabled
2627
class Playground : KoinTest {
2728
private val apis: List<MonoApi> by injectAll()
2829

@@ -57,7 +58,6 @@ class Playground : KoinTest {
5758
}
5859

5960
@Test
60-
@Disabled
6161
fun vasa() {
6262
println(apis)
6363
}

0 commit comments

Comments
 (0)