ledger2beancount(5)
π¦ 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'sY/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 (like10,00 EUR). Set this totrueif you use the option--decimal-commain ledger. πͺπΊhledger true|falseβ tellsledger2beancountwhether it should even attempt to parsehledger(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 tellsledger2beancount(1)to ignore a line if that marker is found in it. π«keep_marker <string>β names a marker that tellsledger2beancount(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 totrue, 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_tagandpayer_tagβ specify a metadata tag (after the mapping done bymetadata_map) that's used to set the payee.narration_tagβ specifies a metadata tag (after the mapping done bymetadata_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 groupspayeeandnarration. π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, ordate2in 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
- debian bookworm: ledger2beancount 2.7-1 Β· GPL-3.0-or-later
- debian trixie: ledger2beancount 2.7-1 Β· GPL-3.0-or-later
- ubuntu noble: ledger2beancount 2.7-1 Β· GPL-3.0-or-later
- ubuntu questing: ledger2beancount 2.7-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms