container: migrate from xsv to xan

`xsv` is no longer maintained and the author recommends `xan` instead.

Fortunately, `xan` is very suitable for our use-case; is very efficient,
and produces no differences in our expected output.
This commit is contained in:
2025-09-30 17:43:25 -07:00
parent 5e02aa4825
commit 3383b5c73f
9 changed files with 31 additions and 31 deletions

View File

@@ -2,7 +2,7 @@
# docker-finance | modern accounting for the power-user
#
# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -43,7 +43,7 @@ source "${DOCKER_FINANCE_CONTAINER_REPO}/src/hledger-flow/lib/lib_preprocess.bas
function parse_deposit()
{
# NOTE: headers can be variable, not possible to assert
xsv select "id,completedAt,currencySymbol,quantity,cryptoAddress,txId" "$global_in_path" \
xan select "id,completedAt,currencySymbol,quantity,cryptoAddress,txId" "$global_in_path" \
| gawk -v global_year="$global_year" -v global_subaccount="$global_subaccount" \
'{
if (NR<2 || $2 !~ global_year)
@@ -79,7 +79,7 @@ function parse_trade()
# WARNING: don't use limit because market orders will be empty
# NOTE: headers can be variable, not possible to assert
xsv select "id,closedAt,direction,marketSymbol,fillQuantity,proceeds,commission" "$global_in_path" \
xan select "id,closedAt,direction,marketSymbol,fillQuantity,proceeds,commission" "$global_in_path" \
| gawk -v global_year="$global_year" -v global_subaccount="$global_subaccount" \
'{
if (NR<2 || $2 !~ global_year)
@@ -130,7 +130,7 @@ function parse_trade()
function parse_withdrawal()
{
# NOTE: headers can be variable, not possible to assert
xsv select "id,completedAt,currencySymbol,quantity,txCost,cryptoAddress,txId" "$global_in_path" \
xan select "id,completedAt,currencySymbol,quantity,txCost,cryptoAddress,txId" "$global_in_path" \
| gawk -v global_year="$global_year" -v global_subaccount="$global_subaccount" \
'{
if (NR<2 || $2 !~ global_year)