{"id":13564599,"url":"https://github.com/sboehler/knut","last_synced_at":"2026-01-11T03:40:11.509Z","repository":{"id":49391667,"uuid":"315136935","full_name":"sboehler/knut","owner":"sboehler","description":"knut is an efficient plain text accounting tool with support for multiple currencies and valuation.","archived":false,"fork":false,"pushed_at":"2024-11-29T21:41:31.000Z","size":2045,"stargazers_count":58,"open_issues_count":2,"forks_count":10,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-29T22:31:21.779Z","etag":null,"topics":["accounting","balance","finance","journal","ledger","plaintext-accounting"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sboehler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-22T21:36:22.000Z","updated_at":"2024-11-29T21:41:34.000Z","dependencies_parsed_at":"2024-02-27T23:38:36.494Z","dependency_job_id":"294a9d43-a080-4b59-a35c-7af4b76e6509","html_url":"https://github.com/sboehler/knut","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sboehler%2Fknut","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sboehler%2Fknut/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sboehler%2Fknut/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sboehler%2Fknut/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sboehler","download_url":"https://codeload.github.com/sboehler/knut/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247083182,"owners_count":20880791,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["accounting","balance","finance","journal","ledger","plaintext-accounting"],"created_at":"2024-08-01T13:01:33.425Z","updated_at":"2026-01-11T03:40:11.465Z","avatar_url":"https://github.com/sboehler.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# knut ‒ a plain text accounting tool\n\n![Go](https://github.com/sboehler/knut/workflows/Go/badge.svg)\n\n\u003e there are 29 knuts in a sickle\n\nknut is a plain-text, double-entry accounting tool for the command line. It produces various reports based on simple accounting directives in a [text file](#file-format). knut is written in Go, and its primary use cases are personal finance and investing.\n\n```text\n$ knut balance --color=false -v CHF --months --from 2020-01-01 --to 2020-04-01 doc/example.knut\n+---------------+------------+------------+------------+------------+\n|    Account    | 2020-01-31 | 2020-02-29 | 2020-03-31 | 2020-04-01 |\n+---------------+------------+------------+------------+------------+\n| Assets        |            |            |            |            |\n|   BankAccount |      1,800 |      4,127 |      4,127 |      4,127 |\n|   Portfolio   |      1,025 |        919 |        856 |        819 |\n|               |            |            |            |            |\n| Total (A+L)   |      2,825 |      5,046 |      4,983 |      4,946 |\n+---------------+------------+------------+------------+------------+\n| Equity        |            |            |            |            |\n|   Equity      |          3 |      2,825 |      5,046 |      4,983 |\n|               |            |            |            |            |\n| Income        |            |            |            |            |\n|   Portfolio   |         26 |       -106 |        -63 |        -37 |\n|   Salary      |      5,000 |      5,000 |            |            |\n|               |            |            |            |            |\n| Expenses      |            |            |            |            |\n|   Rent        |     -2,000 |     -2,000 |            |            |\n|   Fees        |         -4 |            |            |            |\n|   Groceries   |       -200 |       -673 |            |            |\n|               |            |            |            |            |\n| Total (E+I+E) |      2,825 |      5,046 |      4,983 |      4,946 |\n+---------------+------------+------------+------------+------------+\n| Delta         |            |            |            |            |\n+---------------+------------+------------+------------+------------+\n\n\n```\n\n## Table of contents\n\n- [knut ‒ a plain text accounting tool](#knut--a-plain-text-accounting-tool)\n  - [Table of contents](#table-of-contents)\n  - [Commands](#commands)\n    - [Print a balance](#print-a-balance)\n      - [Basic balance](#basic-balance)\n      - [Monthly balance in a given commodity](#monthly-balance-in-a-given-commodity)\n      - [Filter transactions by account or commodity](#filter-transactions-by-account-or-commodity)\n      - [Collapse accounts](#collapse-accounts)\n    - [Fetch quotes](#fetch-quotes)\n    - [Infer accounts](#infer-accounts)\n    - [Format the journal](#format-the-journal)\n    - [Import transactions](#import-transactions)\n    - [Transcode to beancount](#transcode-to-beancount)\n  - [Editor support](#editor-support)\n  - [File format](#file-format)\n    - [Open and close](#open-and-close)\n    - [Transactions](#transactions)\n    - [Accruals (experimental)](#accruals-experimental)\n    - [Balance assertions](#balance-assertions)\n    - [Value directive](#value-directive)\n    - [Prices](#prices)\n    - [Include directives](#include-directives)\n\n## Commands\n\n```text\n$ knut --help\nknut is a plain text accounting tool for tracking personal finances and investments.\n\nUsage:\n  knut [command]\n\nAvailable Commands:\n  balance     create a balance sheet\n  check       check the journal\n  completion  output shell completion code [bash|zsh]\n  fetch       Fetch quotes from Yahoo! Finance\n  format      Format the given journal\n  help        Help about any command\n  import      Import financial account statements\n  infer       Auto-assign accounts in a journal\n  portfolio   Portfolio management commands\n  print       print the journal\n  transcode   transcode to beancount\n\nFlags:\n  -h, --help      help for knut\n  -v, --version   version for knut\n\nUse \"knut [command] --help\" for more information about a command.\n\n```\n\n### Print a balance\n\nknut has a powerful balance command, with various options to tune the result.\n\n#### Basic balance\n\nWithout additional options, knut will print a balance with counts of the various\ncommodities per account.\n\n```text\n$ knut balance --color=false doc/example.knut --to 2020-04-01\n+---------------+------+------------+\n|    Account    | Comm | 2020-04-01 |\n+---------------+------+------------+\n| Assets        |      |            |\n|   BankAccount | CHF  |     14,127 |\n|   Portfolio   | AAPL |         12 |\n|               | CHF  |         31 |\n|               | USD  |         97 |\n|               |      |            |\n| Total (A+L)   | AAPL |         12 |\n|               | CHF  |     14,158 |\n|               | USD  |         97 |\n+---------------+------+------------+\n| Equity        |      |            |\n|   Equity      | AAPL |         12 |\n|               | CHF  |      9,031 |\n|               | USD  |        101 |\n|               |      |            |\n| Income        |      |            |\n|   Salary      | CHF  |     10,000 |\n|               |      |            |\n| Expenses      |      |            |\n|   Rent        | CHF  |     -4,000 |\n|   Fees        | USD  |         -4 |\n|   Groceries   | CHF  |       -873 |\n|               |      |            |\n| Total (E+I+E) | AAPL |         12 |\n|               | CHF  |     14,158 |\n|               | USD  |         97 |\n+---------------+------+------------+\n| Delta         | AAPL |            |\n|               | CHF  |            |\n|               | USD  |            |\n+---------------+------+------------+\n\n\n```\n\n#### Monthly balance in a given commodity\n\nIf prices are available, knut can valuate the balance in any of the available commodities. And the result is guaranteed to balance:\n\n```text\n$ knut balance --color=false -v CHF --months --to 2020-04-01 doc/example.knut\n+---------------+------------+------------+------------+------------+------------+\n|    Account    | 2019-12-31 | 2020-01-31 | 2020-02-29 | 2020-03-31 | 2020-04-01 |\n+---------------+------------+------------+------------+------------+------------+\n| Assets        |            |            |            |            |            |\n|   BankAccount |     10,000 |     11,800 |     14,127 |     14,127 |     14,127 |\n|   Portfolio   |            |      1,025 |        919 |        856 |        819 |\n|               |            |            |            |            |            |\n| Total (A+L)   |     10,000 |     12,825 |     15,046 |     14,983 |     14,946 |\n+---------------+------------+------------+------------+------------+------------+\n| Equity        |            |            |            |            |            |\n|   Equity      |     10,000 |     10,003 |     12,825 |     15,046 |     14,983 |\n|               |            |            |            |            |            |\n| Income        |            |            |            |            |            |\n|   Portfolio   |            |         26 |       -106 |        -63 |        -37 |\n|   Salary      |            |      5,000 |      5,000 |            |            |\n|               |            |            |            |            |            |\n| Expenses      |            |            |            |            |            |\n|   Rent        |            |     -2,000 |     -2,000 |            |            |\n|   Fees        |            |         -4 |            |            |            |\n|   Groceries   |            |       -200 |       -673 |            |            |\n|               |            |            |            |            |            |\n| Total (E+I+E) |     10,000 |     12,825 |     15,046 |     14,983 |     14,946 |\n+---------------+------------+------------+------------+------------+------------+\n| Delta         |            |            |            |            |            |\n+---------------+------------+------------+------------+------------+------------+\n\n\n```\n\nIt balances in any currency:\n\n```text\n$ knut balance --color=false -v USD --months --to 2020-04-01 doc/example.knut\n+---------------+------------+------------+------------+------------+------------+\n|    Account    | 2019-12-31 | 2020-01-31 | 2020-02-29 | 2020-03-31 | 2020-04-01 |\n+---------------+------------+------------+------------+------------+------------+\n| Assets        |            |            |            |            |            |\n|   BankAccount |     10,324 |     12,172 |     14,583 |     14,716 |     14,693 |\n|   Portfolio   |            |      1,058 |        949 |        892 |        852 |\n|               |            |            |            |            |            |\n| Total (A+L)   |     10,324 |     13,230 |     15,532 |     15,608 |     15,544 |\n+---------------+------------+------------+------------+------------+------------+\n| Equity        |            |            |            |            |            |\n|   Equity      |     10,324 |     10,327 |     13,230 |     15,532 |     15,608 |\n|               |            |            |            |            |            |\n| Income        |            |            |            |            |            |\n|   Portfolio   |            |         29 |       -108 |        -57 |        -40 |\n|   BankAccount |            |         -5 |         60 |        133 |        -23 |\n|   Salary      |            |      5,157 |      5,103 |            |            |\n|               |            |            |            |            |            |\n| Expenses      |            |            |            |            |            |\n|   Rent        |            |     -2,067 |     -2,063 |            |            |\n|   Fees        |            |         -4 |            |            |            |\n|   Groceries   |            |       -207 |       -690 |            |            |\n|               |            |            |            |            |            |\n| Total (E+I+E) |     10,324 |     13,230 |     15,532 |     15,608 |     15,544 |\n+---------------+------------+------------+------------+------------+------------+\n| Delta         |            |            |            |            |            |\n+---------------+------------+------------+------------+------------+------------+\n\n\n```\n\n#### Filter transactions by account or commodity\n\nUse `--diff` to look into period differences. Use `--account` to filter for transactions affecting a single account, or `--commodity` to filter for transactions which affect a commodity. Both `--account` and `--commodity` take regular expressions, to select multiple matches.\n\n```text\n$ knut balance --color=false -v CHF --months --from 2020-01-01 --to 2020-04-01 --diff --account Portfolio doc/example.knut\n+---------------+------------+------------+------------+------------+\n|    Account    | 2020-01-31 | 2020-02-29 | 2020-03-31 | 2020-04-01 |\n+---------------+------------+------------+------------+------------+\n| Assets        |            |            |            |            |\n|   Portfolio   |      1,025 |       -106 |        -63 |        -37 |\n|               |            |            |            |            |\n| Total (A+L)   |      1,025 |       -106 |        -63 |        -37 |\n+---------------+------------+------------+------------+------------+\n| Income        |            |            |            |            |\n|   Portfolio   |         26 |       -132 |         43 |         26 |\n|               |            |            |            |            |\n| Total (E+I+E) |         26 |       -132 |         43 |         26 |\n+---------------+------------+------------+------------+------------+\n| Delta         |        999 |         26 |       -106 |        -63 |\n+---------------+------------+------------+------------+------------+\n\n\n```\n\n```text\n$ knut balance --color=false -v CHF --months --from 2020-01-01 --to 2020-04-01 --diff --commodity AAPL doc/example.knut\n+---------------+------------+------------+------------+------------+\n|    Account    | 2020-01-31 | 2020-02-29 | 2020-03-31 | 2020-04-01 |\n+---------------+------------+------------+------------+------------+\n| Assets        |            |            |            |            |\n|   Portfolio   |        900 |       -106 |        -62 |        -37 |\n|               |            |            |            |            |\n| Total (A+L)   |        900 |       -106 |        -62 |        -37 |\n+---------------+------------+------------+------------+------------+\n| Equity        |            |            |            |            |\n|   Equity      |        874 |         26 |       -106 |        -62 |\n|               |            |            |            |            |\n| Income        |            |            |            |            |\n|   Portfolio   |         26 |       -132 |         44 |         25 |\n|               |            |            |            |            |\n| Total (E+I+E) |        900 |       -106 |        -62 |        -37 |\n+---------------+------------+------------+------------+------------+\n| Delta         |            |            |            |            |\n+---------------+------------+------------+------------+------------+\n\n\n```\n\n#### Collapse accounts\n\nUse `-m` to map accounts matching a certain regex to a reduced number of segments. This can be used to completely hide an account (`-m0` - its positions will show up in the delta):\n\n```text\n$ knut balance --color=false -v CHF --months --from 2020-01-01 --to 2020-04-01 --diff -m0,(Income|Expenses) doc/example.knut\n+---------------+------------+------------+------------+------------+\n|    Account    | 2020-01-31 | 2020-02-29 | 2020-03-31 | 2020-04-01 |\n+---------------+------------+------------+------------+------------+\n| Assets        |            |            |            |            |\n|   BankAccount |      1,800 |      2,327 |            |            |\n|   Portfolio   |      1,025 |       -106 |        -63 |        -37 |\n|               |            |            |            |            |\n| Total (A+L)   |      2,825 |      2,221 |        -63 |        -37 |\n+---------------+------------+------------+------------+------------+\n| Equity        |            |            |            |            |\n|   Equity      |          3 |      2,822 |      2,221 |        -63 |\n|               |            |            |            |            |\n| Total (E+I+E) |          3 |      2,822 |      2,221 |        -63 |\n+---------------+------------+------------+------------+------------+\n| Delta         |      2,822 |       -601 |     -2,284 |         26 |\n+---------------+------------+------------+------------+------------+\n\n\n```\n\nAlternatively, with a number \u003e 0, subaccounts will be aggregated:\n\n```text\n$ knut balance --color=false -v CHF --months --from 2020-01-01 --to 2020-04-01 --diff -m1,(Income|Expenses|Equity) doc/example.knut\n+---------------+------------+------------+------------+------------+\n|    Account    | 2020-01-31 | 2020-02-29 | 2020-03-31 | 2020-04-01 |\n+---------------+------------+------------+------------+------------+\n| Assets        |            |            |            |            |\n|   BankAccount |      1,800 |      2,327 |            |            |\n|   Portfolio   |      1,025 |       -106 |        -63 |        -37 |\n|               |            |            |            |            |\n| Total (A+L)   |      2,825 |      2,221 |        -63 |        -37 |\n+---------------+------------+------------+------------+------------+\n| Equity        |          3 |      2,822 |      2,221 |        -63 |\n|               |            |            |            |            |\n| Income        |      5,026 |       -132 |     -4,957 |         26 |\n|               |            |            |            |            |\n| Expenses      |     -2,204 |       -469 |      2,673 |            |\n|               |            |            |            |            |\n| Total (E+I+E) |      2,825 |      2,221 |        -63 |        -37 |\n+---------------+------------+------------+------------+------------+\n| Delta         |            |            |            |            |\n+---------------+------------+------------+------------+------------+\n\n\n```\n\n### Fetch quotes\n\nknut price sources are configured in yaml format:\n\n```text\n# doc/prices.yaml\n- commodity: \"USD\"\n  target_commodity: \"CHF\"\n  file: \"USD.prices\"\n  symbol: \"USDCHF=X\"\n- commodity: \"AAPL\"\n  target_commodity: \"USD\"\n  file: \"AAPL.prices\"\n  symbol: \"AAPL\"\n\n```\n\nOnce configured, prices can be updated with one command:\n\n```text\nknut fetch doc/prices.yaml\n```\n\n### Infer accounts\n\nknut has a built-in Bayes engine to automatically assign accounts for new transactions. Simply use `TBD` as the account in a transaction and let knut decide how to replace it, based on previous entries. The bigger the journal, the more reliable this mechanism becomes.\n\n```text\nknut infer -t doc/example.knut doc/example.knut\n```\n\n### Format the journal\n\nknut can format a journal, such that accounts and numbers are aligned. Any comments and whitespace between directives are preserved.\n\n```text\nknut format doc/example.knut\n```\n\n### Import transactions\n\nknut has a few built-in importers for statements from Swiss banks:\n\n```text\n$ knut import --help\nImport financial account statements\n\nUsage:\n  knut import [command]\n\nAvailable Commands:\n  ch.cumulus            Import Cumulus credit card statements\n  ch.postfinance        Import Postfinance CSV account statements\n  ch.supercard          Import Supercard credit card statements\n  ch.swisscard          Import Swisscard credit card statements (before mid 2023)\n  ch.swisscard2         Import Swisscard credit card statements (from mid 2023)\n  ch.swissquote         Import Swissquote account reports\n  ch.viac               Import VIAC values from JSON files\n  revolut               Import Revolut CSV account statements\n  revolut2              Import Revolut CSV account statements\n  us.interactivebrokers Import Interactive Brokers account reports\n\nFlags:\n  -h, --help   help for import\n\nUse \"knut import [command] --help\" for more information about a command.\n\n```\n\n### Transcode to beancount\n\nWhile knut has advanced terminal-based visualization options, it lacks any web-based visualization tools. To allow the usage of the amazing tooling around the [beancount](http://furius.ca/beancount/) ecosystem, such as [fava](https://beancount.github.io/fava/), knut has a command to convert an entire journal into beancount's file format:\n\n```text\nknut transcode -c CHF doc/example.knut\n```\n\nThis command should also allow beancount users to use knut's built-in importers.\n\n## Editor support\n\nThere is an experimental [Visual Studio Code extension](https://github.com/sboehler/language-knut) which provides syntax highlighting, code folding and an outline view.\n\n## File format\n\nAn accounting journal in knut is represented as a sequence of plain-text directives. The journal consists of a set of directives and comments. Directives are prices, account openings, transactions, value directives, balance assertions, and account closings. Lines starting with either `#` (comment) or `*` (org-mode title) are ignored. Files can include other files using an include directive. The order of the directives in the journal file is not important, they are always evaluated by date.\n\nThe following is an example for a knut journal:\n\n```text\n# doc/example.knut\ninclude \"USD.prices\"\ninclude \"AAPL.prices\"\n\n* Open Accounts\n\n2019-12-31 open Equity:Equity\n2019-12-31 open Assets:BankAccount\n2019-12-31 open Assets:Portfolio\n\n2019-12-31 open Expenses:Groceries\n2019-12-31 open Expenses:Fees\n2019-12-31 open Expenses:Rent\n\n2019-12-31 open Income:Salary\n2019-12-31 open Income:Dividends\n\n* Opening Balances\n\n2019-12-31 \"Opening balance\"\nEquity:Equity           Assets:BankAccount           10000 CHF\n\n* 2020-01\n\n2020-01-25 \"Salary January 2020\"\nIncome:Salary           Assets:BankAccount            5000 CHF\n\n2020-01-02 \"Rent January\"\nAssets:BankAccount      Expenses:Rent                 2000 CHF\n\n2020-01-15 \"Groceries\"\nAssets:BankAccount      Expenses:Groceries             200 CHF\n\n2020-01-05 \"Transfer to portfolio\"\nAssets:BankAccount      Assets:Portfolio              1000 CHF\n\n2020-01-06 \"Currency exchange\"\nEquity:Equity           Assets:Portfolio              1001 USD\nAssets:Portfolio        Equity:Equity                  969 CHF\n\n2020-01-06 \"Buy 12 AAPL shares\"\nEquity:Equity           Assets:Portfolio                12 AAPL\nAssets:Portfolio        Equity:Equity                  900 USD\nAssets:Portfolio        Expenses:Fees                    4 USD\n\n* 2020-02\n\n2020-02-25 \"Salary January 2020\"\nIncome:Salary           Assets:BankAccount            5000 CHF\n\n2020-02-02 \"Rent January\"\nAssets:BankAccount      Expenses:Rent                 2000 CHF\n\n2020-02-05 \"Groceries\"\nAssets:BankAccount      Expenses:Groceries             250 CHF\n\n2020-02-25 \"Groceries\"\nAssets:BankAccount      Expenses:Groceries             423 CHF\n\n```\n\n### Open and close\n\nAn account consists of a sequence of segments, separated by ':'. The first segment must be one of Assets, Liabilities, Equity, Income, Expenses or TBD. Before an account can be used in a transaction, for example, it must be opened using an open directive:\n\n`YYYY-MM-DD open \u003caccount name\u003e`\n\nOnce an account is not needed anymore, it can be closed, to prevent further bookings. An account can only be closed if its balance is zero at the closing time.\n\n`YYYY-MM-DD close \u003caccount name\u003e`\n\n### Transactions\n\nA transaction describes the flow of money between multiple accounts. Transaction always balance by design in knut.\n\n```text\nYYYY-MM-DD \"\u003cdescription\u003e\"\n\u003ccredit account\u003e \u003cdebit account\u003e \u003camount\u003e \u003ccommodity\u003e\n\u003ccredit account\u003e \u003cdebit account\u003e \u003camount\u003e \u003ccommodity\u003e\n...\n```\n\nA transaction starts with a date, followed by a description withing double quotes on the same line. It must have one or more bookings on the lines immediately following. Every booking references two accounts, a credit account (first) and a debit account (second). The amount is usually a positive numbers, and the semantics is that money \"flows from left to right\".\n\nThe transaction syntax deviates from similar tools like ledger or beancount for several reasons:\n\n- It ensures that a transaction always balances, which is not guaranteed by formats where each booking references only one account.\n- It creates unambigous flows between two accounts, which is helpful when analyzing the flows of money.\n- The representation is more compact.\n\n### Accruals (experimental)\n\nAccruals are annotation placed on transactions to describe how the transaction's flows are to be broken up over time. Suppose you pay your yearly tax bill for 2020 on 24 March of that same year:\n\n```text\n2020-03-24 \"2020 Taxes\"\nAssets:BankAccount Expenses:Taxes 12000 USD\n```\n\nThis will heavily impact your net income in March due to the large cash outflow, while the taxes are actually owed for the entire year. Enter accruals:\n\n```text\n@accrue monthly 2020-01-01 2020-12-01 Assets:PrepaidTax\n2020-03-24 \"2020 Taxes\"\nAssets:BankAccount Expenses:Taxes 12000 USD\n```\n\nThis annotation will replace the original transaction with an accrual, moving the money from expenses to a virtual asset account. In addition, the annotation will generate a series of small transactions which continuously move money from the virtual asset account to the expense account:\n\n```text\n# Accrual leg:\n2020-03-24 \"2020 Taxes\"\nAssets:BankAccount Assets:PrepaidTax 12000 USD\n\n# Expense legs:\n2020-01-31 \"2020 Taxes\"\nAssets:PrepaidTax Expenses:Taxes 1000 USD\n\n2020-02-29 \"2020 Taxes\"\nAssets:PrepaidTax Expenses:Taxes 1000 USD\n\n2020-03-31 \"2020 Taxes\"\nAssets:PrepaidTax Expenses:Taxes 1000 USD\n\n# ... etc, in total 12 transactions\n```\n\nknut will take care that the total impact remains the same. Also, amounts are properly split, without remainder.\n\n```text\n@accrue \u003conce|daily|weekly|monthly|quarterly|yearly\u003e \u003cT0\u003e \u003cT1\u003e \u003caccrual account\u003e\n\u003ctransaction\u003e\n```\n\n### Balance assertions\n\nIt is often helpful to check whether the balance at a date corresponds to an expected value, for example a value given by a bank account statement. A balance assertion in knut performs this check and reports an error if the check fails:\n\n`YYYY-MM-DD balance \u003caccount\u003e \u003camount\u003e \u003ccommodity\u003e`\n\n### Value directive\n\nValue directives can be used to declare a certain account balance at a specific date. When encountering a value directive during evaluation, knut will automatically generate a transaction wich makes sure that the balance matches the indicated value. The generated transaction always has exactly one booking, and the two accounts are the given account and a special Equity:Valuation account.\n\n`YYYY-MM-DD value \u003caccount\u003e \u003camount\u003e \u003ccommodity\u003e`\n\nValue directives are handy in particular for modeling investment portfolios, where it is too much work to model every individual trade, for example in an automated trading system. In such a situation, declare inflows and outflows of the investment as usual, and provide value directives for any day the value of the investment can be established (ideally daily). knut will automatically generate transaction representing the value changes of the investment, after considering any given bookings affecting the account.\n\n### Prices\n\nknut has a power valuation engine, which can be used to create balance sheets in any currency or security which has pricing information. Prices are declared using price directives:\n\n`YYYY-MM-DD price \u003ccommodity\u003e \u003cprice\u003e \u003ctarget_commodity\u003e`\n\nFor example, `2020-10-03 price AAPL 45 USD` declares that AAPL cost 45 USD on 2020-10-03 (you wish...). knut is smart enough to derive indirect prices. For example, knut can print a balance with an AAPL position in CHF if a price for USD in CHF and a price for AAPL in USD exists. Prices are automatically inverted, as needed. knut will always use the latest available price for every given day. If a valuation is requried for a date before the first price is given, an error is reported.\n\n### Include directives\n\nIncome directives can be used to split a journal across a set of files. The given path is interpreted relative to the location of the file where the include directive appears.\n\n`include \"\u003crelative path\u003e\"`\n\nIt is entirely a matter of preference whether to use large files or a set of smaller files. knut ignores lines starting with '\\*', so those with a [powerful editor](http://www.emacs.org) can use org-mode to fold sections of a file, making it easy to manage files with tens of thousands of lines.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsboehler%2Fknut","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsboehler%2Fknut","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsboehler%2Fknut/lists"}