These stubs let you test the Beancount import utility without installing Beancount or maintaining a real ledger. You’ll create lightweight “wrappers” named bean-identify and bean-extract, place them in a folder on your PATH, and point your import tool at that directory.
Choose or create a folder to hold your wrappers. For example:
- Windows:
%USERPROFILE%\bean-stubs - macOS/Linux:
~/bean-stubs
Copy the provided stub scripts into that folder as:
fake_bean_identify.pyfake_bean_extract.py
(See the stub contents in this repo.)
In %USERPROFILE%\bean-stubs, create:
bean-identify.cmd
@echo off
py "%~dp0fake_bean_identify.py" %*bean-extract.cmd
@echo off
py "%~dp0fake_bean_extract.py" %*In ~/bean-stubs, create:
bean-identify
#!/usr/bin/env bash
python3 "$HOME/bean-stubs/fake_bean_identify.py" "$@"bean-extract
#!/usr/bin/env bash
python3 "$HOME/bean-stubs/fake_bean_extract.py" "$@"Then make them executable:
chmod +x ~/bean-stubs/bean-identify ~/bean-stubs/bean-extractOpen PowerShell and run:
[Environment]::SetEnvironmentVariable(
"Path",
"$env:Path;%USERPROFILE%\bean-stubs",
"User"
)Then close and reopen your terminal.
Append to your shell profile (~/.bash_profile, ~/.zshrc, etc.):
export PATH="$HOME/bean-stubs:$PATH"Reload your profile:
source ~/.bash_profile # or ~/.zshrc, etc.bean-identify --help
bean-extract --helpYou should see usage messages from the stubs. Your import utility will now call these fake tools for testing without a real Beancount install.