{"id":48351186,"url":"https://github.com/arnhemcr/financial","last_synced_at":"2026-05-22T07:01:24.613Z","repository":{"id":298205210,"uuid":"997607106","full_name":"arnhemcr/financial","owner":"arnhemcr","description":"This Go module provides programs to help translate a CSV financial transaction statement to a Ledger journal and merge multiple Ledger journals into a general journal.","archived":false,"fork":false,"pushed_at":"2026-05-20T06:25:06.000Z","size":150,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-20T09:58:50.460Z","etag":null,"topics":["command-line-tool","csv-exportor","csv-parser","filter","go","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":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arnhemcr.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-06T20:21:50.000Z","updated_at":"2026-05-20T06:33:53.000Z","dependencies_parsed_at":"2025-06-10T00:24:52.839Z","dependency_job_id":null,"html_url":"https://github.com/arnhemcr/financial","commit_stats":null,"previous_names":["arnhemcr/financial"],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/arnhemcr/financial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arnhemcr%2Ffinancial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arnhemcr%2Ffinancial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arnhemcr%2Ffinancial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arnhemcr%2Ffinancial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arnhemcr","download_url":"https://codeload.github.com/arnhemcr/financial/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arnhemcr%2Ffinancial/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33333281,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T12:23:38.849Z","status":"online","status_checked_at":"2026-05-22T02:00:06.671Z","response_time":265,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["command-line-tool","csv-exportor","csv-parser","filter","go","ledger","plaintext-accounting"],"created_at":"2026-04-05T09:03:14.708Z","updated_at":"2026-05-22T07:01:24.605Z","avatar_url":"https://github.com/arnhemcr.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Arnhemcr/financial\n\nThis [Go] module offers [filter] programs to:\n * help translate financial transactions from a [comma-separated values (CSV)] statement\n   into a journal for the [Ledger] command-line accounting system\n * merge Ledger journals into a general journal for reporting and analysis\n\nIts only dependency is the [Go standard library].\n\n# Example\n\nAn individual has two accounts: one with National Bank (NB) and the other with Local Credit Union (LCU).\nThese institutions provide CSV statements with different sets of transactions details and record formats.\nThis example translates those CSV statements into Ledger journals.\nIt then merges those journals into a general journal.\n\n## Dependencies\n\n* a [Go installation]\n* a program to match text strings and substitute one for another e.g. the stream editor [sed]\n* connecting programs together in a pipeline and redirecting output to a file\n* a [Ledger installation]\n\n## Install programs\n\nInstall this module's program csv2trn from its directory with `go install`.\nVerify by viewing its help text with `csv2trn -h`.\nThen install and verify programs mcsv2lent and mrglent.\n\n## Translate CSV statements into Ledger journals\n\nIn the example directory, translate the statements into journals with:\n```\n# Initialise both journals.\ncp NB_0.journal NB.journal\ncp LCU_0.journal LCU.journal\n\ncat NB.csv | csv2trn -f NB.xml -c GBP -o mcsv | sed -f accounts.sed | \\\n\tmcsv2lent -f journalAccounts.xml \u003e\u003eNB.journal\ncat LCU.csv | csv2trn -f LCU.xml -t Assets:Emergency -c GBP -o mcsv | sed -f accounts.sed | \\\n\tmcsv2lent -f journalAccounts.xml \u003e\u003eLCU.journal\n```\n\nThe pipelines load a CSV statement with cat, process its transactions then append entries to the journals.\nA transaction is the transfer of an amount of currency between accounts on a particular day.\nIt is described by a memo and code, also called the description and transaction type.\nA statement and its records belong to an account, which in a transaction is called this account.\n\nProgram csv2trn reads the statement line by line, parses transactions from CSV records following the input format in XML\nand warns about lines that cannot be parsed.\nRecords from LCU do not provide this account, so it is set to its Ledger name Assets:Emergency.\nIf other account is not provided it defaults to Imbalance.\nAlthough csv2trn can be configured to read any date layout, it defaults to YYYY-MM-DD (the [ISO 8601] extended date layout), which is used by the rest of this module.\nThe program writes transactions in this module's CSV record format (mcsv) ordered by date ascending.\n\nThe stream editor sed substitutes Ledger account names for account numbers and for Imbalance by matching the transaction's memo.\n\n## Mark mirror entries in Ledger journals\n\nTransfers between accounts with journals have two entries: a debit in one mirrored by a credit in the other.\nWhen merging journals into a general journal, one of these entries must be discarded so the transfer happens once not twice.\n\nReturning to the example above, mcsv2lent reads transactions in mcsv format then writes them in Ledger entry format (lent).\nFor transfers between accounts with journals, whose Ledger account names are on the list in XML, the credit entry is marked with \"mirror entry\" comments.\n\nUse Ledger to verify the LCU journal with `ledger -f LCU.journal register Assets:Emergency`.\nThere are three entries with a current balance of 42.42 GBP.\nVerify the \"To emergency fund\" entry in that journal is marked as a mirror with `cat LCU.journal`.\n\n## Merge Ledger journals into a general journal\n\nMerge the journals into a general journal with:\n```\ncat NB.journal LCU.journal | mrglent \u003egeneral.journal\n```\nProgram mrglent reads the journals and writes entries ordered by date ascending.\nAll other journal content is discarded including mirror entries, automatic transactions and command directives as well as block and global comments.\n\nVerify the general journal with `ledger -f general.journal register Assets:Emergency` which has the same entries and balance as above.\nThen verify the accounts and their balances with `ledger -f general.journal balance` are:\n```\n 96.28 GBP  Assets\n 53.86 GBP    Current\n 42.42 GBP    Emergency\n-37.79 GBP  Equity:OpeningBalances\n 32.63 GBP  Expenses\n 20.00 GBP    Cash\n 12.63 GBP    Rates\n  4.38 GBP  Imbalance\n-95.50 GBP  Income\n -0.13 GBP    NetInterest\n-95.37 GBP    Salary\n----------\n         0\n```\n\n[comma-separated values (CSV)]: https://en.wikipedia.org/wiki/Comma-separated_values\n[filter]: https://en.wikipedia.org/wiki/Filter_(software)\n[Go]: https://go.dev\n[Go installation]: https://go.dev/doc/install\n[Go standard library]: https://pkg.go.dev/std\n[ISO 8601]: https://en.wikipedia.org/wiki/ISO_8601#Calendar_dates\n[Ledger]: https://ledger-cli.org\n[Ledger installation]: https://ledger-cli.org/download.html\n[sed]: https://www.gnu.org/software/sed/manual/sed.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farnhemcr%2Ffinancial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farnhemcr%2Ffinancial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farnhemcr%2Ffinancial/lists"}