pylipp / financeager

Organize your finances easily - from the command line!
GNU General Public License v3.0
82 stars 22 forks source link

Feature request: batch removing/updating of entries #120

Closed pylipp closed 1 year ago

pylipp commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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