Commit Graph

118 Commits

Author SHA1 Message Date
bd6e3c2ff7 container: lib_hledger: make error fatal if hledger-web cannot start
Needed for CI.
2026-01-28 11:26:15 -08:00
1c6b449318 container: lib_hledger: only feed visidata on valid hledger command 2026-01-28 11:26:08 -08:00
5e8fff8103 container: lib_taxes: fix for generating all years (year=all)
- The expected `hledger` output format appears to have changed, likely
  from a recent `hledger` release (confirmed to be unrelated to `xan`).

- This bug does *not* affect individual year tax report generation, when
  given a specific (or default) year.
2026-01-28 11:22:15 -08:00
f7cefedd96 container: lib_finance: allow non-root system user; print warning
Needed for CI.
2026-01-28 11:16:34 -08:00
bf235ee526 container: finance: fetch: prices: add User-Agent
CoinGecko now returns error 403 without a "descriptive" User-Agent
2026-01-15 10:16:37 -08:00
eb7f97a054 container: finance: fetch: add API_VERSION to env 2026-01-14 16:49:46 -08:00
713514bbca container: finance: lib_root: rename Example class
For clarity that this class is separate from plugin's entrypoint.
2026-01-09 15:38:21 -08:00
e77c25f0c9 container: finance: lib_root/completion: add Pluggable support
- Adds Pluggable auto-(un)load support
- Adds plugin dispatcher for interpreter
- Refactors to support new Pluggable system
- Updates usage help and improves documentation
2026-01-09 11:45:21 -08:00
9fec1b427c container: root: change base path, related refactor
The base path is now *outside* of the macro directory; allowing for a
more integrated view of `dfi`'s entire `root` system. This is more
apparent once running an interactive session where the expectation is
(more intuitively) that any path should be relative to 'src/root' and
not 'src/root/macro'.

The rationale for why this was in 'src/root/macro' to begin with stems
from how `root` (by default) will automatically load rootlogon.C in the
directory that `root` is started. This is causing more confusion than
not because `dfi`'s usage of `root` is not limited to macros.

These changes skirt the line between needing a major API bump and not
but, so far, appears to be on the side of *not*. However, the TODOs
noted for macro loading should be addressed prior to any API changes.
2025-11-21 17:32:25 -08:00
0266157abe client/container: usage help updates 2025-10-28 12:13:10 -07:00
da40a93ae1 container: lib_taxes: don't attempt to patch non-existent taxable events
An optimization and printing cleanup (attempts to patch won't break)
2025-10-28 12:09:57 -07:00
960e51fe0a container: lib_taxes: fix printing for 'all' years 2025-10-28 12:09:57 -07:00
e9960461b7 container: lib_taxes: fix arg parsing for 'all' years
Impl was not able to process 'all' years because global_arg_year was set
2025-10-28 12:09:57 -07:00
aac3f780f9 Merge pull request #223 into master
5fb1d6f container: lib_reports: bump Copyright year (Aaron Fiore)
2025-10-03 14:17:50 -07:00
5fb1d6f2b0 container: lib_reports: bump Copyright year 2025-10-03 14:16:13 -07:00
3383b5c73f 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.
2025-10-03 14:09:34 -07:00
2f293ed566 container: lib_taxes: run linter 2025-10-02 17:19:21 -07:00
66c34a4b1c container: lib_taxes: optimize writes by forking
- Decreases real time in multicore container environments.
  * Given the nature of the writer, there should be no race conditions.
2025-10-02 17:09:48 -07:00
bf3a4e36e6 container: lib_reports: optimize writes by forking
- Decreases real time in multicore container environments.
  * Given the nature of the writer, there should be no race conditions.
2025-10-02 17:09:17 -07:00
c68a6680ef container: finance: completion: add 'help' to plugins 2025-09-04 15:08:20 -07:00
c3364511b0 container: finance: lib_plugins: update usage help
- Clarify usage, add examples, note plugin support type
  * finance's `plugins` only supports shell-based plugins
    - To use `root` plugins, use `root` command (see `root help`)
2025-09-04 15:08:20 -07:00
745a16e086 container: finance: completion: add root 2025-09-04 15:08:20 -07:00
ed163448f9 container: finance: add lib_root impl (macro/plugin support)
- dfi's `root` now supports shell loading (and running) of
  macros/plugins:

  * An interactive ROOT.cern instance is no longer *always* needed:

    - For macros (non-server); a 'one-off' instance will start, load the
      given macro, run the macro and then the instance will exit.

      * Server(s) will maintain an interactive instance.

    - For plugins; an interactive instance will start, load the given
      plugin, and then leave the user to make their calls manually.

  * All repo macros and repo/custom plugins are available.

- By default, an interactive instance will start when no dfi `root`
  arguments are given.

See `root help` for details.
2025-09-04 15:08:19 -07:00
178c197320 container: lib_fetch: fix wording to reflect impl 2025-08-26 14:06:46 -07:00
491d77553f container: php: dfi namespace refactor
Align with project alias, save the eyes and hands.
2025-08-19 13:53:50 -07:00
903560ccc3 container: php: refactor for linter
- Removes deprecations (since PHP 8.4)
- Resolves linter errors
2025-08-19 11:09:05 -07:00
07b710567d container: fetch: refactor for php
- Refactors locations for internal `fetch` impl and deps (composer)
  * A softer hardcoding without the need for a new autoloader
  * A restructured solution to silence the linter (phpstan)

NOTE: variables are prepended with *_PHP_* as to not bring confusion
with any other `dfi` dependencies or the `dfi` `root` module (C++).
2025-08-18 14:37:29 -07:00
671362b445 container: finance: fetch: prices: format non-alpha currencies
Formats non-alpha character currencies for hledger's prices journal
(e.g., "1INCH", "USDC.e", etc.)
2025-08-08 13:58:38 -07:00
731f9206f8 container: lib_taxes: remove non-alpha char (currency) hack
Now supported within flow impl.
2025-08-08 12:25:18 -07:00
facde4f533 container: fetch: gemini: remove non-alpha char (currency) hack
Now supported within flow impl.
2025-08-08 12:25:18 -07:00
d270d56366 client/container: ethereum-based: support Etherscan V2, add more L2 chains
- Implements support for unified API via Etherscan V2 (ethereum-based)
  * All ethereum-based L2s are now accessed via single API endpoint
    - Chains are now available via chain ID
  * Updates API key requirement for `fetch` ethereum-based subaccounts
    - The API key's value must now be prepended with "etherscan"
      * Previously was prepended per-chain ("ethereum" or "polygon")
    - The API key is now *required* (can be generated at etherscan.io)
      * Resolves fatal error in Etherscan::parse_response()
      * Impl will now handle if:
        - Config's API key/value is malformed
        - Etherscan API key was not given
        - Etherscan response is fatal

- Adds support for more L2s
  * Arbitrum (One)
  * Optimism
  * Base

- Adds more L2s to existing accounts
  * Coinbase Wallet
  * Ledger Live
  * MetaMask

- Updates documentation
  * Update default generated `fetch` config
  * Update `fetch` usage help
  * Update README
2025-08-04 15:07:10 -07:00
84ec085b8a container: src: finance: change visidata default dir
The container environment's $DOCKER_FINANCE_CONTAINER_CONF is
bind-mounted and, by default, points to ~/.config/docker-finance.d

The parent dir (~/.config) is subsequently owned by root (Docker-ism).
Ergo, with visidata v3.2, visidata cannot create its default dir:

    "PermissionError: [Errno 13] Permission denied: for visidata config"

This commit fixes that by setting visidata's default dir to use the
calling profile's docker-finance.d (where profile customization occurs).

Also included is some related refactoring.
2025-06-25 12:07:51 -07:00
88d254d752 container: src: completion: add more hledger commands 2025-05-27 15:16:43 -07:00
98adf3d87d container: fetch: prices: crypto: mobula: isolate given year
- Will now only parse given year (or 'all', if given).

  * No longer parses all subsequent years after given year
    (unless 'all' is given).

- Now prints most recent daily average for given year instead of most
  recent daily average for current year.
2025-03-24 12:36:37 -07:00
21967e711d container: lib_taxes: remove unused arg expansion, appease the linter
shellcheck will complain about the need for expansions but the
asked-for expansions will not actually be used (thus the TODO).
2025-01-31 19:23:18 -08:00
08c1de5d9d container: lib_taxes: optimize record printing, add checks and logging
- When applicable, as the stream progresses, exit each successive gawk
  iteration when no applicable records are present (no taxable events
  found for the given tag in the given year).

  Previously, when no records were found, a reports file was produced
  with either a single header-only row or junk data that resulted from
  the assumption there would be real data.

  A preexisting hack prevented the junk data from being written after
  production but this commit will resolve that hack by preventing the
  printing of junk data while also preventing the production of a
  header-only file.

- Print warnings when no taxable events are found for the given year.

- Add checks:
  * Only verify patched files if the patched files are not empty.
  * Empty variable checks.
2025-01-31 19:23:18 -08:00
36c0c93390 container: lib_taxes: reorder obfs columns
Sorted raw values take legibility precedence over sorted obfs keys.
2025-01-08 23:55:05 -08:00
3f7e8569fe container: fetch: coinbase: reinstate sort (remove pessimization)
Without this sort, transactions will not actually be written...
2025-01-08 20:51:33 -08:00
95c7212a3d container: fetch: coinbase: remove sort (optimize)
Received transactions are already sorted.
2025-01-07 20:44:48 -08:00
80039297a3 container: fetch: coinbase: fix/update pagination
- Don't break before advancing 'starting_after' cursor
  * Only save given year instead of breaking when not given year

- The 'next_starting_after' cursor now exists within 'info' object
2025-01-07 18:03:13 -08:00
9034346426 container: fetch: remove bittrex 2025-01-04 01:16:05 -08:00
c7ba59cfa1 container: lib_fetch: remove bittrex 2025-01-04 01:16:05 -08:00
f7cf8ca960 container: fetch: remove coinbase-pro 2025-01-04 01:16:05 -08:00
ae3caef110 container: lib_fetch: remove coinbase-pro 2025-01-04 01:16:04 -08:00
58e860dd94 container: fetch: remove celsius 2025-01-04 01:16:02 -08:00
d8a1b4cff1 container: lib_fetch: remove celsius 2025-01-04 01:15:59 -08:00
2b3b09dafa container: lib_taxes: add support for IRS Rev. Proc. 2024-28
- Creates per-wallet / per-account compliance for IRS Rev. Proc. 2024-28

  * Obfuscated keymap now creates a unique indentifier per-wallet /
    per-account where all trades, spends and income are now clearly
    tied to their respective wallets / accounts.

- Removes support for anonymized ("universal pool") reports.
2025-01-02 20:30:32 -08:00
ed57dc0749 client/container: use 'dfi' as global basename
Aligned with installation, will make usage help clearer.
2024-12-24 01:46:20 -08:00
a29426b910 container: finance: lib_hledger: remove -w from hledger-ui
Workaround for "hledger-ui: user error (Error: couldn't start native file manager: fdType: unsupported operation (unknown file type))"
2024-12-12 23:38:05 -08:00
c8611edacb client/container: src: completion: plugins enhancements
- Re-enables space after completion for plugin arguments
- Ignores internal/implementation files when completing
  * Files must be within an 'internal'/'impl' directory
2024-10-09 21:13:36 -07:00