ledger2beancount(5)

πŸ“¦
version 2.7 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu questing

πŸ¦‹ NAME πŸ¦‹

Okay bestie, so ledger2beancount is the configuration file for ledger2beancount(1) β€” it's the little file that tells the converter how to read your ledger the way you meant it. πŸ’… It lives in the File Formats Manual (section 5), and if you're converting ledger β†’ beancount, this is your girl.


✨ INPUT OPTIONS ✨

These are the options you might need so that ledger2beancount interprets your ledger files correctly. Get these wrong and the whole conversion is giving chaos, fr fr. 😭

  • date_format <string> β€” the date format used in your ledger file (default: %Y-%m-%d). πŸ—“οΈ
  • date_format_no_year <string> β€” the date format for dates without the year, for when ledger's Y/year directive is being used (default: %m-%d).
  • ledger_indent <int> β€” sets the indentation level used in your ledger file (default: 4).
  • decimal_comma true|false β€” parses amounts written with the decimal comma (like 10,00 EUR). Set this to true if you use the option --decimal-comma in ledger. πŸ‡ͺπŸ‡Ί
  • hledger true|false β€” tells ledger2beancount whether it should even attempt to parse hledger(1)-specific features.

πŸ’œ OTHER OPTIONS πŸ’œ

  • beancount_indent <int> β€” sets the indentation level for the generated beancount file (default: 2).
  • operating_currencies β€” a list of currencies you use all the time. This one gets used by fava, the web UI for beancount. ✨
  • automatic_declarations true|false β€” emit account and commodity declarations. (Default: true)
Note: the declarations you made in ledger via account and commodity declarations are always converted. If this option is true, then declarations are created for the ones that were never explicitly declared in ledger but were used anyway. 🫢
  • account_open_date <string> β€” the date used to open accounts (default: 1970-01-01).
  • commodities_date <string> β€” the date used to create commodities (default: 1970-01-01).
  • beancount_header <file> β€” names a file that acts as a beancount "header", i.e. it gets put at the beginning of the converted beancount file. You can use a header like this to specify options for beancount, such as the option "title", to define plugin directives, or to give beancount query information. πŸ“œ
  • ignore_marker <string> β€” names a marker that tells ledger2beancount(1) to ignore a line if that marker is found in it. 🚫
  • keep_marker <string> β€” names a marker that tells ledger2beancount(1) to take a line from the input that's commented out, uncomment it, and display it in the output. πŸ”₯
  • convert_virtual true|false β€” says whether virtual postings should be converted. If it's set to true, virtual postings in brackets get made into real accounts. (Virtual postings in parentheses are always ignored, no matter what you set this to.)
  • account_map β€” a hash of account names to be mapped to other account names.
  • account_regex β€” a hash of regular expressions used to replace account names.
  • commodity_map β€” a mapping of ledger commodities to beancount commodities.
  • metadata_map β€” a mapping of ledger metadata keys to the corresponding beancount keys.
  • payee_tag and payer_tag β€” specify a metadata tag (after the mapping done by metadata_map) that's used to set the payee.
  • narration_tag β€” specifies a metadata tag (after the mapping done by metadata_map) that's used to set the narration.
  • payee_split β€” a list of regular expressions to split ledger's payee field into payee and narration. You have to use the named capture groups payee and narration. πŸ‘‘
  • payee_match β€” a list of regular expressions and their corresponding payees. The whole ledger payee becomes the narration, and the payee matched from the regular expression becomes the payee.
  • postdate_tag <string> β€” the metadata tag to be used to store posting dates. (Use the empty string if you don't want the metadata added to beancount.)
  • auxdate_tag <string> β€” the metadata tag to be used to store auxiliary dates (also known as effective dates, or date2 in hledger). (Use the empty string if you don't want the metadata added to beancount.)
  • code_tag <string> β€” the metadata tag to be used to store transaction codes. (Use the empty string if you don't want the metadata added to beancount.)
  • link_match β€” a list of regular expressions that will cause a tag to be rendered as a link.
  • link_tags β€” a list of metadata tags whose values should be converted to beancount links instead of metadata. Tags are case insensitive, and the values must not contain whitespace.
  • currency_is_commodity β€” a list of commodities that should be treated as commodities rather than currencies, even though they consist of 3 characters (which is usually the tell-tale sign of a currency). Expects beancount commodities (i.e. after transformation and mapping).
  • commodity_is_currency β€” a list of commodities that should be treated as currencies (in the sense that cost is not retained). Expects beancount commodities (i.e. after transformation and mapping).
  • move_posting_tags β€” moves posting-level tags up onto the transaction itself, to work around the fact that beancount has no posting-level tags. πŸ’€

🌸 AUTHORS 🌸

Stefano Zacchiroli and Martin Michlmayr. Absolute icons, no cap. πŸ‘‘


🌈 SEE ALSO 🌈

The full documentation for ledger2beancount can be found in its manual. πŸ“–


And that's the whole page, bestie β€” this one's from ledger2beancount(5), dated 2022-12-18, and it ate. πŸ’– Mwah, go convert something iconic. πŸŽ€

πŸ“¦ where this page comes from