financeager icon indicating copy to clipboard operation
financeager copied to clipboard

Feature request: batch removing/updating of entries

Open pylipp opened this issue 2 years ago • 2 comments

In the form of

fina remove 1 2 5
fina remove $(seq 4 8)

fina update 1 2 -c new-category

Supported by tinydb: https://tinydb.readthedocs.io/en/latest/usage.html#id2

pylipp avatar Aug 08 '22 09:08 pylipp

Maybe not pretty due to overhead for file IO but completely fine:

for i in 1 2 5; do fina remove $i; done
for i in $(seq 4 8); do fina update $i -c new-category; done

pylipp avatar Sep 11 '22 15:09 pylipp

To facilitate batch removing/updating suggested above, a new flag for the list command would be helpful, like

fina list -f category=foo --ids  # output: newline separated IDs
for i in $(fina list -f category=foo --ids); do fina update $i --category bar; done

Tricky: handling of standard/recurrent entries.

Alternative:

  1. --filter option for update/remove command
  2. --raw option for list command to output response JSON, and post-process it with jq or similar

pylipp avatar Sep 11 '22 15:09 pylipp