{"id":22062529,"url":"https://github.com/pmiddend/mt940-ledger","last_synced_at":"2025-03-23T17:40:42.628Z","repository":{"id":140077232,"uuid":"54670048","full_name":"pmiddend/mt940-ledger","owner":"pmiddend","description":"Interactively convert mt940 csv files to ledger","archived":false,"fork":false,"pushed_at":"2019-06-12T16:33:08.000Z","size":15,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T00:51:35.614Z","etag":null,"topics":["ledger","plaintextaccounting"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pmiddend.png","metadata":{"files":{"readme":"Readme.org","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":"2016-03-24T19:53:01.000Z","updated_at":"2024-02-24T21:47:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"7cede988-6261-4613-af52-ebb829695969","html_url":"https://github.com/pmiddend/mt940-ledger","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmiddend%2Fmt940-ledger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmiddend%2Fmt940-ledger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmiddend%2Fmt940-ledger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmiddend%2Fmt940-ledger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pmiddend","download_url":"https://codeload.github.com/pmiddend/mt940-ledger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245143968,"owners_count":20568049,"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":["ledger","plaintextaccounting"],"created_at":"2024-11-30T18:21:11.905Z","updated_at":"2025-03-23T17:40:42.606Z","avatar_url":"https://github.com/pmiddend.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"* mt940-ledger\n\n[[https://travis-ci.org/pmiddend/mt940-ledger.svg?branch=master][https://travis-ci.org/pmiddend/mt940-ledger.svg?branch=master]]\n\nmt940 is a small program to /interactively/ process a file stored in *MT940 CSV* format (which is exported by at least one large German bank) and store the results in [[http://ledger-cli.org/][ledger]] format.\n** Dependencies\nmt940-ledger only depends on the *readline* library, *make* and a recent *C++11 compiler* (gcc-4.9 or clang). On /Ubuntu/, you can install the package =libreadline-dev= and =build-essential= and you should be good to go.\n** Build\nTo build mt940-ledger, simply clone the repository, switch to it and execute =make=. The executable produced will be called =mt940-ledger=. If your compiler is clang, use =make CC=/usr/bin/clang++= to build. Currently, there is no =install= target available, and the Makefile isn't set up with proper care (pull requests welcome).\n\nIf you’re using [[https://nixos.org][the Nix package manager]], just run =nix-build= and you can execute the program via =result/bin/mt940-ledger=.\n** Usage\n*** Example\nmt940-ledger has a lot of command line parameters, all of them are mandatory (because I was too lazy to implement optional command line options). Let's see what a sample call looks like and what it does. Let's say you have the following sample mt940-csv file (called =sample.csv=):\n\n#+BEGIN_SRC csv\n\"Target account\";\"Booking date\";\"Value date\";\"Posting text\";\"Purpose\";\"Payer\";\"Account number\";\"BIC\";\"Amount\";\"Currency\"\n\"133731338\";\"29.01.16\";\"29.01.16\";\"Music for you\";\"SVWZ+Spotify\";\"Friend of mine\";\"DE423424295235\";\"INGFOOBAR\";\"-7,00\";\"EUR\"\n...\n#+END_SRC\n\nIn the shell, we enter the following\n\n#+BEGIN_EXAMPLE\n./mt940-ledger            \\\n  --separator=\\;          \\\n  --skip-header=true      \\\n  --date-format=%d.%m.%y  \\\n  --column-date=1         \\\n  --column-summary=3      \\\n  --column-purpose=4      \\\n  --column-payer=5        \\\n  --column-amount=8       \\\n  --column-currency=9     \\\n  --template-file=tem.txt \\\n  sample.csv              \\\n  /tmp/output.dat\n#+END_EXAMPLE\n\nAs you can see, there's a =template-file= argument. Each entry in the csv file is mapped to this template, inserting the appropriate placeholders. =tem.txt= looks like this:\n\n#+BEGIN_EXAMPLE\n${date} ${purpose}\n    ; summary: ${summary}\n    ; purpose: ${purpose}\n    ; payer: ${payer}\n    ${account}              ${amount} ${currency}\n    Assets:Main\n#+END_EXAMPLE\n\nThe output of the call above is the following:\n\n#+BEGIN_EXAMPLE\n2016/01/29 Spotify\n    ; summary: Music for you\n    ; purpose: Spotify\n    ; payer: Friend of mine\n    ${account}              -7,00 EUR\n    Assets:Main\n\nenter “s” to skip the entry, ctrl+d to exit\npurpose [Spotify] \n#+END_EXAMPLE\n\nNow we enter the purpose or press return to use \"Spotify\" as our purpose (which is fine). Then we are prompted for the target account (for example =Expenses:Leisure:Music=) and then =/tmp/output.dat= gets a new entry:\n\n#+BEGIN_EXAMPLE\n2016/01/29 Spotify\n    ; summary: Music for you\n    ; purpose: Spotify\n    ; payer: Friend of mine\n    Expenses:Leisure:Music              -7,00 EUR\n    Assets:Main\n#+END_EXAMPLE\n*** Command line parameters\nThe following parameters exist (columns start with index zero, boolean values are =yes/no,0/1,true/false=):\n\n| Parameter       | Description                                        |\n|-----------------+----------------------------------------------------|\n| =template-file=   | See above example                                  |\n| =separator=       | CSV separator                                      |\n| =skip-header=     | Skip the first line of the CSV file                |\n| =date-format=     | CSV date format to parse via strptime              |\n| =column-date=     | Column for the date                                |\n| =column-summary=  | Column for the summary (negative if not present)   |\n| =column-purpose=  | SWIFT column for purpose (negative if not present) |\n| =column-payer=    | Column for the payer (negative if not present)     |\n| =column-amount=   | Column for the amount                              |\n| =column-currency= | Column for the currency                            |\n\nSWIFT columns follow the SWIFT coding. If your CSV file has a column with funny strings in it like =SVWZ+= or =+EREF=, it's SWIFT. Use =column-purpose= on it. mt940-ledger will parse the \"real\" purpose from it.\n\nThere are two positional arguments (ones without a =--foo== parameter in front of them). The first one is the input CSV file, the second one the output file. There is no magic =-= constant meaning =stdout=.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmiddend%2Fmt940-ledger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpmiddend%2Fmt940-ledger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmiddend%2Fmt940-ledger/lists"}